Average Error: 10.4 → 0.2
Time: 22.4s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} = -\infty:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \le 8.6364206235101057 \cdot 10^{305}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} = -\infty:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

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

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r398369 = x;
        double r398370 = y;
        double r398371 = z;
        double r398372 = t;
        double r398373 = r398371 - r398372;
        double r398374 = r398370 * r398373;
        double r398375 = a;
        double r398376 = r398375 - r398372;
        double r398377 = r398374 / r398376;
        double r398378 = r398369 + r398377;
        return r398378;
}

double f(double x, double y, double z, double t, double a) {
        double r398379 = y;
        double r398380 = z;
        double r398381 = t;
        double r398382 = r398380 - r398381;
        double r398383 = r398379 * r398382;
        double r398384 = a;
        double r398385 = r398384 - r398381;
        double r398386 = r398383 / r398385;
        double r398387 = -inf.0;
        bool r398388 = r398386 <= r398387;
        double r398389 = x;
        double r398390 = r398385 / r398382;
        double r398391 = r398379 / r398390;
        double r398392 = r398389 + r398391;
        double r398393 = 8.636420623510106e+305;
        bool r398394 = r398386 <= r398393;
        double r398395 = r398389 + r398386;
        double r398396 = r398382 / r398385;
        double r398397 = r398379 * r398396;
        double r398398 = r398389 + r398397;
        double r398399 = r398394 ? r398395 : r398398;
        double r398400 = r398388 ? r398392 : r398399;
        return r398400;
}

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

Derivation

  1. Split input into 3 regimes
  2. if (/ (* y (- z t)) (- a t)) < -inf.0

    1. Initial program 64.0

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

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

    if -inf.0 < (/ (* y (- z t)) (- a t)) < 8.636420623510106e+305

    1. Initial program 0.2

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

    if 8.636420623510106e+305 < (/ (* y (- z t)) (- a t))

    1. Initial program 63.5

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity63.5

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot \left(a - t\right)}}\]
    4. Applied times-frac0.2

      \[\leadsto x + \color{blue}{\frac{y}{1} \cdot \frac{z - t}{a - t}}\]
    5. Simplified0.2

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

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

Reproduce

herbie shell --seed 2019198 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"

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

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