Average Error: 10.7 → 0.7
Time: 8.1s
Precision: binary64
\[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
\[\begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;x + y \cdot \sqrt[3]{{\left(\frac{z - t}{a - t}\right)}^{3}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 5.154263957666686 \cdot 10^{+306}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \end{array}\]
x + \frac{y \cdot \left(z - t\right)}{a - t}
\begin{array}{l}
\mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\
\;\;\;\;x + y \cdot \sqrt[3]{{\left(\frac{z - t}{a - t}\right)}^{3}}\\

\mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 5.154263957666686 \cdot 10^{+306}:\\
\;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\

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

\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- a t))))
(FPCore (x y z t a)
 :precision binary64
 (if (<= (/ (* y (- z t)) (- a t)) (- INFINITY))
   (+ x (* y (cbrt (pow (/ (- z t) (- a t)) 3.0))))
   (if (<= (/ (* y (- z t)) (- a t)) 5.154263957666686e+306)
     (+ (/ (* y (- z t)) (- a t)) x)
     (+ x (* (- z t) (/ y (- a t)))))))
double code(double x, double y, double z, double t, double a) {
	return x + ((y * (z - t)) / (a - t));
}
double code(double x, double y, double z, double t, double a) {
	double tmp;
	if (((y * (z - t)) / (a - t)) <= -((double) INFINITY)) {
		tmp = x + (y * cbrt(pow(((z - t) / (a - t)), 3.0)));
	} else if (((y * (z - t)) / (a - t)) <= 5.154263957666686e+306) {
		tmp = ((y * (z - t)) / (a - t)) + x;
	} else {
		tmp = x + ((z - t) * (y / (a - t)));
	}
	return tmp;
}

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

Original10.7
Target1.1
Herbie0.7
\[x + \frac{y}{\frac{a - t}{z - t}}\]

Derivation

  1. Split input into 3 regimes
  2. if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < -inf.0

    1. Initial program 64.0

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity_binary64_506864.0

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{a - \color{blue}{1 \cdot t}}\]
    4. Applied *-un-lft-identity_binary64_506864.0

      \[\leadsto x + \frac{y \cdot \left(z - t\right)}{\color{blue}{1 \cdot a} - 1 \cdot t}\]
    5. Applied distribute-lft-out--_binary64_511364.0

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

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

      \[\leadsto x + \color{blue}{y} \cdot \frac{z - t}{a - t}\]
    8. Using strategy rm
    9. Applied add-cbrt-cube_binary64_50406.0

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

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

    if -inf.0 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t)) < 5.1543e306

    1. Initial program 0.2

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

    if 5.1543e306 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 a t))

    1. Initial program 63.8

      \[x + \frac{y \cdot \left(z - t\right)}{a - t}\]
    2. Using strategy rm
    3. Applied associate-/l*_binary64_51320.3

      \[\leadsto x + \color{blue}{\frac{y}{\frac{a - t}{z - t}}}\]
    4. Using strategy rm
    5. Applied associate-/r/_binary64_51330.2

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq -\infty:\\ \;\;\;\;x + y \cdot \sqrt[3]{{\left(\frac{z - t}{a - t}\right)}^{3}}\\ \mathbf{elif}\;\frac{y \cdot \left(z - t\right)}{a - t} \leq 5.154263957666686 \cdot 10^{+306}:\\ \;\;\;\;\frac{y \cdot \left(z - t\right)}{a - t} + x\\ \mathbf{else}:\\ \;\;\;\;x + \left(z - t\right) \cdot \frac{y}{a - t}\\ \end{array}\]

Reproduce

herbie shell --seed 2020231 
(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))))