Average Error: 11.2 → 0.5
Time: 53.6s
Precision: 64
\[x + \frac{\left(y - z\right) \cdot t}{a - z}\]
\[\begin{array}{l} \mathbf{if}\;t \le -7871857251584985.0:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t + x\\ \mathbf{elif}\;t \le 6.488863385399058 \cdot 10^{+29}:\\ \;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y - z}{a - z} \cdot t + x\\ \end{array}\]
x + \frac{\left(y - z\right) \cdot t}{a - z}
\begin{array}{l}
\mathbf{if}\;t \le -7871857251584985.0:\\
\;\;\;\;\frac{y - z}{a - z} \cdot t + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r31856322 = x;
        double r31856323 = y;
        double r31856324 = z;
        double r31856325 = r31856323 - r31856324;
        double r31856326 = t;
        double r31856327 = r31856325 * r31856326;
        double r31856328 = a;
        double r31856329 = r31856328 - r31856324;
        double r31856330 = r31856327 / r31856329;
        double r31856331 = r31856322 + r31856330;
        return r31856331;
}

double f(double x, double y, double z, double t, double a) {
        double r31856332 = t;
        double r31856333 = -7871857251584985.0;
        bool r31856334 = r31856332 <= r31856333;
        double r31856335 = y;
        double r31856336 = z;
        double r31856337 = r31856335 - r31856336;
        double r31856338 = a;
        double r31856339 = r31856338 - r31856336;
        double r31856340 = r31856337 / r31856339;
        double r31856341 = r31856340 * r31856332;
        double r31856342 = x;
        double r31856343 = r31856341 + r31856342;
        double r31856344 = 6.488863385399058e+29;
        bool r31856345 = r31856332 <= r31856344;
        double r31856346 = r31856332 * r31856337;
        double r31856347 = r31856346 / r31856339;
        double r31856348 = r31856347 + r31856342;
        double r31856349 = r31856345 ? r31856348 : r31856343;
        double r31856350 = r31856334 ? r31856343 : r31856349;
        return r31856350;
}

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

Original11.2
Target0.5
Herbie0.5
\[\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 < -7871857251584985.0 or 6.488863385399058e+29 < t

    1. Initial program 25.9

      \[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.6

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

    if -7871857251584985.0 < t < 6.488863385399058e+29

    1. Initial program 0.4

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

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

Reproduce

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