Average Error: 1.6 → 1.3
Time: 4.9s
Precision: binary64
\[x + y \cdot \frac{z - t}{z - a}\]
\[\begin{array}{l} \mathbf{if}\;z \leq -9.227758035671217 \cdot 10^{-125} \lor \neg \left(z \leq 8.334207124138048 \cdot 10^{-119}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot \left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right)\right) \cdot \frac{\sqrt[3]{z - t}}{z - a}\\ \end{array}\]
x + y \cdot \frac{z - t}{z - a}
\begin{array}{l}
\mathbf{if}\;z \leq -9.227758035671217 \cdot 10^{-125} \lor \neg \left(z \leq 8.334207124138048 \cdot 10^{-119}\right):\\
\;\;\;\;x + y \cdot \frac{z - t}{z - a}\\

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

\end{array}
double code(double x, double y, double z, double t, double a) {
	return ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (z - a)))))));
}
double code(double x, double y, double z, double t, double a) {
	double VAR;
	if (((z <= -9.227758035671217e-125) || !(z <= 8.334207124138048e-119))) {
		VAR = ((double) (x + ((double) (y * (((double) (z - t)) / ((double) (z - a)))))));
	} else {
		VAR = ((double) (x + ((double) (((double) (y * ((double) (((double) cbrt(((double) (z - t)))) * ((double) cbrt(((double) (z - t)))))))) * (((double) cbrt(((double) (z - t)))) / ((double) (z - a)))))));
	}
	return VAR;
}

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

Derivation

  1. Split input into 2 regimes
  2. if z < -9.2277580356712173e-125 or 8.3342071241380482e-119 < z

    1. Initial program 0.5

      \[x + y \cdot \frac{z - t}{z - a}\]

    if -9.2277580356712173e-125 < z < 8.3342071241380482e-119

    1. Initial program 4.3

      \[x + y \cdot \frac{z - t}{z - a}\]
    2. Using strategy rm
    3. Applied *-un-lft-identity4.3

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

      \[\leadsto x + y \cdot \frac{\color{blue}{\left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right) \cdot \sqrt[3]{z - t}}}{1 \cdot \left(z - a\right)}\]
    5. Applied times-frac4.7

      \[\leadsto x + y \cdot \color{blue}{\left(\frac{\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}}{1} \cdot \frac{\sqrt[3]{z - t}}{z - a}\right)}\]
    6. Applied associate-*r*3.2

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -9.227758035671217 \cdot 10^{-125} \lor \neg \left(z \leq 8.334207124138048 \cdot 10^{-119}\right):\\ \;\;\;\;x + y \cdot \frac{z - t}{z - a}\\ \mathbf{else}:\\ \;\;\;\;x + \left(y \cdot \left(\sqrt[3]{z - t} \cdot \sqrt[3]{z - t}\right)\right) \cdot \frac{\sqrt[3]{z - t}}{z - a}\\ \end{array}\]

Reproduce

herbie shell --seed 2020196 
(FPCore (x y z t a)
  :name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
  :precision binary64

  :herbie-target
  (+ x (/ y (/ (- z a) (- z t))))

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