Average Error: 11.3 → 1.7
Time: 18.2s
Precision: 64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;x \le -5.993850181954760056083277772969421378107 \cdot 10^{-198}:\\ \;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right) + x\\ \mathbf{else}:\\ \;\;\;\;y \cdot \frac{z - t}{a - t} + x\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;x \le -5.993850181954760056083277772969421378107 \cdot 10^{-198}:\\
\;\;\;\;\frac{y}{a - t} \cdot \left(z - t\right) + x\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r391941 = x;
        double r391942 = y;
        double r391943 = z;
        double r391944 = t;
        double r391945 = r391943 - r391944;
        double r391946 = r391942 * r391945;
        double r391947 = a;
        double r391948 = r391947 - r391944;
        double r391949 = r391946 / r391948;
        double r391950 = r391941 + r391949;
        return r391950;
}

double f(double x, double y, double z, double t, double a) {
        double r391951 = x;
        double r391952 = -5.99385018195476e-198;
        bool r391953 = r391951 <= r391952;
        double r391954 = y;
        double r391955 = a;
        double r391956 = t;
        double r391957 = r391955 - r391956;
        double r391958 = r391954 / r391957;
        double r391959 = z;
        double r391960 = r391959 - r391956;
        double r391961 = r391958 * r391960;
        double r391962 = r391961 + r391951;
        double r391963 = r391960 / r391957;
        double r391964 = r391954 * r391963;
        double r391965 = r391964 + r391951;
        double r391966 = r391953 ? r391962 : r391965;
        return r391966;
}

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

Derivation

  1. Split input into 2 regimes
  2. if x < -5.99385018195476e-198

    1. Initial program 11.1

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

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

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

    if -5.99385018195476e-198 < x

    1. Initial program 11.5

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

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

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

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

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

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

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

Reproduce

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