Average Error: 1.4 → 0.6
Time: 18.2s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -2.6372173018264303 \cdot 10^{+43}:\\ \;\;\;\;\frac{z - t}{a - t} \cdot y + x\\ \mathbf{elif}\;y \le 97982161437615.03:\\ \;\;\;\;\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 -2.6372173018264303 \cdot 10^{+43}:\\
\;\;\;\;\frac{z - t}{a - t} \cdot y + x\\

\mathbf{elif}\;y \le 97982161437615.03:\\
\;\;\;\;\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 r30816115 = x;
        double r30816116 = y;
        double r30816117 = z;
        double r30816118 = t;
        double r30816119 = r30816117 - r30816118;
        double r30816120 = a;
        double r30816121 = r30816120 - r30816118;
        double r30816122 = r30816119 / r30816121;
        double r30816123 = r30816116 * r30816122;
        double r30816124 = r30816115 + r30816123;
        return r30816124;
}

double f(double x, double y, double z, double t, double a) {
        double r30816125 = y;
        double r30816126 = -2.6372173018264303e+43;
        bool r30816127 = r30816125 <= r30816126;
        double r30816128 = z;
        double r30816129 = t;
        double r30816130 = r30816128 - r30816129;
        double r30816131 = a;
        double r30816132 = r30816131 - r30816129;
        double r30816133 = r30816130 / r30816132;
        double r30816134 = r30816133 * r30816125;
        double r30816135 = x;
        double r30816136 = r30816134 + r30816135;
        double r30816137 = 97982161437615.03;
        bool r30816138 = r30816125 <= r30816137;
        double r30816139 = r30816125 * r30816130;
        double r30816140 = r30816139 / r30816132;
        double r30816141 = r30816140 + r30816135;
        double r30816142 = r30816138 ? r30816141 : r30816136;
        double r30816143 = r30816127 ? r30816136 : r30816142;
        return r30816143;
}

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.4
Target0.4
Herbie0.6
\[\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 < -2.6372173018264303e+43 or 97982161437615.03 < y

    1. Initial program 0.5

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

    if -2.6372173018264303e+43 < y < 97982161437615.03

    1. Initial program 1.9

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -2.6372173018264303 \cdot 10^{+43}:\\ \;\;\;\;\frac{z - t}{a - t} \cdot y + x\\ \mathbf{elif}\;y \le 97982161437615.03:\\ \;\;\;\;\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 2019158 
(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)))))