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 r572155 = x;
        double r572156 = y;
        double r572157 = z;
        double r572158 = t;
        double r572159 = r572157 - r572158;
        double r572160 = r572156 * r572159;
        double r572161 = a;
        double r572162 = r572161 - r572158;
        double r572163 = r572160 / r572162;
        double r572164 = r572155 + r572163;
        return r572164;
}

double f(double x, double y, double z, double t, double a) {
        double r572165 = y;
        double r572166 = -6.812592873358665e-118;
        bool r572167 = r572165 <= r572166;
        double r572168 = 5.555747765118675e-87;
        bool r572169 = r572165 <= r572168;
        double r572170 = !r572169;
        bool r572171 = r572167 || r572170;
        double r572172 = z;
        double r572173 = t;
        double r572174 = r572172 - r572173;
        double r572175 = a;
        double r572176 = r572175 - r572173;
        double r572177 = r572174 / r572176;
        double r572178 = 1.0;
        double r572179 = r572178 / r572165;
        double r572180 = r572177 / r572179;
        double r572181 = x;
        double r572182 = r572180 + r572181;
        double r572183 = r572165 * r572174;
        double r572184 = r572183 / r572176;
        double r572185 = r572181 + r572184;
        double r572186 = r572171 ? r572182 : r572185;
        return r572186;
}

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))))