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 r548093 = x;
        double r548094 = y;
        double r548095 = z;
        double r548096 = t;
        double r548097 = r548095 - r548096;
        double r548098 = r548094 * r548097;
        double r548099 = a;
        double r548100 = r548099 - r548096;
        double r548101 = r548098 / r548100;
        double r548102 = r548093 + r548101;
        return r548102;
}

double f(double x, double y, double z, double t, double a) {
        double r548103 = y;
        double r548104 = -1.270112277700152e-89;
        bool r548105 = r548103 <= r548104;
        double r548106 = 5.493382752707537e+24;
        bool r548107 = r548103 <= r548106;
        double r548108 = !r548107;
        bool r548109 = r548105 || r548108;
        double r548110 = z;
        double r548111 = t;
        double r548112 = r548110 - r548111;
        double r548113 = a;
        double r548114 = r548113 - r548111;
        double r548115 = r548112 / r548114;
        double r548116 = r548103 * r548115;
        double r548117 = x;
        double r548118 = r548116 + r548117;
        double r548119 = r548103 * r548112;
        double r548120 = r548119 / r548114;
        double r548121 = r548120 + r548117;
        double r548122 = r548109 ? r548118 : r548121;
        return r548122;
}

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 div-inv3.6

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

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

      \[\leadsto y \cdot \color{blue}{\frac{z - t}{a - t}} + x\]
    9. Using strategy rm
    10. Applied associate-*r/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))))