Average Error: 1.2 → 0.8
Time: 18.1s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.4067031403702933 \cdot 10^{-150}:\\ \;\;\;\;\frac{z - t}{a - t} \cdot y + x\\ \mathbf{elif}\;y \le 4.050712264929229 \cdot 10^{+58}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{z - t}{a - t} \cdot y + x\\ \end{array}\]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -1.4067031403702933 \cdot 10^{-150}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y + x\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r28543408 = x;
        double r28543409 = y;
        double r28543410 = z;
        double r28543411 = t;
        double r28543412 = r28543410 - r28543411;
        double r28543413 = a;
        double r28543414 = r28543413 - r28543411;
        double r28543415 = r28543412 / r28543414;
        double r28543416 = r28543409 * r28543415;
        double r28543417 = r28543408 + r28543416;
        return r28543417;
}

double f(double x, double y, double z, double t, double a) {
        double r28543418 = y;
        double r28543419 = -1.4067031403702933e-150;
        bool r28543420 = r28543418 <= r28543419;
        double r28543421 = z;
        double r28543422 = t;
        double r28543423 = r28543421 - r28543422;
        double r28543424 = a;
        double r28543425 = r28543424 - r28543422;
        double r28543426 = r28543423 / r28543425;
        double r28543427 = r28543426 * r28543418;
        double r28543428 = x;
        double r28543429 = r28543427 + r28543428;
        double r28543430 = 4.050712264929229e+58;
        bool r28543431 = r28543418 <= r28543430;
        double r28543432 = r28543418 * r28543423;
        double r28543433 = r28543432 / r28543425;
        double r28543434 = r28543433 + r28543428;
        double r28543435 = r28543431 ? r28543434 : r28543429;
        double r28543436 = r28543420 ? r28543429 : r28543435;
        return r28543436;
}

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

Original1.2
Target0.4
Herbie0.8
\[\begin{array}{l} \mathbf{if}\;y \lt -8.508084860551241 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.894426862792089 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -1.4067031403702933e-150 or 4.050712264929229e+58 < y

    1. Initial program 0.7

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

    if -1.4067031403702933e-150 < y < 4.050712264929229e+58

    1. Initial program 1.9

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied associate-*r/0.9

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

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

Reproduce

herbie shell --seed 2019164 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

  (+ x (* y (/ (- z t) (- a t)))))