Average Error: 2.0 → 1.5
Time: 22.5s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -6.207004724646703 \cdot 10^{+17}:\\ \;\;\;\;\left(\frac{z}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}}\right) \cdot \left(\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}\right) + x\\ \mathbf{elif}\;z \le 177647641881842.78:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{z}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}}\right) \cdot \left(\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}\right) + x\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;z \le -6.207004724646703 \cdot 10^{+17}:\\
\;\;\;\;\left(\frac{z}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}}\right) \cdot \left(\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}\right) + x\\

\mathbf{elif}\;z \le 177647641881842.78:\\
\;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\

\mathbf{else}:\\
\;\;\;\;\left(\frac{z}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}}\right) \cdot \left(\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}\right) + x\\

\end{array}
double f(double x, double y, double z, double t) {
        double r31555275 = x;
        double r31555276 = y;
        double r31555277 = r31555276 - r31555275;
        double r31555278 = z;
        double r31555279 = t;
        double r31555280 = r31555278 / r31555279;
        double r31555281 = r31555277 * r31555280;
        double r31555282 = r31555275 + r31555281;
        return r31555282;
}

double f(double x, double y, double z, double t) {
        double r31555283 = z;
        double r31555284 = -6.207004724646703e+17;
        bool r31555285 = r31555283 <= r31555284;
        double r31555286 = t;
        double r31555287 = cbrt(r31555286);
        double r31555288 = r31555283 / r31555287;
        double r31555289 = y;
        double r31555290 = x;
        double r31555291 = r31555289 - r31555290;
        double r31555292 = r31555291 / r31555287;
        double r31555293 = cbrt(r31555292);
        double r31555294 = r31555293 / r31555287;
        double r31555295 = r31555288 * r31555294;
        double r31555296 = r31555293 * r31555293;
        double r31555297 = r31555295 * r31555296;
        double r31555298 = r31555297 + r31555290;
        double r31555299 = 177647641881842.78;
        bool r31555300 = r31555283 <= r31555299;
        double r31555301 = r31555291 * r31555283;
        double r31555302 = r31555301 / r31555286;
        double r31555303 = r31555290 + r31555302;
        double r31555304 = r31555300 ? r31555303 : r31555298;
        double r31555305 = r31555285 ? r31555298 : r31555304;
        return r31555305;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original2.0
Target2.2
Herbie1.5
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.8867:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \mathbf{elif}\;\left(y - x\right) \cdot \frac{z}{t} \lt -0.0:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - x}{\frac{t}{z}}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if z < -6.207004724646703e+17 or 177647641881842.78 < z

    1. Initial program 3.8

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt4.6

      \[\leadsto x + \left(y - x\right) \cdot \frac{z}{\color{blue}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}}\]
    4. Applied *-un-lft-identity4.6

      \[\leadsto x + \left(y - x\right) \cdot \frac{\color{blue}{1 \cdot z}}{\left(\sqrt[3]{t} \cdot \sqrt[3]{t}\right) \cdot \sqrt[3]{t}}\]
    5. Applied times-frac4.6

      \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\left(\frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right)}\]
    6. Applied associate-*r*2.3

      \[\leadsto x + \color{blue}{\left(\left(y - x\right) \cdot \frac{1}{\sqrt[3]{t} \cdot \sqrt[3]{t}}\right) \cdot \frac{z}{\sqrt[3]{t}}}\]
    7. Simplified2.3

      \[\leadsto x + \color{blue}{\frac{\frac{y - x}{\sqrt[3]{t}}}{\sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\]
    8. Using strategy rm
    9. Applied *-un-lft-identity2.3

      \[\leadsto x + \frac{\frac{y - x}{\sqrt[3]{t}}}{\color{blue}{1 \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\]
    10. Applied add-cube-cbrt2.5

      \[\leadsto x + \frac{\color{blue}{\left(\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}\right) \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}}{1 \cdot \sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\]
    11. Applied times-frac2.5

      \[\leadsto x + \color{blue}{\left(\frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{1} \cdot \frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}}\right)} \cdot \frac{z}{\sqrt[3]{t}}\]
    12. Applied associate-*l*2.2

      \[\leadsto x + \color{blue}{\frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{1} \cdot \left(\frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}} \cdot \frac{z}{\sqrt[3]{t}}\right)}\]

    if -6.207004724646703e+17 < z < 177647641881842.78

    1. Initial program 1.0

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

      \[\leadsto x + \color{blue}{\frac{\left(y - x\right) \cdot z}{t}}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -6.207004724646703 \cdot 10^{+17}:\\ \;\;\;\;\left(\frac{z}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}}\right) \cdot \left(\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}\right) + x\\ \mathbf{elif}\;z \le 177647641881842.78:\\ \;\;\;\;x + \frac{\left(y - x\right) \cdot z}{t}\\ \mathbf{else}:\\ \;\;\;\;\left(\frac{z}{\sqrt[3]{t}} \cdot \frac{\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}}{\sqrt[3]{t}}\right) \cdot \left(\sqrt[3]{\frac{y - x}{\sqrt[3]{t}}} \cdot \sqrt[3]{\frac{y - x}{\sqrt[3]{t}}}\right) + x\\ \end{array}\]

Reproduce

herbie shell --seed 2019164 
(FPCore (x y z t)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:tickPosition from plot-0.2.3.4"

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.8867) (+ x (/ (- y x) (/ t z))) (if (< (* (- y x) (/ z t)) -0.0) (+ x (/ (* (- y x) z) t)) (+ x (/ (- y x) (/ t z)))))

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