Average Error: 10.6 → 0.4
Time: 5.0s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -8.06916043366223524 \cdot 10^{-64}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;y \le 5.4933827527075371 \cdot 10^{24}:\\ \;\;\;\;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}\;y \le -8.06916043366223524 \cdot 10^{-64}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{elif}\;y \le 5.4933827527075371 \cdot 10^{24}:\\
\;\;\;\;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 r603586 = x;
        double r603587 = y;
        double r603588 = z;
        double r603589 = t;
        double r603590 = r603588 - r603589;
        double r603591 = r603587 * r603590;
        double r603592 = a;
        double r603593 = r603592 - r603589;
        double r603594 = r603591 / r603593;
        double r603595 = r603586 + r603594;
        return r603595;
}

double f(double x, double y, double z, double t, double a) {
        double r603596 = y;
        double r603597 = -8.069160433662235e-64;
        bool r603598 = r603596 <= r603597;
        double r603599 = x;
        double r603600 = a;
        double r603601 = t;
        double r603602 = r603600 - r603601;
        double r603603 = z;
        double r603604 = r603603 - r603601;
        double r603605 = r603602 / r603604;
        double r603606 = r603596 / r603605;
        double r603607 = r603599 + r603606;
        double r603608 = 5.493382752707537e+24;
        bool r603609 = r603596 <= r603608;
        double r603610 = r603596 * r603604;
        double r603611 = r603610 / r603602;
        double r603612 = r603599 + r603611;
        double r603613 = r603604 / r603602;
        double r603614 = r603596 * r603613;
        double r603615 = r603599 + r603614;
        double r603616 = r603609 ? r603612 : r603615;
        double r603617 = r603598 ? r603607 : r603616;
        return r603617;
}

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

Derivation

  1. Split input into 3 regimes
  2. if y < -8.069160433662235e-64

    1. Initial program 17.7

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

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

    if -8.069160433662235e-64 < y < 5.493382752707537e+24

    1. Initial program 0.4

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

    if 5.493382752707537e+24 < y

    1. Initial program 25.9

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -8.06916043366223524 \cdot 10^{-64}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;y \le 5.4933827527075371 \cdot 10^{24}:\\ \;\;\;\;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 2020062 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, B"
  :precision binary64

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

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