Average Error: 10.7 → 0.7
Time: 20.9s
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 1.646464419092921736686674766696196277622 \cdot 10^{153}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{a - z}{t}}{y - 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 1.646464419092921736686674766696196277622 \cdot 10^{153}:\\
\;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r26425999 = x;
        double r26426000 = y;
        double r26426001 = z;
        double r26426002 = r26426000 - r26426001;
        double r26426003 = t;
        double r26426004 = r26426002 * r26426003;
        double r26426005 = a;
        double r26426006 = r26426005 - r26426001;
        double r26426007 = r26426004 / r26426006;
        double r26426008 = r26425999 + r26426007;
        return r26426008;
}

double f(double x, double y, double z, double t, double a) {
        double r26426009 = y;
        double r26426010 = z;
        double r26426011 = r26426009 - r26426010;
        double r26426012 = t;
        double r26426013 = r26426011 * r26426012;
        double r26426014 = a;
        double r26426015 = r26426014 - r26426010;
        double r26426016 = r26426013 / r26426015;
        double r26426017 = -inf.0;
        bool r26426018 = r26426016 <= r26426017;
        double r26426019 = r26426012 / r26426015;
        double r26426020 = r26426019 * r26426011;
        double r26426021 = x;
        double r26426022 = r26426020 + r26426021;
        double r26426023 = 1.6464644190929217e+153;
        bool r26426024 = r26426016 <= r26426023;
        double r26426025 = r26426016 + r26426021;
        double r26426026 = 1.0;
        double r26426027 = r26426015 / r26426012;
        double r26426028 = r26426027 / r26426011;
        double r26426029 = r26426026 / r26426028;
        double r26426030 = r26426029 + r26426021;
        double r26426031 = r26426024 ? r26426025 : r26426030;
        double r26426032 = r26426018 ? r26426022 : r26426031;
        return r26426032;
}

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.7
Target0.6
Herbie0.7
\[\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 (/ (* (- y z) t) (- a z)) < -inf.0

    1. Initial program 64.0

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

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

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

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

    if -inf.0 < (/ (* (- y z) t) (- a z)) < 1.6464644190929217e+153

    1. Initial program 0.3

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

    if 1.6464644190929217e+153 < (/ (* (- y z) t) (- a z))

    1. Initial program 38.8

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

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

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

    \[\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 1.646464419092921736686674766696196277622 \cdot 10^{153}:\\ \;\;\;\;\frac{\left(y - z\right) \cdot t}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{1}{\frac{\frac{a - z}{t}}{y - z}} + x\\ \end{array}\]

Reproduce

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