Average Error: 10.9 → 1.3
Time: 1.1m
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -506492498426377024:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t + x\\ \mathbf{elif}\;t \le 5.069206892757613215513641785873507027095 \cdot 10^{-123}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -506492498426377024:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r24725771 = x;
        double r24725772 = y;
        double r24725773 = z;
        double r24725774 = r24725772 - r24725773;
        double r24725775 = t;
        double r24725776 = r24725774 * r24725775;
        double r24725777 = a;
        double r24725778 = r24725777 - r24725773;
        double r24725779 = r24725776 / r24725778;
        double r24725780 = r24725771 + r24725779;
        return r24725780;
}

double f(double x, double y, double z, double t, double a) {
        double r24725781 = t;
        double r24725782 = -5.06492498426377e+17;
        bool r24725783 = r24725781 <= r24725782;
        double r24725784 = y;
        double r24725785 = z;
        double r24725786 = r24725784 - r24725785;
        double r24725787 = a;
        double r24725788 = r24725787 - r24725785;
        double r24725789 = r24725786 / r24725788;
        double r24725790 = r24725789 * r24725781;
        double r24725791 = x;
        double r24725792 = r24725790 + r24725791;
        double r24725793 = 5.069206892757613e-123;
        bool r24725794 = r24725781 <= r24725793;
        double r24725795 = r24725786 * r24725781;
        double r24725796 = r24725795 / r24725788;
        double r24725797 = r24725791 + r24725796;
        double r24725798 = r24725788 / r24725781;
        double r24725799 = r24725786 / r24725798;
        double r24725800 = r24725791 + r24725799;
        double r24725801 = r24725794 ? r24725797 : r24725800;
        double r24725802 = r24725783 ? r24725792 : r24725801;
        return r24725802;
}

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.9
Target0.6
Herbie1.3
\[\begin{array}{l} \mathbf{if}\;t \lt -1.068297449017406694366747246993994850729 \cdot 10^{-39}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{elif}\;t \lt 3.911094988758637497591020599238553861375 \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 < -5.06492498426377e+17

    1. Initial program 25.0

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

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

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

    if -5.06492498426377e+17 < t < 5.069206892757613e-123

    1. Initial program 0.5

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

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

    if 5.069206892757613e-123 < t

    1. Initial program 15.6

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

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

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

Reproduce

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