Average Error: 1.3 → 1.4
Time: 12.8s
Precision: 64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;t \le -8.018870300280200753529295591444470153158 \cdot 10^{70}:\\ \;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\ \mathbf{else}:\\ \;\;\;\;\frac{z - t}{z - a} \cdot y + x\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;t \le -8.018870300280200753529295591444470153158 \cdot 10^{70}:\\
\;\;\;\;x + \frac{y}{z - a} \cdot \left(z - t\right)\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r528235 = x;
        double r528236 = y;
        double r528237 = z;
        double r528238 = t;
        double r528239 = r528237 - r528238;
        double r528240 = a;
        double r528241 = r528237 - r528240;
        double r528242 = r528239 / r528241;
        double r528243 = r528236 * r528242;
        double r528244 = r528235 + r528243;
        return r528244;
}

double f(double x, double y, double z, double t, double a) {
        double r528245 = t;
        double r528246 = -8.018870300280201e+70;
        bool r528247 = r528245 <= r528246;
        double r528248 = x;
        double r528249 = y;
        double r528250 = z;
        double r528251 = a;
        double r528252 = r528250 - r528251;
        double r528253 = r528249 / r528252;
        double r528254 = r528250 - r528245;
        double r528255 = r528253 * r528254;
        double r528256 = r528248 + r528255;
        double r528257 = r528254 / r528252;
        double r528258 = r528257 * r528249;
        double r528259 = r528258 + r528248;
        double r528260 = r528247 ? r528256 : r528259;
        return r528260;
}

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.3
Target1.2
Herbie1.4
\[x + \frac{y}{\frac{z - a}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if t < -8.018870300280201e+70

    1. Initial program 3.3

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Simplified3.4

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

    if -8.018870300280201e+70 < t

    1. Initial program 0.9

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

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

Reproduce

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

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

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