Average Error: 10.6 → 1.0
Time: 3.2s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -2.8513781619655557 \cdot 10^{-52}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \le 3.89402571721805395 \cdot 10^{-69}:\\ \;\;\;\;x + \frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;\left(x + \frac{y}{\frac{a - z}{t}}\right) - \frac{z}{\frac{a - z}{t}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -2.8513781619655557 \cdot 10^{-52}:\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot t\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r779349 = x;
        double r779350 = y;
        double r779351 = z;
        double r779352 = r779350 - r779351;
        double r779353 = t;
        double r779354 = r779352 * r779353;
        double r779355 = a;
        double r779356 = r779355 - r779351;
        double r779357 = r779354 / r779356;
        double r779358 = r779349 + r779357;
        return r779358;
}

double f(double x, double y, double z, double t, double a) {
        double r779359 = t;
        double r779360 = -2.8513781619655557e-52;
        bool r779361 = r779359 <= r779360;
        double r779362 = x;
        double r779363 = y;
        double r779364 = z;
        double r779365 = r779363 - r779364;
        double r779366 = a;
        double r779367 = r779366 - r779364;
        double r779368 = r779365 / r779367;
        double r779369 = r779368 * r779359;
        double r779370 = r779362 + r779369;
        double r779371 = 3.894025717218054e-69;
        bool r779372 = r779359 <= r779371;
        double r779373 = 1.0;
        double r779374 = r779365 * r779359;
        double r779375 = r779367 / r779374;
        double r779376 = r779373 / r779375;
        double r779377 = r779362 + r779376;
        double r779378 = r779367 / r779359;
        double r779379 = r779363 / r779378;
        double r779380 = r779362 + r779379;
        double r779381 = r779364 / r779378;
        double r779382 = r779380 - r779381;
        double r779383 = r779372 ? r779377 : r779382;
        double r779384 = r779361 ? r779370 : r779383;
        return r779384;
}

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

Original10.6
Target0.6
Herbie1.0
\[\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 t < -2.8513781619655557e-52

    1. Initial program 19.0

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

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

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

    if -2.8513781619655557e-52 < t < 3.894025717218054e-69

    1. Initial program 0.4

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

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

    if 3.894025717218054e-69 < t

    1. Initial program 18.0

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

      \[\leadsto x + \color{blue}{\frac{y - z}{\frac{a - z}{t}}}\]
    4. Using strategy rm
    5. Applied div-sub2.4

      \[\leadsto x + \color{blue}{\left(\frac{y}{\frac{a - z}{t}} - \frac{z}{\frac{a - z}{t}}\right)}\]
    6. Applied associate-+r-2.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;t \le -2.8513781619655557 \cdot 10^{-52}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \le 3.89402571721805395 \cdot 10^{-69}:\\ \;\;\;\;x + \frac{1}{\frac{a - z}{\left(y - z\right) \cdot t}}\\ \mathbf{else}:\\ \;\;\;\;\left(x + \frac{y}{\frac{a - z}{t}}\right) - \frac{z}{\frac{a - z}{t}}\\ \end{array}\]

Reproduce

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

  :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))))