Average Error: 12.5 → 1.4
Time: 10.8s
Precision: 64
\[\frac{x \cdot \left(y - z\right)}{y}\]
\[\begin{array}{l} \mathbf{if}\;z \le -9.212480238144806744922579169167130922594 \cdot 10^{101} \lor \neg \left(z \le 2.612548515443596481357026291817852860366 \cdot 10^{170}\right):\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\sqrt[3]{y - z}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{y - z}}\\ \end{array}\]
\frac{x \cdot \left(y - z\right)}{y}
\begin{array}{l}
\mathbf{if}\;z \le -9.212480238144806744922579169167130922594 \cdot 10^{101} \lor \neg \left(z \le 2.612548515443596481357026291817852860366 \cdot 10^{170}\right):\\
\;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\sqrt[3]{y - z}}}\\

\mathbf{else}:\\
\;\;\;\;\frac{x}{\frac{y}{y - z}}\\

\end{array}
double f(double x, double y, double z) {
        double r550374 = x;
        double r550375 = y;
        double r550376 = z;
        double r550377 = r550375 - r550376;
        double r550378 = r550374 * r550377;
        double r550379 = r550378 / r550375;
        return r550379;
}

double f(double x, double y, double z) {
        double r550380 = z;
        double r550381 = -9.212480238144807e+101;
        bool r550382 = r550380 <= r550381;
        double r550383 = 2.6125485154435965e+170;
        bool r550384 = r550380 <= r550383;
        double r550385 = !r550384;
        bool r550386 = r550382 || r550385;
        double r550387 = x;
        double r550388 = cbrt(r550387);
        double r550389 = r550388 * r550388;
        double r550390 = y;
        double r550391 = cbrt(r550390);
        double r550392 = r550391 * r550391;
        double r550393 = r550390 - r550380;
        double r550394 = cbrt(r550393);
        double r550395 = r550394 * r550394;
        double r550396 = r550392 / r550395;
        double r550397 = r550389 / r550396;
        double r550398 = r550391 / r550394;
        double r550399 = r550388 / r550398;
        double r550400 = r550397 * r550399;
        double r550401 = r550390 / r550393;
        double r550402 = r550387 / r550401;
        double r550403 = r550386 ? r550400 : r550402;
        return r550403;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original12.5
Target3.1
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;z \lt -2.060202331921739024383612783691266533098 \cdot 10^{104}:\\ \;\;\;\;x - \frac{z \cdot x}{y}\\ \mathbf{elif}\;z \lt 1.693976601382852594702773997610248441465 \cdot 10^{213}:\\ \;\;\;\;\frac{x}{\frac{y}{y - z}}\\ \mathbf{else}:\\ \;\;\;\;\left(y - z\right) \cdot \frac{x}{y}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -9.212480238144807e+101 or 2.6125485154435965e+170 < z

    1. Initial program 13.5

      \[\frac{x \cdot \left(y - z\right)}{y}\]
    2. Using strategy rm
    3. Applied associate-/l*10.9

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{y - z}}}\]
    4. Using strategy rm
    5. Applied add-cube-cbrt11.8

      \[\leadsto \frac{x}{\frac{y}{\color{blue}{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}}}}\]
    6. Applied add-cube-cbrt11.8

      \[\leadsto \frac{x}{\frac{\color{blue}{\left(\sqrt[3]{y} \cdot \sqrt[3]{y}\right) \cdot \sqrt[3]{y}}}{\left(\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}\right) \cdot \sqrt[3]{y - z}}}\]
    7. Applied times-frac11.8

      \[\leadsto \frac{x}{\color{blue}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{y - z}}}}\]
    8. Applied add-cube-cbrt12.2

      \[\leadsto \frac{\color{blue}{\left(\sqrt[3]{x} \cdot \sqrt[3]{x}\right) \cdot \sqrt[3]{x}}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}} \cdot \frac{\sqrt[3]{y}}{\sqrt[3]{y - z}}}\]
    9. Applied times-frac3.1

      \[\leadsto \color{blue}{\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\sqrt[3]{y - z}}}}\]

    if -9.212480238144807e+101 < z < 2.6125485154435965e+170

    1. Initial program 12.2

      \[\frac{x \cdot \left(y - z\right)}{y}\]
    2. Using strategy rm
    3. Applied associate-/l*1.0

      \[\leadsto \color{blue}{\frac{x}{\frac{y}{y - z}}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.4

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -9.212480238144806744922579169167130922594 \cdot 10^{101} \lor \neg \left(z \le 2.612548515443596481357026291817852860366 \cdot 10^{170}\right):\\ \;\;\;\;\frac{\sqrt[3]{x} \cdot \sqrt[3]{x}}{\frac{\sqrt[3]{y} \cdot \sqrt[3]{y}}{\sqrt[3]{y - z} \cdot \sqrt[3]{y - z}}} \cdot \frac{\sqrt[3]{x}}{\frac{\sqrt[3]{y}}{\sqrt[3]{y - z}}}\\ \mathbf{else}:\\ \;\;\;\;\frac{x}{\frac{y}{y - z}}\\ \end{array}\]

Reproduce

herbie shell --seed 2019305 
(FPCore (x y z)
  :name "Diagrams.Backend.Cairo.Internal:setTexture from diagrams-cairo-1.3.0.3"
  :precision binary64

  :herbie-target
  (if (< z -2.060202331921739e104) (- x (/ (* z x) y)) (if (< z 1.69397660138285259e213) (/ x (/ y (- y z))) (* (- y z) (/ x y))))

  (/ (* x (- y z)) y))