Average Error: 9.9 → 0.8
Time: 15.3s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} = -\infty:\\ \;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right) + x\\ \mathbf{elif}\;\frac{\left(y - z\right) \cdot t}{a - z} \le 2.68971564945225 \cdot 10^{-51}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;t \cdot \frac{y - z}{a - z} + x\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;\frac{\left(y - z\right) \cdot t}{a - z} = -\infty:\\
\;\;\;\;\frac{t}{a - z} \cdot \left(y - z\right) + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r32476324 = x;
        double r32476325 = y;
        double r32476326 = z;
        double r32476327 = r32476325 - r32476326;
        double r32476328 = t;
        double r32476329 = r32476327 * r32476328;
        double r32476330 = a;
        double r32476331 = r32476330 - r32476326;
        double r32476332 = r32476329 / r32476331;
        double r32476333 = r32476324 + r32476332;
        return r32476333;
}

double f(double x, double y, double z, double t, double a) {
        double r32476334 = y;
        double r32476335 = z;
        double r32476336 = r32476334 - r32476335;
        double r32476337 = t;
        double r32476338 = r32476336 * r32476337;
        double r32476339 = a;
        double r32476340 = r32476339 - r32476335;
        double r32476341 = r32476338 / r32476340;
        double r32476342 = -inf.0;
        bool r32476343 = r32476341 <= r32476342;
        double r32476344 = r32476337 / r32476340;
        double r32476345 = r32476344 * r32476336;
        double r32476346 = x;
        double r32476347 = r32476345 + r32476346;
        double r32476348 = 2.68971564945225e-51;
        bool r32476349 = r32476341 <= r32476348;
        double r32476350 = r32476341 + r32476346;
        double r32476351 = r32476336 / r32476340;
        double r32476352 = r32476337 * r32476351;
        double r32476353 = r32476352 + r32476346;
        double r32476354 = r32476349 ? r32476350 : r32476353;
        double r32476355 = r32476343 ? r32476347 : r32476354;
        return r32476355;
}

Error

Bits error versus x

Bits error versus y

Bits error versus z

Bits error versus t

Bits error versus a

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original9.9
Target0.6
Herbie0.8
\[\begin{array}{l} \mathbf{if}\;t \lt -1.0682974490174067 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.9110949887586375 \cdot 10^{-141}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if (/ (* (- y z) t) (- a z)) < -inf.0

    1. Initial program 60.1

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

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

      \[\leadsto x + \color{blue}{\frac{y - z}{1} \cdot \frac{t}{a - z}}\]
    5. Simplified0.2

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

    if -inf.0 < (/ (* (- y z) t) (- a z)) < 2.68971564945225e-51

    1. Initial program 0.3

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

    if 2.68971564945225e-51 < (/ (* (- y z) t) (- a z))

    1. Initial program 18.3

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/2.2

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

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

Reproduce

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

  :herbie-target
  (if (< t -1.0682974490174067e-39) (+ x (* (/ (- y z) (- a z)) t)) (if (< t 3.9110949887586375e-141) (+ x (/ (* (- y z) t) (- a z))) (+ x (* (/ (- y z) (- a z)) t))))

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