Average Error: 1.9 → 1.7
Time: 20.1s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z}{t} = -\infty \lor \neg \left(\frac{z}{t} \le 4.9499281820475569 \cdot 10^{40}\right):\\ \;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} = -\infty \lor \neg \left(\frac{z}{t} \le 4.9499281820475569 \cdot 10^{40}\right):\\
\;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot z}{t}\right)\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r358445 = x;
        double r358446 = y;
        double r358447 = r358446 - r358445;
        double r358448 = z;
        double r358449 = t;
        double r358450 = r358448 / r358449;
        double r358451 = r358447 * r358450;
        double r358452 = r358445 + r358451;
        return r358452;
}

double f(double x, double y, double z, double t) {
        double r358453 = z;
        double r358454 = t;
        double r358455 = r358453 / r358454;
        double r358456 = -inf.0;
        bool r358457 = r358455 <= r358456;
        double r358458 = 4.949928182047557e+40;
        bool r358459 = r358455 <= r358458;
        double r358460 = !r358459;
        bool r358461 = r358457 || r358460;
        double r358462 = x;
        double r358463 = y;
        double r358464 = r358453 * r358463;
        double r358465 = r358464 / r358454;
        double r358466 = r358462 * r358453;
        double r358467 = r358466 / r358454;
        double r358468 = r358465 - r358467;
        double r358469 = r358462 + r358468;
        double r358470 = r358463 - r358462;
        double r358471 = r358470 * r358455;
        double r358472 = r358462 + r358471;
        double r358473 = r358461 ? r358469 : r358472;
        return r358473;
}

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

Original1.9
Target2.1
Herbie1.7
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.887:\\ \;\;\;\;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 t) < -inf.0 or 4.949928182047557e+40 < (/ z t)

    1. Initial program 8.6

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied add-cube-cbrt9.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-identity9.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-frac9.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*5.8

      \[\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. Simplified5.7

      \[\leadsto x + \color{blue}{\frac{y - x}{\sqrt[3]{t} \cdot \sqrt[3]{t}}} \cdot \frac{z}{\sqrt[3]{t}}\]
    8. Taylor expanded around 0 7.4

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

    if -inf.0 < (/ z t) < 4.949928182047557e+40

    1. Initial program 0.8

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{z}{t} = -\infty \lor \neg \left(\frac{z}{t} \le 4.9499281820475569 \cdot 10^{40}\right):\\ \;\;\;\;x + \left(\frac{z \cdot y}{t} - \frac{x \cdot z}{t}\right)\\ \mathbf{else}:\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \end{array}\]

Reproduce

herbie shell --seed 2019198 
(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))))