Average Error: 9.8 → 2.0
Time: 17.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -6.980533944371433 \cdot 10^{-281}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y}{a - t} \cdot \left(z - t\right)\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -6.980533944371433 \cdot 10^{-281}:\\
\;\;\;\;y \cdot \frac{z - t}{a - t} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r32326538 = x;
        double r32326539 = y;
        double r32326540 = z;
        double r32326541 = t;
        double r32326542 = r32326540 - r32326541;
        double r32326543 = r32326539 * r32326542;
        double r32326544 = a;
        double r32326545 = r32326544 - r32326541;
        double r32326546 = r32326543 / r32326545;
        double r32326547 = r32326538 + r32326546;
        return r32326547;
}

double f(double x, double y, double z, double t, double a) {
        double r32326548 = t;
        double r32326549 = -6.980533944371433e-281;
        bool r32326550 = r32326548 <= r32326549;
        double r32326551 = y;
        double r32326552 = z;
        double r32326553 = r32326552 - r32326548;
        double r32326554 = a;
        double r32326555 = r32326554 - r32326548;
        double r32326556 = r32326553 / r32326555;
        double r32326557 = r32326551 * r32326556;
        double r32326558 = x;
        double r32326559 = r32326557 + r32326558;
        double r32326560 = r32326551 / r32326555;
        double r32326561 = r32326560 * r32326553;
        double r32326562 = r32326558 + r32326561;
        double r32326563 = r32326550 ? r32326559 : r32326562;
        return r32326563;
}

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

Original9.8
Target1.2
Herbie2.0
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if t < -6.980533944371433e-281

    1. Initial program 10.2

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

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

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

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

    if -6.980533944371433e-281 < t

    1. Initial program 9.4

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

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/2.7

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

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

Reproduce

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