Average Error: 11.0 → 1.6
Time: 4.3s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;y \le -5.610173163155118 \cdot 10^{-108} \lor \neg \left(y \le 59977.7525706290544\right):\\ \;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;\frac{\left(z - t\right) \cdot y}{a - t} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;y \le -5.610173163155118 \cdot 10^{-108} \lor \neg \left(y \le 59977.7525706290544\right):\\
\;\;\;\;\left(z - t\right) \cdot \frac{y}{a - t} + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r522284 = x;
        double r522285 = y;
        double r522286 = z;
        double r522287 = t;
        double r522288 = r522286 - r522287;
        double r522289 = r522285 * r522288;
        double r522290 = a;
        double r522291 = r522290 - r522287;
        double r522292 = r522289 / r522291;
        double r522293 = r522284 + r522292;
        return r522293;
}

double f(double x, double y, double z, double t, double a) {
        double r522294 = y;
        double r522295 = -5.610173163155118e-108;
        bool r522296 = r522294 <= r522295;
        double r522297 = 59977.752570629054;
        bool r522298 = r522294 <= r522297;
        double r522299 = !r522298;
        bool r522300 = r522296 || r522299;
        double r522301 = z;
        double r522302 = t;
        double r522303 = r522301 - r522302;
        double r522304 = a;
        double r522305 = r522304 - r522302;
        double r522306 = r522294 / r522305;
        double r522307 = r522303 * r522306;
        double r522308 = x;
        double r522309 = r522307 + r522308;
        double r522310 = r522303 * r522294;
        double r522311 = r522310 / r522305;
        double r522312 = r522311 + r522308;
        double r522313 = r522300 ? r522309 : r522312;
        return r522313;
}

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.0
Target1.3
Herbie1.6
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 2 regimes
  2. if y < -5.610173163155118e-108 or 59977.752570629054 < y

    1. Initial program 19.9

      \[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 div-inv2.7

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

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

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

    if -5.610173163155118e-108 < y < 59977.752570629054

    1. Initial program 0.3

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

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

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

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

      \[\leadsto \color{blue}{\left(z - t\right) \cdot \frac{y}{a - t}} + x\]
    8. Using strategy rm
    9. Applied associate-*r/0.3

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

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

Reproduce

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