Average Error: 10.6 → 0.4
Time: 4.3s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -1.270112277700152 \cdot 10^{-89} \lor \neg \left(y \le 5.4933827527075371 \cdot 10^{24}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -1.270112277700152 \cdot 10^{-89} \lor \neg \left(y \le 5.4933827527075371 \cdot 10^{24}\right):\\
\;\;\;\;y \cdot \frac{z - t}{a - t} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r458195 = x;
        double r458196 = y;
        double r458197 = z;
        double r458198 = t;
        double r458199 = r458197 - r458198;
        double r458200 = r458196 * r458199;
        double r458201 = a;
        double r458202 = r458201 - r458198;
        double r458203 = r458200 / r458202;
        double r458204 = r458195 + r458203;
        return r458204;
}

double f(double x, double y, double z, double t, double a) {
        double r458205 = y;
        double r458206 = -1.270112277700152e-89;
        bool r458207 = r458205 <= r458206;
        double r458208 = 5.493382752707537e+24;
        bool r458209 = r458205 <= r458208;
        double r458210 = !r458209;
        bool r458211 = r458207 || r458210;
        double r458212 = z;
        double r458213 = t;
        double r458214 = r458212 - r458213;
        double r458215 = a;
        double r458216 = r458215 - r458213;
        double r458217 = r458214 / r458216;
        double r458218 = r458205 * r458217;
        double r458219 = x;
        double r458220 = r458218 + r458219;
        double r458221 = r458205 * r458214;
        double r458222 = r458221 / r458216;
        double r458223 = r458222 + r458219;
        double r458224 = r458211 ? r458220 : r458223;
        return r458224;
}

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 2 regimes
  2. if y < -1.270112277700152e-89 or 5.493382752707537e+24 < y

    1. Initial program 20.3

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)}\]
    3. Using strategy rm
    4. Applied fma-udef2.4

      \[\leadsto \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right) + x}\]
    5. Using strategy rm
    6. Applied div-inv2.5

      \[\leadsto \color{blue}{\left(y \cdot \frac{1}{a - t}\right)} \cdot \left(z - t\right) + x\]
    7. Applied associate-*l*0.6

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

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

    if -1.270112277700152e-89 < y < 5.493382752707537e+24

    1. Initial program 0.4

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

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{y}{a - t}, z - t, x\right)}\]
    3. Using strategy rm
    4. Applied fma-udef3.5

      \[\leadsto \color{blue}{\frac{y}{a - t} \cdot \left(z - t\right) + x}\]
    5. Using strategy rm
    6. Applied associate-*l/0.4

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -1.270112277700152 \cdot 10^{-89} \lor \neg \left(y \le 5.4933827527075371 \cdot 10^{24}\right):\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\ \end{array}\]

Reproduce

herbie shell --seed 2020062 +o rules:numerics
(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))))