Average Error: 11.5 → 0.6
Time: 4.8s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -6.812592873358664753981877551613139009452 \cdot 10^{-118} \lor \neg \left(y \le 5.555747765118674695192922026792033509772 \cdot 10^{-87}\right):\\ \;\;\;\;\frac{\frac{z - t}{a - t}}{\frac{1}{y}} + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -6.812592873358664753981877551613139009452 \cdot 10^{-118} \lor \neg \left(y \le 5.555747765118674695192922026792033509772 \cdot 10^{-87}\right):\\
\;\;\;\;\frac{\frac{z - t}{a - t}}{\frac{1}{y}} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r499148 = x;
        double r499149 = y;
        double r499150 = z;
        double r499151 = t;
        double r499152 = r499150 - r499151;
        double r499153 = r499149 * r499152;
        double r499154 = a;
        double r499155 = r499154 - r499151;
        double r499156 = r499153 / r499155;
        double r499157 = r499148 + r499156;
        return r499157;
}

double f(double x, double y, double z, double t, double a) {
        double r499158 = y;
        double r499159 = -6.812592873358665e-118;
        bool r499160 = r499158 <= r499159;
        double r499161 = 5.555747765118675e-87;
        bool r499162 = r499158 <= r499161;
        double r499163 = !r499162;
        bool r499164 = r499160 || r499163;
        double r499165 = z;
        double r499166 = t;
        double r499167 = r499165 - r499166;
        double r499168 = a;
        double r499169 = r499168 - r499166;
        double r499170 = r499167 / r499169;
        double r499171 = 1.0;
        double r499172 = r499171 / r499158;
        double r499173 = r499170 / r499172;
        double r499174 = x;
        double r499175 = r499173 + r499174;
        double r499176 = r499158 * r499167;
        double r499177 = r499176 / r499169;
        double r499178 = r499174 + r499177;
        double r499179 = r499164 ? r499175 : r499178;
        return r499179;
}

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

Original11.5
Target1.4
Herbie0.6
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -6.812592873358665e-118 or 5.555747765118675e-87 < y

    1. Initial program 17.7

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

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

      \[\leadsto \mathsf{fma}\left(\frac{y}{\color{blue}{\left(\sqrt[3]{a - t} \cdot \sqrt[3]{a - t}\right) \cdot \sqrt[3]{a - t}}}, z - t, x\right)\]
    5. Applied associate-/r*3.2

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

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

      \[\leadsto \color{blue}{\frac{z - t}{\frac{a - t}{y}}} + x\]
    9. Using strategy rm
    10. Applied div-inv2.6

      \[\leadsto \frac{z - t}{\color{blue}{\left(a - t\right) \cdot \frac{1}{y}}} + x\]
    11. Applied associate-/r*0.8

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

    if -6.812592873358665e-118 < y < 5.555747765118675e-87

    1. Initial program 0.3

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;y \le -6.812592873358664753981877551613139009452 \cdot 10^{-118} \lor \neg \left(y \le 5.555747765118674695192922026792033509772 \cdot 10^{-87}\right):\\ \;\;\;\;\frac{\frac{z - t}{a - t}}{\frac{1}{y}} + x\\ \mathbf{else}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \end{array}\]

Reproduce

herbie shell --seed 2019353 +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))))