Average Error: 2.1 → 2.5
Time: 26.8s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;z \le -2.3206655123942797 \cdot 10^{+53}:\\ \;\;\;\;\frac{\frac{y - x}{t}}{\frac{1}{z}} + x\\ \mathbf{elif}\;z \le 8.023353980350224 \cdot 10^{+166}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y - x}{\frac{t}{z}} + x\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;z \le -2.3206655123942797 \cdot 10^{+53}:\\
\;\;\;\;\frac{\frac{y - x}{t}}{\frac{1}{z}} + x\\

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

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

\end{array}
double f(double x, double y, double z, double t) {
        double r39595523 = x;
        double r39595524 = y;
        double r39595525 = r39595524 - r39595523;
        double r39595526 = z;
        double r39595527 = t;
        double r39595528 = r39595526 / r39595527;
        double r39595529 = r39595525 * r39595528;
        double r39595530 = r39595523 + r39595529;
        return r39595530;
}

double f(double x, double y, double z, double t) {
        double r39595531 = z;
        double r39595532 = -2.3206655123942797e+53;
        bool r39595533 = r39595531 <= r39595532;
        double r39595534 = y;
        double r39595535 = x;
        double r39595536 = r39595534 - r39595535;
        double r39595537 = t;
        double r39595538 = r39595536 / r39595537;
        double r39595539 = 1.0;
        double r39595540 = r39595539 / r39595531;
        double r39595541 = r39595538 / r39595540;
        double r39595542 = r39595541 + r39595535;
        double r39595543 = 8.023353980350224e+166;
        bool r39595544 = r39595531 <= r39595543;
        double r39595545 = r39595536 * r39595531;
        double r39595546 = r39595545 / r39595537;
        double r39595547 = r39595546 + r39595535;
        double r39595548 = r39595537 / r39595531;
        double r39595549 = r39595536 / r39595548;
        double r39595550 = r39595549 + r39595535;
        double r39595551 = r39595544 ? r39595547 : r39595550;
        double r39595552 = r39595533 ? r39595542 : r39595551;
        return r39595552;
}

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.1
Target2.3
Herbie2.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 3 regimes
  2. if z < -2.3206655123942797e+53

    1. Initial program 5.6

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied clear-num5.7

      \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\frac{1}{\frac{t}{z}}}\]
    4. Applied un-div-inv5.2

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
    5. Using strategy rm
    6. Applied div-inv5.2

      \[\leadsto x + \frac{y - x}{\color{blue}{t \cdot \frac{1}{z}}}\]
    7. Applied associate-/r*2.1

      \[\leadsto x + \color{blue}{\frac{\frac{y - x}{t}}{\frac{1}{z}}}\]

    if -2.3206655123942797e+53 < z < 8.023353980350224e+166

    1. Initial program 1.2

      \[x + \left(y - x\right) \cdot \frac{z}{t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity1.2

      \[\leadsto x + \left(y - x\right) \cdot \frac{z}{\color{blue}{1 \cdot t}}\]
    4. Applied associate-/r*1.2

      \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\frac{\frac{z}{1}}{t}}\]
    5. Applied associate-*r/2.4

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

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

    if 8.023353980350224e+166 < z

    1. Initial program 5.1

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

      \[\leadsto x + \left(y - x\right) \cdot \color{blue}{\frac{1}{\frac{t}{z}}}\]
    4. Applied un-div-inv4.4

      \[\leadsto x + \color{blue}{\frac{y - x}{\frac{t}{z}}}\]
  3. Recombined 3 regimes into one program.
  4. Final simplification2.5

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \le -2.3206655123942797 \cdot 10^{+53}:\\ \;\;\;\;\frac{\frac{y - x}{t}}{\frac{1}{z}} + x\\ \mathbf{elif}\;z \le 8.023353980350224 \cdot 10^{+166}:\\ \;\;\;\;\frac{\left(y - x\right) \cdot z}{t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y - x}{\frac{t}{z}} + x\\ \end{array}\]

Reproduce

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