Average Error: 10.8 → 0.7
Time: 3.1s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -4.22294471034655055 \cdot 10^{-32} \lor \neg \left(t \le 1.45443745763092057 \cdot 10^{-179}\right):\\ \;\;\;\;x + \frac{y - z}{a - z} \cdot t\\ \mathbf{else}:\\ \;\;\;\;x + \frac{\left(y - z\right) \cdot t}{a - z}\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -4.22294471034655055 \cdot 10^{-32} \lor \neg \left(t \le 1.45443745763092057 \cdot 10^{-179}\right):\\
\;\;\;\;x + \frac{y - z}{a - z} \cdot t\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r629438 = x;
        double r629439 = y;
        double r629440 = z;
        double r629441 = r629439 - r629440;
        double r629442 = t;
        double r629443 = r629441 * r629442;
        double r629444 = a;
        double r629445 = r629444 - r629440;
        double r629446 = r629443 / r629445;
        double r629447 = r629438 + r629446;
        return r629447;
}

double f(double x, double y, double z, double t, double a) {
        double r629448 = t;
        double r629449 = -4.2229447103465506e-32;
        bool r629450 = r629448 <= r629449;
        double r629451 = 1.4544374576309206e-179;
        bool r629452 = r629448 <= r629451;
        double r629453 = !r629452;
        bool r629454 = r629450 || r629453;
        double r629455 = x;
        double r629456 = y;
        double r629457 = z;
        double r629458 = r629456 - r629457;
        double r629459 = a;
        double r629460 = r629459 - r629457;
        double r629461 = r629458 / r629460;
        double r629462 = r629461 * r629448;
        double r629463 = r629455 + r629462;
        double r629464 = r629458 * r629448;
        double r629465 = r629464 / r629460;
        double r629466 = r629455 + r629465;
        double r629467 = r629454 ? r629463 : r629466;
        return r629467;
}

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.8
Target0.6
Herbie0.7
\[\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 t < -4.2229447103465506e-32 or 1.4544374576309206e-179 < t

    1. Initial program 16.7

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

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

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

    if -4.2229447103465506e-32 < t < 1.4544374576309206e-179

    1. Initial program 0.3

      \[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
  3. Recombined 2 regimes into one program.
  4. Final simplification0.7

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

Reproduce

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