Average Error: 10.7 → 0.7
Time: 20.7s
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 r30283006 = x;
        double r30283007 = y;
        double r30283008 = z;
        double r30283009 = r30283007 - r30283008;
        double r30283010 = t;
        double r30283011 = r30283009 * r30283010;
        double r30283012 = a;
        double r30283013 = r30283012 - r30283008;
        double r30283014 = r30283011 / r30283013;
        double r30283015 = r30283006 + r30283014;
        return r30283015;
}

double f(double x, double y, double z, double t, double a) {
        double r30283016 = y;
        double r30283017 = z;
        double r30283018 = r30283016 - r30283017;
        double r30283019 = t;
        double r30283020 = r30283018 * r30283019;
        double r30283021 = a;
        double r30283022 = r30283021 - r30283017;
        double r30283023 = r30283020 / r30283022;
        double r30283024 = -inf.0;
        bool r30283025 = r30283023 <= r30283024;
        double r30283026 = r30283019 / r30283022;
        double r30283027 = r30283026 * r30283018;
        double r30283028 = x;
        double r30283029 = r30283027 + r30283028;
        double r30283030 = 1.6464644190929217e+153;
        bool r30283031 = r30283023 <= r30283030;
        double r30283032 = r30283023 + r30283028;
        double r30283033 = 1.0;
        double r30283034 = r30283022 / r30283019;
        double r30283035 = r30283034 / r30283018;
        double r30283036 = r30283033 / r30283035;
        double r30283037 = r30283036 + r30283028;
        double r30283038 = r30283031 ? r30283032 : r30283037;
        double r30283039 = r30283025 ? r30283029 : r30283038;
        return r30283039;
}

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