Average Error: 2.0 → 0.8
Time: 13.8s
Precision: 64
\[x + \left(y - x\right) \cdot \frac{z}{t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{z}{t} = -\infty:\\ \;\;\;\;x + \frac{1}{\frac{t}{z \cdot \left(y - x\right)}}\\ \mathbf{elif}\;\frac{z}{t} \le -2.409265180973639206758559822292383386784 \cdot 10^{-271} \lor \neg \left(\frac{z}{t} \le -0.0\right):\\ \;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\ \mathbf{else}:\\ \;\;\;\;x + z \cdot \frac{y - x}{t}\\ \end{array}\]
x + \left(y - x\right) \cdot \frac{z}{t}
\begin{array}{l}
\mathbf{if}\;\frac{z}{t} = -\infty:\\
\;\;\;\;x + \frac{1}{\frac{t}{z \cdot \left(y - x\right)}}\\

\mathbf{elif}\;\frac{z}{t} \le -2.409265180973639206758559822292383386784 \cdot 10^{-271} \lor \neg \left(\frac{z}{t} \le -0.0\right):\\
\;\;\;\;x + \left(y - x\right) \cdot \frac{z}{t}\\

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

\end{array}
double f(double x, double y, double z, double t) {
        double r456393 = x;
        double r456394 = y;
        double r456395 = r456394 - r456393;
        double r456396 = z;
        double r456397 = t;
        double r456398 = r456396 / r456397;
        double r456399 = r456395 * r456398;
        double r456400 = r456393 + r456399;
        return r456400;
}

double f(double x, double y, double z, double t) {
        double r456401 = z;
        double r456402 = t;
        double r456403 = r456401 / r456402;
        double r456404 = -inf.0;
        bool r456405 = r456403 <= r456404;
        double r456406 = x;
        double r456407 = 1.0;
        double r456408 = y;
        double r456409 = r456408 - r456406;
        double r456410 = r456401 * r456409;
        double r456411 = r456402 / r456410;
        double r456412 = r456407 / r456411;
        double r456413 = r456406 + r456412;
        double r456414 = -2.409265180973639e-271;
        bool r456415 = r456403 <= r456414;
        double r456416 = -0.0;
        bool r456417 = r456403 <= r456416;
        double r456418 = !r456417;
        bool r456419 = r456415 || r456418;
        double r456420 = r456409 * r456403;
        double r456421 = r456406 + r456420;
        double r456422 = r456409 / r456402;
        double r456423 = r456401 * r456422;
        double r456424 = r456406 + r456423;
        double r456425 = r456419 ? r456421 : r456424;
        double r456426 = r456405 ? r456413 : r456425;
        return r456426;
}

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
Herbie0.8
\[\begin{array}{l} \mathbf{if}\;\left(y - x\right) \cdot \frac{z}{t} \lt -1013646692435.88671875:\\ \;\;\;\;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 t) < -inf.0

    1. Initial program 64.0

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

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

      \[\leadsto x + \frac{\color{blue}{z \cdot \left(y - x\right)}}{t}\]
    5. Using strategy rm
    6. Applied clear-num0.4

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

    if -inf.0 < (/ z t) < -2.409265180973639e-271 or -0.0 < (/ z t)

    1. Initial program 1.2

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

    if -2.409265180973639e-271 < (/ z t) < -0.0

    1. Initial program 2.9

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

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

      \[\leadsto x + \frac{\color{blue}{z \cdot \left(y - x\right)}}{t}\]
    5. Using strategy rm
    6. Applied *-un-lft-identity0.1

      \[\leadsto x + \frac{z \cdot \left(y - x\right)}{\color{blue}{1 \cdot t}}\]
    7. Applied times-frac0.0

      \[\leadsto x + \color{blue}{\frac{z}{1} \cdot \frac{y - x}{t}}\]
    8. Simplified0.0

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

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

Reproduce

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

  :herbie-target
  (if (< (* (- y x) (/ z t)) -1013646692435.887) (+ 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))))