Average Error: 10.7 → 2.1
Time: 3.0s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;x \le -2.67398264443874345 \cdot 10^{-295} \lor \neg \left(x \le 1.1132363374893718 \cdot 10^{-86}\right):\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;x \le -2.67398264443874345 \cdot 10^{-295} \lor \neg \left(x \le 1.1132363374893718 \cdot 10^{-86}\right):\\
\;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r577596 = x;
        double r577597 = y;
        double r577598 = z;
        double r577599 = r577597 - r577598;
        double r577600 = t;
        double r577601 = r577599 * r577600;
        double r577602 = a;
        double r577603 = r577602 - r577598;
        double r577604 = r577601 / r577603;
        double r577605 = r577596 + r577604;
        return r577605;
}

double f(double x, double y, double z, double t, double a) {
        double r577606 = x;
        double r577607 = -2.6739826444387435e-295;
        bool r577608 = r577606 <= r577607;
        double r577609 = 1.1132363374893718e-86;
        bool r577610 = r577606 <= r577609;
        double r577611 = !r577610;
        bool r577612 = r577608 || r577611;
        double r577613 = y;
        double r577614 = z;
        double r577615 = r577613 - r577614;
        double r577616 = a;
        double r577617 = r577616 - r577614;
        double r577618 = t;
        double r577619 = r577617 / r577618;
        double r577620 = r577615 / r577619;
        double r577621 = r577606 + r577620;
        double r577622 = r577615 / r577617;
        double r577623 = r577622 * r577618;
        double r577624 = r577606 + r577623;
        double r577625 = r577612 ? r577621 : r577624;
        return r577625;
}

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
Herbie2.1
\[\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 2 regimes
  2. if x < -2.6739826444387435e-295 or 1.1132363374893718e-86 < x

    1. Initial program 10.5

      \[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}}}\]

    if -2.6739826444387435e-295 < x < 1.1132363374893718e-86

    1. Initial program 11.3

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \le -2.67398264443874345 \cdot 10^{-295} \lor \neg \left(x \le 1.1132363374893718 \cdot 10^{-86}\right):\\ \;\;\;\;x + \frac{y - z}{\frac{a - z}{t}}\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \end{array}\]

Reproduce

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