Average Error: 1.4 → 1.4
Time: 4.0s
Precision: 64
\[x + y \cdot \frac{z - t}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;t \le -1.5425104884202794 \cdot 10^{-156}:\\ \;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\ \mathbf{elif}\;t \le 3.35743028334156564 \cdot 10^{-19}:\\ \;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]
x + y \cdot \frac{z - t}{a - t}
\begin{array}{l}
\mathbf{if}\;t \le -1.5425104884202794 \cdot 10^{-156}:\\
\;\;\;\;x + \frac{y}{\frac{a - t}{z - t}}\\

\mathbf{elif}\;t \le 3.35743028334156564 \cdot 10^{-19}:\\
\;\;\;\;x + \frac{y \cdot \left(z - t\right)}{a - t}\\

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

\end{array}
double f(double x, double y, double z, double t, double a) {
        double r537079 = x;
        double r537080 = y;
        double r537081 = z;
        double r537082 = t;
        double r537083 = r537081 - r537082;
        double r537084 = a;
        double r537085 = r537084 - r537082;
        double r537086 = r537083 / r537085;
        double r537087 = r537080 * r537086;
        double r537088 = r537079 + r537087;
        return r537088;
}

double f(double x, double y, double z, double t, double a) {
        double r537089 = t;
        double r537090 = -1.5425104884202794e-156;
        bool r537091 = r537089 <= r537090;
        double r537092 = x;
        double r537093 = y;
        double r537094 = a;
        double r537095 = r537094 - r537089;
        double r537096 = z;
        double r537097 = r537096 - r537089;
        double r537098 = r537095 / r537097;
        double r537099 = r537093 / r537098;
        double r537100 = r537092 + r537099;
        double r537101 = 3.3574302833415656e-19;
        bool r537102 = r537089 <= r537101;
        double r537103 = r537093 * r537097;
        double r537104 = r537103 / r537095;
        double r537105 = r537092 + r537104;
        double r537106 = r537097 / r537095;
        double r537107 = r537093 * r537106;
        double r537108 = r537092 + r537107;
        double r537109 = r537102 ? r537105 : r537108;
        double r537110 = r537091 ? r537100 : r537109;
        return r537110;
}

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

Original1.4
Target0.5
Herbie1.4
\[\begin{array}{l} \mathbf{if}\;y \lt -8.50808486055124107 \cdot 10^{-17}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \mathbf{elif}\;y \lt 2.8944268627920891 \cdot 10^{-49}:\\ \;\;\;\;x + \left(y \cdot \left(z - t\right)\right) \cdot \frac{1}{a - t}\\ \mathbf{else}:\\ \;\;\;\;x + y \cdot \frac{z - t}{a - t}\\ \end{array}\]

Derivation

  1. Split input into 3 regimes
  2. if t < -1.5425104884202794e-156

    1. Initial program 0.7

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied associate-*r/13.4

      \[\leadsto x + \color{blue}{\frac{y \cdot \left(z - t\right)}{a - t}}\]
    4. Using strategy rm
    5. Applied associate-/l*0.6

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

    if -1.5425104884202794e-156 < t < 3.3574302833415656e-19

    1. Initial program 3.5

      \[x + y \cdot \frac{z - t}{a - t}\]
    2. Using strategy rm
    3. Applied associate-*r/3.5

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

    if 3.3574302833415656e-19 < t

    1. Initial program 0.1

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

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

Reproduce

herbie shell --seed 2020081 +o rules:numerics
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, B"
  :precision binary64

  :herbie-target
  (if (< y -8.508084860551241e-17) (+ x (* y (/ (- z t) (- a t)))) (if (< y 2.894426862792089e-49) (+ x (* (* y (- z t)) (/ 1 (- a t)))) (+ x (* y (/ (- z t) (- a t))))))

  (+ x (* y (/ (- z t) (- a t)))))