Numeric.AD.Rank1.Halley:findZero from ad-4.2.4

Percentage Accurate: 82.3% → 97.3%
Time: 9.4s
Alternatives: 8
Speedup: 1.0×

Specification

?
\[\begin{array}{l} \\ x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))
double code(double x, double y, double z, double t) {
	return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (((y * 2.0d0) * z) / (((z * 2.0d0) * z) - (y * t)))
end function
public static double code(double x, double y, double z, double t) {
	return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
}
def code(x, y, z, t):
	return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)))
function code(x, y, z, t)
	return Float64(x - Float64(Float64(Float64(y * 2.0) * z) / Float64(Float64(Float64(z * 2.0) * z) - Float64(y * t))))
end
function tmp = code(x, y, z, t)
	tmp = x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
end
code[x_, y_, z_, t_] := N[(x - N[(N[(N[(y * 2.0), $MachinePrecision] * z), $MachinePrecision] / N[(N[(N[(z * 2.0), $MachinePrecision] * z), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 82.3% accurate, 1.0× speedup?

\[\begin{array}{l} \\ x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))
double code(double x, double y, double z, double t) {
	return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (((y * 2.0d0) * z) / (((z * 2.0d0) * z) - (y * t)))
end function
public static double code(double x, double y, double z, double t) {
	return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
}
def code(x, y, z, t):
	return x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)))
function code(x, y, z, t)
	return Float64(x - Float64(Float64(Float64(y * 2.0) * z) / Float64(Float64(Float64(z * 2.0) * z) - Float64(y * t))))
end
function tmp = code(x, y, z, t)
	tmp = x - (((y * 2.0) * z) / (((z * 2.0) * z) - (y * t)));
end
code[x_, y_, z_, t_] := N[(x - N[(N[(N[(y * 2.0), $MachinePrecision] * z), $MachinePrecision] / N[(N[(N[(z * 2.0), $MachinePrecision] * z), $MachinePrecision] - N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t}
\end{array}

Alternative 1: 97.3% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\ \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-166}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-162}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+141}:\\ \;\;\;\;t\_1\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y - \left(t \cdot -0.5\right) \cdot \frac{\frac{y}{z}}{\frac{z}{y}}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (+ x (* (* y 2.0) (/ z (- (* y t) (* z (* z 2.0))))))))
   (if (<= z -1e+154)
     (- x (/ y z))
     (if (<= z -6e-166)
       t_1
       (if (<= z 1.1e-162)
         (- x (/ (* z -2.0) t))
         (if (<= z 7.2e+141)
           t_1
           (- x (/ (- y (* (* t -0.5) (/ (/ y z) (/ z y)))) z))))))))
double code(double x, double y, double z, double t) {
	double t_1 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))));
	double tmp;
	if (z <= -1e+154) {
		tmp = x - (y / z);
	} else if (z <= -6e-166) {
		tmp = t_1;
	} else if (z <= 1.1e-162) {
		tmp = x - ((z * -2.0) / t);
	} else if (z <= 7.2e+141) {
		tmp = t_1;
	} else {
		tmp = x - ((y - ((t * -0.5) * ((y / z) / (z / y)))) / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = x + ((y * 2.0d0) * (z / ((y * t) - (z * (z * 2.0d0)))))
    if (z <= (-1d+154)) then
        tmp = x - (y / z)
    else if (z <= (-6d-166)) then
        tmp = t_1
    else if (z <= 1.1d-162) then
        tmp = x - ((z * (-2.0d0)) / t)
    else if (z <= 7.2d+141) then
        tmp = t_1
    else
        tmp = x - ((y - ((t * (-0.5d0)) * ((y / z) / (z / y)))) / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))));
	double tmp;
	if (z <= -1e+154) {
		tmp = x - (y / z);
	} else if (z <= -6e-166) {
		tmp = t_1;
	} else if (z <= 1.1e-162) {
		tmp = x - ((z * -2.0) / t);
	} else if (z <= 7.2e+141) {
		tmp = t_1;
	} else {
		tmp = x - ((y - ((t * -0.5) * ((y / z) / (z / y)))) / z);
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))))
	tmp = 0
	if z <= -1e+154:
		tmp = x - (y / z)
	elif z <= -6e-166:
		tmp = t_1
	elif z <= 1.1e-162:
		tmp = x - ((z * -2.0) / t)
	elif z <= 7.2e+141:
		tmp = t_1
	else:
		tmp = x - ((y - ((t * -0.5) * ((y / z) / (z / y)))) / z)
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x + Float64(Float64(y * 2.0) * Float64(z / Float64(Float64(y * t) - Float64(z * Float64(z * 2.0))))))
	tmp = 0.0
	if (z <= -1e+154)
		tmp = Float64(x - Float64(y / z));
	elseif (z <= -6e-166)
		tmp = t_1;
	elseif (z <= 1.1e-162)
		tmp = Float64(x - Float64(Float64(z * -2.0) / t));
	elseif (z <= 7.2e+141)
		tmp = t_1;
	else
		tmp = Float64(x - Float64(Float64(y - Float64(Float64(t * -0.5) * Float64(Float64(y / z) / Float64(z / y)))) / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))));
	tmp = 0.0;
	if (z <= -1e+154)
		tmp = x - (y / z);
	elseif (z <= -6e-166)
		tmp = t_1;
	elseif (z <= 1.1e-162)
		tmp = x - ((z * -2.0) / t);
	elseif (z <= 7.2e+141)
		tmp = t_1;
	else
		tmp = x - ((y - ((t * -0.5) * ((y / z) / (z / y)))) / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y * 2.0), $MachinePrecision] * N[(z / N[(N[(y * t), $MachinePrecision] - N[(z * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+154], N[(x - N[(y / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -6e-166], t$95$1, If[LessEqual[z, 1.1e-162], N[(x - N[(N[(z * -2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.2e+141], t$95$1, N[(x - N[(N[(y - N[(N[(t * -0.5), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\
\;\;\;\;x - \frac{y}{z}\\

\mathbf{elif}\;z \leq -6 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq 1.1 \cdot 10^{-162}:\\
\;\;\;\;x - \frac{z \cdot -2}{t}\\

\mathbf{elif}\;z \leq 7.2 \cdot 10^{+141}:\\
\;\;\;\;t\_1\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -1.00000000000000004e154

    1. Initial program 60.0%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified82.9%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around 0 100.0%

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

    if -1.00000000000000004e154 < z < -6.0000000000000005e-166 or 1.1e-162 < z < 7.2000000000000003e141

    1. Initial program 87.4%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified94.0%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing

    if -6.0000000000000005e-166 < z < 1.1e-162

    1. Initial program 76.5%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified69.9%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around inf 98.2%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{z}{t}} \]
    5. Step-by-step derivation
      1. associate-*r/98.2%

        \[\leadsto x - \color{blue}{\frac{-2 \cdot z}{t}} \]
      2. *-commutative98.2%

        \[\leadsto x - \frac{\color{blue}{z \cdot -2}}{t} \]
    6. Simplified98.2%

      \[\leadsto x - \color{blue}{\frac{z \cdot -2}{t}} \]

    if 7.2000000000000003e141 < z

    1. Initial program 61.6%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified75.1%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num75.1%

        \[\leadsto x - \left(y \cdot 2\right) \cdot \color{blue}{\frac{1}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      2. un-div-inv75.1%

        \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      3. *-commutative75.1%

        \[\leadsto x - \frac{\color{blue}{2 \cdot y}}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}} \]
      4. *-commutative75.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{\left(2 \cdot z\right) \cdot z} - y \cdot t}{z}} \]
      5. associate-*l*75.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{2 \cdot \left(z \cdot z\right)} - y \cdot t}{z}} \]
      6. pow275.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{2 \cdot \color{blue}{{z}^{2}} - y \cdot t}{z}} \]
    5. Applied egg-rr75.1%

      \[\leadsto x - \color{blue}{\frac{2 \cdot y}{\frac{2 \cdot {z}^{2} - y \cdot t}{z}}} \]
    6. Step-by-step derivation
      1. associate-/r/75.1%

        \[\leadsto x - \color{blue}{\frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t} \cdot z} \]
      2. *-commutative75.1%

        \[\leadsto x - \color{blue}{z \cdot \frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t}} \]
      3. *-commutative75.1%

        \[\leadsto x - z \cdot \frac{\color{blue}{y \cdot 2}}{2 \cdot {z}^{2} - y \cdot t} \]
      4. *-commutative75.1%

        \[\leadsto x - z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - \color{blue}{t \cdot y}} \]
    7. Simplified75.1%

      \[\leadsto x - \color{blue}{z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - t \cdot y}} \]
    8. Taylor expanded in z around -inf 77.4%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{-1 \cdot y + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{z}} \]
    9. Step-by-step derivation
      1. mul-1-neg77.4%

        \[\leadsto x - \color{blue}{\left(-\frac{-1 \cdot y + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{z}\right)} \]
      2. neg-mul-177.4%

        \[\leadsto x - \left(-\frac{\color{blue}{\left(-y\right)} + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{z}\right) \]
      3. distribute-neg-frac277.4%

        \[\leadsto x - \color{blue}{\frac{\left(-y\right) + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{-z}} \]
    10. Simplified96.9%

      \[\leadsto x - \color{blue}{\frac{\left(-0.5 \cdot t\right) \cdot {\left(\frac{y}{z}\right)}^{2} - y}{-z}} \]
    11. Step-by-step derivation
      1. clear-num96.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot {\color{blue}{\left(\frac{1}{\frac{z}{y}}\right)}}^{2} - y}{-z} \]
      2. pow296.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \color{blue}{\left(\frac{1}{\frac{z}{y}} \cdot \frac{1}{\frac{z}{y}}\right)} - y}{-z} \]
      3. un-div-inv96.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \color{blue}{\frac{\frac{1}{\frac{z}{y}}}{\frac{z}{y}}} - y}{-z} \]
      4. clear-num96.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \frac{\color{blue}{\frac{y}{z}}}{\frac{z}{y}} - y}{-z} \]
    12. Applied egg-rr96.9%

      \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \color{blue}{\frac{\frac{y}{z}}{\frac{z}{y}}} - y}{-z} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification96.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-166}:\\ \;\;\;\;x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\ \mathbf{elif}\;z \leq 1.1 \cdot 10^{-162}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \mathbf{elif}\;z \leq 7.2 \cdot 10^{+141}:\\ \;\;\;\;x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y - \left(t \cdot -0.5\right) \cdot \frac{\frac{y}{z}}{\frac{z}{y}}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 2: 95.1% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{-166}:\\ \;\;\;\;\mathsf{fma}\left(y, z \cdot \frac{2}{\mathsf{fma}\left(z, z \cdot -2, y \cdot t\right)}, x\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-138}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+141}:\\ \;\;\;\;x + z \cdot \frac{y \cdot 2}{y \cdot t - 2 \cdot {z}^{2}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y - \left(t \cdot -0.5\right) \cdot \frac{\frac{y}{z}}{\frac{z}{y}}}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= z -6e-166)
   (fma y (* z (/ 2.0 (fma z (* z -2.0) (* y t)))) x)
   (if (<= z 2.1e-138)
     (- x (/ (* z -2.0) t))
     (if (<= z 5.8e+141)
       (+ x (* z (/ (* y 2.0) (- (* y t) (* 2.0 (pow z 2.0))))))
       (- x (/ (- y (* (* t -0.5) (/ (/ y z) (/ z y)))) z))))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (z <= -6e-166) {
		tmp = fma(y, (z * (2.0 / fma(z, (z * -2.0), (y * t)))), x);
	} else if (z <= 2.1e-138) {
		tmp = x - ((z * -2.0) / t);
	} else if (z <= 5.8e+141) {
		tmp = x + (z * ((y * 2.0) / ((y * t) - (2.0 * pow(z, 2.0)))));
	} else {
		tmp = x - ((y - ((t * -0.5) * ((y / z) / (z / y)))) / z);
	}
	return tmp;
}
function code(x, y, z, t)
	tmp = 0.0
	if (z <= -6e-166)
		tmp = fma(y, Float64(z * Float64(2.0 / fma(z, Float64(z * -2.0), Float64(y * t)))), x);
	elseif (z <= 2.1e-138)
		tmp = Float64(x - Float64(Float64(z * -2.0) / t));
	elseif (z <= 5.8e+141)
		tmp = Float64(x + Float64(z * Float64(Float64(y * 2.0) / Float64(Float64(y * t) - Float64(2.0 * (z ^ 2.0))))));
	else
		tmp = Float64(x - Float64(Float64(y - Float64(Float64(t * -0.5) * Float64(Float64(y / z) / Float64(z / y)))) / z));
	end
	return tmp
end
code[x_, y_, z_, t_] := If[LessEqual[z, -6e-166], N[(y * N[(z * N[(2.0 / N[(z * N[(z * -2.0), $MachinePrecision] + N[(y * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 2.1e-138], N[(x - N[(N[(z * -2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.8e+141], N[(x + N[(z * N[(N[(y * 2.0), $MachinePrecision] / N[(N[(y * t), $MachinePrecision] - N[(2.0 * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(N[(t * -0.5), $MachinePrecision] * N[(N[(y / z), $MachinePrecision] / N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{-166}:\\
\;\;\;\;\mathsf{fma}\left(y, z \cdot \frac{2}{\mathsf{fma}\left(z, z \cdot -2, y \cdot t\right)}, x\right)\\

\mathbf{elif}\;z \leq 2.1 \cdot 10^{-138}:\\
\;\;\;\;x - \frac{z \cdot -2}{t}\\

\mathbf{elif}\;z \leq 5.8 \cdot 10^{+141}:\\
\;\;\;\;x + z \cdot \frac{y \cdot 2}{y \cdot t - 2 \cdot {z}^{2}}\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if z < -6.0000000000000005e-166

    1. Initial program 75.2%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified90.1%

      \[\leadsto \color{blue}{\mathsf{fma}\left(y, z \cdot \frac{2}{\mathsf{fma}\left(z, z \cdot -2, y \cdot t\right)}, x\right)} \]
    3. Add Preprocessing

    if -6.0000000000000005e-166 < z < 2.09999999999999986e-138

    1. Initial program 78.5%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified72.6%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around inf 98.3%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{z}{t}} \]
    5. Step-by-step derivation
      1. associate-*r/98.3%

        \[\leadsto x - \color{blue}{\frac{-2 \cdot z}{t}} \]
      2. *-commutative98.3%

        \[\leadsto x - \frac{\color{blue}{z \cdot -2}}{t} \]
    6. Simplified98.3%

      \[\leadsto x - \color{blue}{\frac{z \cdot -2}{t}} \]

    if 2.09999999999999986e-138 < z < 5.80000000000000013e141

    1. Initial program 94.5%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified99.8%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num99.8%

        \[\leadsto x - \left(y \cdot 2\right) \cdot \color{blue}{\frac{1}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      2. un-div-inv99.8%

        \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      3. *-commutative99.8%

        \[\leadsto x - \frac{\color{blue}{2 \cdot y}}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}} \]
      4. *-commutative99.8%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{\left(2 \cdot z\right) \cdot z} - y \cdot t}{z}} \]
      5. associate-*l*99.8%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{2 \cdot \left(z \cdot z\right)} - y \cdot t}{z}} \]
      6. pow299.8%

        \[\leadsto x - \frac{2 \cdot y}{\frac{2 \cdot \color{blue}{{z}^{2}} - y \cdot t}{z}} \]
    5. Applied egg-rr99.8%

      \[\leadsto x - \color{blue}{\frac{2 \cdot y}{\frac{2 \cdot {z}^{2} - y \cdot t}{z}}} \]
    6. Step-by-step derivation
      1. associate-/r/99.8%

        \[\leadsto x - \color{blue}{\frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t} \cdot z} \]
      2. *-commutative99.8%

        \[\leadsto x - \color{blue}{z \cdot \frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t}} \]
      3. *-commutative99.8%

        \[\leadsto x - z \cdot \frac{\color{blue}{y \cdot 2}}{2 \cdot {z}^{2} - y \cdot t} \]
      4. *-commutative99.8%

        \[\leadsto x - z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - \color{blue}{t \cdot y}} \]
    7. Simplified99.8%

      \[\leadsto x - \color{blue}{z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - t \cdot y}} \]

    if 5.80000000000000013e141 < z

    1. Initial program 61.6%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified75.1%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num75.1%

        \[\leadsto x - \left(y \cdot 2\right) \cdot \color{blue}{\frac{1}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      2. un-div-inv75.1%

        \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      3. *-commutative75.1%

        \[\leadsto x - \frac{\color{blue}{2 \cdot y}}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}} \]
      4. *-commutative75.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{\left(2 \cdot z\right) \cdot z} - y \cdot t}{z}} \]
      5. associate-*l*75.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{2 \cdot \left(z \cdot z\right)} - y \cdot t}{z}} \]
      6. pow275.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{2 \cdot \color{blue}{{z}^{2}} - y \cdot t}{z}} \]
    5. Applied egg-rr75.1%

      \[\leadsto x - \color{blue}{\frac{2 \cdot y}{\frac{2 \cdot {z}^{2} - y \cdot t}{z}}} \]
    6. Step-by-step derivation
      1. associate-/r/75.1%

        \[\leadsto x - \color{blue}{\frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t} \cdot z} \]
      2. *-commutative75.1%

        \[\leadsto x - \color{blue}{z \cdot \frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t}} \]
      3. *-commutative75.1%

        \[\leadsto x - z \cdot \frac{\color{blue}{y \cdot 2}}{2 \cdot {z}^{2} - y \cdot t} \]
      4. *-commutative75.1%

        \[\leadsto x - z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - \color{blue}{t \cdot y}} \]
    7. Simplified75.1%

      \[\leadsto x - \color{blue}{z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - t \cdot y}} \]
    8. Taylor expanded in z around -inf 77.4%

      \[\leadsto x - \color{blue}{-1 \cdot \frac{-1 \cdot y + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{z}} \]
    9. Step-by-step derivation
      1. mul-1-neg77.4%

        \[\leadsto x - \color{blue}{\left(-\frac{-1 \cdot y + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{z}\right)} \]
      2. neg-mul-177.4%

        \[\leadsto x - \left(-\frac{\color{blue}{\left(-y\right)} + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{z}\right) \]
      3. distribute-neg-frac277.4%

        \[\leadsto x - \color{blue}{\frac{\left(-y\right) + -0.5 \cdot \frac{t \cdot {y}^{2}}{{z}^{2}}}{-z}} \]
    10. Simplified96.9%

      \[\leadsto x - \color{blue}{\frac{\left(-0.5 \cdot t\right) \cdot {\left(\frac{y}{z}\right)}^{2} - y}{-z}} \]
    11. Step-by-step derivation
      1. clear-num96.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot {\color{blue}{\left(\frac{1}{\frac{z}{y}}\right)}}^{2} - y}{-z} \]
      2. pow296.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \color{blue}{\left(\frac{1}{\frac{z}{y}} \cdot \frac{1}{\frac{z}{y}}\right)} - y}{-z} \]
      3. un-div-inv96.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \color{blue}{\frac{\frac{1}{\frac{z}{y}}}{\frac{z}{y}}} - y}{-z} \]
      4. clear-num96.9%

        \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \frac{\color{blue}{\frac{y}{z}}}{\frac{z}{y}} - y}{-z} \]
    12. Applied egg-rr96.9%

      \[\leadsto x - \frac{\left(-0.5 \cdot t\right) \cdot \color{blue}{\frac{\frac{y}{z}}{\frac{z}{y}}} - y}{-z} \]
  3. Recombined 4 regimes into one program.
  4. Final simplification94.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -6 \cdot 10^{-166}:\\ \;\;\;\;\mathsf{fma}\left(y, z \cdot \frac{2}{\mathsf{fma}\left(z, z \cdot -2, y \cdot t\right)}, x\right)\\ \mathbf{elif}\;z \leq 2.1 \cdot 10^{-138}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \mathbf{elif}\;z \leq 5.8 \cdot 10^{+141}:\\ \;\;\;\;x + z \cdot \frac{y \cdot 2}{y \cdot t - 2 \cdot {z}^{2}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y - \left(t \cdot -0.5\right) \cdot \frac{\frac{y}{z}}{\frac{z}{y}}}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 94.6% accurate, 0.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x + \frac{z \cdot \left(y \cdot 2\right)}{y \cdot t - z \cdot \left(z \cdot 2\right)} \leq 2 \cdot 10^{+264}:\\ \;\;\;\;x + z \cdot \frac{y \cdot 2}{y \cdot t - 2 \cdot {z}^{2}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= (+ x (/ (* z (* y 2.0)) (- (* y t) (* z (* z 2.0))))) 2e+264)
   (+ x (* z (/ (* y 2.0) (- (* y t) (* 2.0 (pow z 2.0))))))
   (- x (/ y z))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((x + ((z * (y * 2.0)) / ((y * t) - (z * (z * 2.0))))) <= 2e+264) {
		tmp = x + (z * ((y * 2.0) / ((y * t) - (2.0 * pow(z, 2.0)))));
	} else {
		tmp = x - (y / z);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((x + ((z * (y * 2.0d0)) / ((y * t) - (z * (z * 2.0d0))))) <= 2d+264) then
        tmp = x + (z * ((y * 2.0d0) / ((y * t) - (2.0d0 * (z ** 2.0d0)))))
    else
        tmp = x - (y / z)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((x + ((z * (y * 2.0)) / ((y * t) - (z * (z * 2.0))))) <= 2e+264) {
		tmp = x + (z * ((y * 2.0) / ((y * t) - (2.0 * Math.pow(z, 2.0)))));
	} else {
		tmp = x - (y / z);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (x + ((z * (y * 2.0)) / ((y * t) - (z * (z * 2.0))))) <= 2e+264:
		tmp = x + (z * ((y * 2.0) / ((y * t) - (2.0 * math.pow(z, 2.0)))))
	else:
		tmp = x - (y / z)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (Float64(x + Float64(Float64(z * Float64(y * 2.0)) / Float64(Float64(y * t) - Float64(z * Float64(z * 2.0))))) <= 2e+264)
		tmp = Float64(x + Float64(z * Float64(Float64(y * 2.0) / Float64(Float64(y * t) - Float64(2.0 * (z ^ 2.0))))));
	else
		tmp = Float64(x - Float64(y / z));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((x + ((z * (y * 2.0)) / ((y * t) - (z * (z * 2.0))))) <= 2e+264)
		tmp = x + (z * ((y * 2.0) / ((y * t) - (2.0 * (z ^ 2.0)))));
	else
		tmp = x - (y / z);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[N[(x + N[(N[(z * N[(y * 2.0), $MachinePrecision]), $MachinePrecision] / N[(N[(y * t), $MachinePrecision] - N[(z * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+264], N[(x + N[(z * N[(N[(y * 2.0), $MachinePrecision] / N[(N[(y * t), $MachinePrecision] - N[(2.0 * N[Power[z, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y / z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x + \frac{z \cdot \left(y \cdot 2\right)}{y \cdot t - z \cdot \left(z \cdot 2\right)} \leq 2 \cdot 10^{+264}:\\
\;\;\;\;x + z \cdot \frac{y \cdot 2}{y \cdot t - 2 \cdot {z}^{2}}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{y}{z}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (-.f64 x (/.f64 (*.f64 (*.f64 y #s(literal 2 binary64)) z) (-.f64 (*.f64 (*.f64 z #s(literal 2 binary64)) z) (*.f64 y t)))) < 2.00000000000000009e264

    1. Initial program 92.1%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified92.4%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Step-by-step derivation
      1. clear-num92.1%

        \[\leadsto x - \left(y \cdot 2\right) \cdot \color{blue}{\frac{1}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      2. un-div-inv92.1%

        \[\leadsto x - \color{blue}{\frac{y \cdot 2}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}}} \]
      3. *-commutative92.1%

        \[\leadsto x - \frac{\color{blue}{2 \cdot y}}{\frac{z \cdot \left(2 \cdot z\right) - y \cdot t}{z}} \]
      4. *-commutative92.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{\left(2 \cdot z\right) \cdot z} - y \cdot t}{z}} \]
      5. associate-*l*92.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{\color{blue}{2 \cdot \left(z \cdot z\right)} - y \cdot t}{z}} \]
      6. pow292.1%

        \[\leadsto x - \frac{2 \cdot y}{\frac{2 \cdot \color{blue}{{z}^{2}} - y \cdot t}{z}} \]
    5. Applied egg-rr92.1%

      \[\leadsto x - \color{blue}{\frac{2 \cdot y}{\frac{2 \cdot {z}^{2} - y \cdot t}{z}}} \]
    6. Step-by-step derivation
      1. associate-/r/94.8%

        \[\leadsto x - \color{blue}{\frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t} \cdot z} \]
      2. *-commutative94.8%

        \[\leadsto x - \color{blue}{z \cdot \frac{2 \cdot y}{2 \cdot {z}^{2} - y \cdot t}} \]
      3. *-commutative94.8%

        \[\leadsto x - z \cdot \frac{\color{blue}{y \cdot 2}}{2 \cdot {z}^{2} - y \cdot t} \]
      4. *-commutative94.8%

        \[\leadsto x - z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - \color{blue}{t \cdot y}} \]
    7. Simplified94.8%

      \[\leadsto x - \color{blue}{z \cdot \frac{y \cdot 2}{2 \cdot {z}^{2} - t \cdot y}} \]

    if 2.00000000000000009e264 < (-.f64 x (/.f64 (*.f64 (*.f64 y #s(literal 2 binary64)) z) (-.f64 (*.f64 (*.f64 z #s(literal 2 binary64)) z) (*.f64 y t))))

    1. Initial program 17.4%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified54.2%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around 0 77.4%

      \[\leadsto x - \color{blue}{\frac{y}{z}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification91.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x + \frac{z \cdot \left(y \cdot 2\right)}{y \cdot t - z \cdot \left(z \cdot 2\right)} \leq 2 \cdot 10^{+264}:\\ \;\;\;\;x + z \cdot \frac{y \cdot 2}{y \cdot t - 2 \cdot {z}^{2}}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 97.4% accurate, 0.5× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := x - \frac{y}{z}\\ t_2 := x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\ \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-166}:\\ \;\;\;\;t\_2\\ \mathbf{elif}\;z \leq 10^{-162}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+138}:\\ \;\;\;\;t\_2\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (let* ((t_1 (- x (/ y z)))
        (t_2 (+ x (* (* y 2.0) (/ z (- (* y t) (* z (* z 2.0))))))))
   (if (<= z -1e+154)
     t_1
     (if (<= z -6e-166)
       t_2
       (if (<= z 1e-162)
         (- x (/ (* z -2.0) t))
         (if (<= z 8.5e+138) t_2 t_1))))))
double code(double x, double y, double z, double t) {
	double t_1 = x - (y / z);
	double t_2 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))));
	double tmp;
	if (z <= -1e+154) {
		tmp = t_1;
	} else if (z <= -6e-166) {
		tmp = t_2;
	} else if (z <= 1e-162) {
		tmp = x - ((z * -2.0) / t);
	} else if (z <= 8.5e+138) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: t_2
    real(8) :: tmp
    t_1 = x - (y / z)
    t_2 = x + ((y * 2.0d0) * (z / ((y * t) - (z * (z * 2.0d0)))))
    if (z <= (-1d+154)) then
        tmp = t_1
    else if (z <= (-6d-166)) then
        tmp = t_2
    else if (z <= 1d-162) then
        tmp = x - ((z * (-2.0d0)) / t)
    else if (z <= 8.5d+138) then
        tmp = t_2
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double t_1 = x - (y / z);
	double t_2 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))));
	double tmp;
	if (z <= -1e+154) {
		tmp = t_1;
	} else if (z <= -6e-166) {
		tmp = t_2;
	} else if (z <= 1e-162) {
		tmp = x - ((z * -2.0) / t);
	} else if (z <= 8.5e+138) {
		tmp = t_2;
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(x, y, z, t):
	t_1 = x - (y / z)
	t_2 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))))
	tmp = 0
	if z <= -1e+154:
		tmp = t_1
	elif z <= -6e-166:
		tmp = t_2
	elif z <= 1e-162:
		tmp = x - ((z * -2.0) / t)
	elif z <= 8.5e+138:
		tmp = t_2
	else:
		tmp = t_1
	return tmp
function code(x, y, z, t)
	t_1 = Float64(x - Float64(y / z))
	t_2 = Float64(x + Float64(Float64(y * 2.0) * Float64(z / Float64(Float64(y * t) - Float64(z * Float64(z * 2.0))))))
	tmp = 0.0
	if (z <= -1e+154)
		tmp = t_1;
	elseif (z <= -6e-166)
		tmp = t_2;
	elseif (z <= 1e-162)
		tmp = Float64(x - Float64(Float64(z * -2.0) / t));
	elseif (z <= 8.5e+138)
		tmp = t_2;
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	t_1 = x - (y / z);
	t_2 = x + ((y * 2.0) * (z / ((y * t) - (z * (z * 2.0)))));
	tmp = 0.0;
	if (z <= -1e+154)
		tmp = t_1;
	elseif (z <= -6e-166)
		tmp = t_2;
	elseif (z <= 1e-162)
		tmp = x - ((z * -2.0) / t);
	elseif (z <= 8.5e+138)
		tmp = t_2;
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x - N[(y / z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * 2.0), $MachinePrecision] * N[(z / N[(N[(y * t), $MachinePrecision] - N[(z * N[(z * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+154], t$95$1, If[LessEqual[z, -6e-166], t$95$2, If[LessEqual[z, 1e-162], N[(x - N[(N[(z * -2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+138], t$95$2, t$95$1]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := x - \frac{y}{z}\\
t_2 := x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;z \leq -6 \cdot 10^{-166}:\\
\;\;\;\;t\_2\\

\mathbf{elif}\;z \leq 10^{-162}:\\
\;\;\;\;x - \frac{z \cdot -2}{t}\\

\mathbf{elif}\;z \leq 8.5 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z < -1.00000000000000004e154 or 8.5000000000000006e138 < z

    1. Initial program 60.8%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified79.2%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around 0 98.4%

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

    if -1.00000000000000004e154 < z < -6.0000000000000005e-166 or 9.99999999999999954e-163 < z < 8.5000000000000006e138

    1. Initial program 87.4%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified94.0%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing

    if -6.0000000000000005e-166 < z < 9.99999999999999954e-163

    1. Initial program 76.5%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified69.9%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around inf 98.2%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{z}{t}} \]
    5. Step-by-step derivation
      1. associate-*r/98.2%

        \[\leadsto x - \color{blue}{\frac{-2 \cdot z}{t}} \]
      2. *-commutative98.2%

        \[\leadsto x - \frac{\color{blue}{z \cdot -2}}{t} \]
    6. Simplified98.2%

      \[\leadsto x - \color{blue}{\frac{z \cdot -2}{t}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification95.9%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -1 \cdot 10^{+154}:\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{elif}\;z \leq -6 \cdot 10^{-166}:\\ \;\;\;\;x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\ \mathbf{elif}\;z \leq 10^{-162}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \mathbf{elif}\;z \leq 8.5 \cdot 10^{+138}:\\ \;\;\;\;x + \left(y \cdot 2\right) \cdot \frac{z}{y \cdot t - z \cdot \left(z \cdot 2\right)}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{y}{z}\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 75.2% accurate, 0.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -4.6 \cdot 10^{-215}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 1.36 \cdot 10^{-232}:\\ \;\;\;\;2 \cdot \frac{z}{t}\\ \mathbf{elif}\;x \leq 2.2 \cdot 10^{-133}:\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -4.6e-215)
   x
   (if (<= x 1.36e-232) (* 2.0 (/ z t)) (if (<= x 2.2e-133) (- x (/ y z)) x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -4.6e-215) {
		tmp = x;
	} else if (x <= 1.36e-232) {
		tmp = 2.0 * (z / t);
	} else if (x <= 2.2e-133) {
		tmp = x - (y / z);
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x <= (-4.6d-215)) then
        tmp = x
    else if (x <= 1.36d-232) then
        tmp = 2.0d0 * (z / t)
    else if (x <= 2.2d-133) then
        tmp = x - (y / z)
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -4.6e-215) {
		tmp = x;
	} else if (x <= 1.36e-232) {
		tmp = 2.0 * (z / t);
	} else if (x <= 2.2e-133) {
		tmp = x - (y / z);
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -4.6e-215:
		tmp = x
	elif x <= 1.36e-232:
		tmp = 2.0 * (z / t)
	elif x <= 2.2e-133:
		tmp = x - (y / z)
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -4.6e-215)
		tmp = x;
	elseif (x <= 1.36e-232)
		tmp = Float64(2.0 * Float64(z / t));
	elseif (x <= 2.2e-133)
		tmp = Float64(x - Float64(y / z));
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -4.6e-215)
		tmp = x;
	elseif (x <= 1.36e-232)
		tmp = 2.0 * (z / t);
	elseif (x <= 2.2e-133)
		tmp = x - (y / z);
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.6e-215], x, If[LessEqual[x, 1.36e-232], N[(2.0 * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.2e-133], N[(x - N[(y / z), $MachinePrecision]), $MachinePrecision], x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.6 \cdot 10^{-215}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 1.36 \cdot 10^{-232}:\\
\;\;\;\;2 \cdot \frac{z}{t}\\

\mathbf{elif}\;x \leq 2.2 \cdot 10^{-133}:\\
\;\;\;\;x - \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -4.5999999999999998e-215 or 2.2000000000000001e-133 < x

    1. Initial program 81.6%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified91.6%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 85.8%

      \[\leadsto \color{blue}{x} \]

    if -4.5999999999999998e-215 < x < 1.3600000000000001e-232

    1. Initial program 67.4%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified66.7%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around inf 74.0%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{z}{t}} \]
    5. Step-by-step derivation
      1. associate-*r/74.0%

        \[\leadsto x - \color{blue}{\frac{-2 \cdot z}{t}} \]
      2. *-commutative74.0%

        \[\leadsto x - \frac{\color{blue}{z \cdot -2}}{t} \]
    6. Simplified74.0%

      \[\leadsto x - \color{blue}{\frac{z \cdot -2}{t}} \]
    7. Taylor expanded in x around 0 59.8%

      \[\leadsto \color{blue}{2 \cdot \frac{z}{t}} \]

    if 1.3600000000000001e-232 < x < 2.2000000000000001e-133

    1. Initial program 72.4%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified69.6%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around 0 67.7%

      \[\leadsto x - \color{blue}{\frac{y}{z}} \]
  3. Recombined 3 regimes into one program.
  4. Add Preprocessing

Alternative 6: 74.6% accurate, 0.9× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -6.6 \cdot 10^{-211}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-232}:\\ \;\;\;\;2 \cdot \frac{z}{t}\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-207}:\\ \;\;\;\;\frac{-y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (<= x -6.6e-211)
   x
   (if (<= x 3e-232) (* 2.0 (/ z t)) (if (<= x 2.25e-207) (/ (- y) z) x))))
double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6.6e-211) {
		tmp = x;
	} else if (x <= 3e-232) {
		tmp = 2.0 * (z / t);
	} else if (x <= 2.25e-207) {
		tmp = -y / z;
	} else {
		tmp = x;
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if (x <= (-6.6d-211)) then
        tmp = x
    else if (x <= 3d-232) then
        tmp = 2.0d0 * (z / t)
    else if (x <= 2.25d-207) then
        tmp = -y / z
    else
        tmp = x
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if (x <= -6.6e-211) {
		tmp = x;
	} else if (x <= 3e-232) {
		tmp = 2.0 * (z / t);
	} else if (x <= 2.25e-207) {
		tmp = -y / z;
	} else {
		tmp = x;
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if x <= -6.6e-211:
		tmp = x
	elif x <= 3e-232:
		tmp = 2.0 * (z / t)
	elif x <= 2.25e-207:
		tmp = -y / z
	else:
		tmp = x
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if (x <= -6.6e-211)
		tmp = x;
	elseif (x <= 3e-232)
		tmp = Float64(2.0 * Float64(z / t));
	elseif (x <= 2.25e-207)
		tmp = Float64(Float64(-y) / z);
	else
		tmp = x;
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if (x <= -6.6e-211)
		tmp = x;
	elseif (x <= 3e-232)
		tmp = 2.0 * (z / t);
	elseif (x <= 2.25e-207)
		tmp = -y / z;
	else
		tmp = x;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.6e-211], x, If[LessEqual[x, 3e-232], N[(2.0 * N[(z / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.25e-207], N[((-y) / z), $MachinePrecision], x]]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.6 \cdot 10^{-211}:\\
\;\;\;\;x\\

\mathbf{elif}\;x \leq 3 \cdot 10^{-232}:\\
\;\;\;\;2 \cdot \frac{z}{t}\\

\mathbf{elif}\;x \leq 2.25 \cdot 10^{-207}:\\
\;\;\;\;\frac{-y}{z}\\

\mathbf{else}:\\
\;\;\;\;x\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -6.6000000000000004e-211 or 2.24999999999999996e-207 < x

    1. Initial program 81.2%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified90.0%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in x around inf 82.4%

      \[\leadsto \color{blue}{x} \]

    if -6.6000000000000004e-211 < x < 2.9999999999999999e-232

    1. Initial program 67.4%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified66.7%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around inf 74.0%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{z}{t}} \]
    5. Step-by-step derivation
      1. associate-*r/74.0%

        \[\leadsto x - \color{blue}{\frac{-2 \cdot z}{t}} \]
      2. *-commutative74.0%

        \[\leadsto x - \frac{\color{blue}{z \cdot -2}}{t} \]
    6. Simplified74.0%

      \[\leadsto x - \color{blue}{\frac{z \cdot -2}{t}} \]
    7. Taylor expanded in x around 0 59.8%

      \[\leadsto \color{blue}{2 \cdot \frac{z}{t}} \]

    if 2.9999999999999999e-232 < x < 2.24999999999999996e-207

    1. Initial program 63.1%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified63.1%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around 0 96.4%

      \[\leadsto x - \color{blue}{\frac{y}{z}} \]
    5. Taylor expanded in x around 0 83.8%

      \[\leadsto \color{blue}{-1 \cdot \frac{y}{z}} \]
    6. Step-by-step derivation
      1. mul-1-neg83.8%

        \[\leadsto \color{blue}{-\frac{y}{z}} \]
      2. distribute-frac-neg283.8%

        \[\leadsto \color{blue}{\frac{y}{-z}} \]
    7. Simplified83.8%

      \[\leadsto \color{blue}{\frac{y}{-z}} \]
  3. Recombined 3 regimes into one program.
  4. Final simplification78.8%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -6.6 \cdot 10^{-211}:\\ \;\;\;\;x\\ \mathbf{elif}\;x \leq 3 \cdot 10^{-232}:\\ \;\;\;\;2 \cdot \frac{z}{t}\\ \mathbf{elif}\;x \leq 2.25 \cdot 10^{-207}:\\ \;\;\;\;\frac{-y}{z}\\ \mathbf{else}:\\ \;\;\;\;x\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 88.0% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+14} \lor \neg \left(z \leq 5.2 \cdot 10^{+86}\right):\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \end{array} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (if (or (<= z -5.8e+14) (not (<= z 5.2e+86)))
   (- x (/ y z))
   (- x (/ (* z -2.0) t))))
double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -5.8e+14) || !(z <= 5.2e+86)) {
		tmp = x - (y / z);
	} else {
		tmp = x - ((z * -2.0) / t);
	}
	return tmp;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    real(8) :: tmp
    if ((z <= (-5.8d+14)) .or. (.not. (z <= 5.2d+86))) then
        tmp = x - (y / z)
    else
        tmp = x - ((z * (-2.0d0)) / t)
    end if
    code = tmp
end function
public static double code(double x, double y, double z, double t) {
	double tmp;
	if ((z <= -5.8e+14) || !(z <= 5.2e+86)) {
		tmp = x - (y / z);
	} else {
		tmp = x - ((z * -2.0) / t);
	}
	return tmp;
}
def code(x, y, z, t):
	tmp = 0
	if (z <= -5.8e+14) or not (z <= 5.2e+86):
		tmp = x - (y / z)
	else:
		tmp = x - ((z * -2.0) / t)
	return tmp
function code(x, y, z, t)
	tmp = 0.0
	if ((z <= -5.8e+14) || !(z <= 5.2e+86))
		tmp = Float64(x - Float64(y / z));
	else
		tmp = Float64(x - Float64(Float64(z * -2.0) / t));
	end
	return tmp
end
function tmp_2 = code(x, y, z, t)
	tmp = 0.0;
	if ((z <= -5.8e+14) || ~((z <= 5.2e+86)))
		tmp = x - (y / z);
	else
		tmp = x - ((z * -2.0) / t);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -5.8e+14], N[Not[LessEqual[z, 5.2e+86]], $MachinePrecision]], N[(x - N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z * -2.0), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{+14} \lor \neg \left(z \leq 5.2 \cdot 10^{+86}\right):\\
\;\;\;\;x - \frac{y}{z}\\

\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot -2}{t}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z < -5.8e14 or 5.1999999999999995e86 < z

    1. Initial program 66.1%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified83.2%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around 0 91.9%

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

    if -5.8e14 < z < 5.1999999999999995e86

    1. Initial program 86.9%

      \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
    2. Simplified86.9%

      \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
    3. Add Preprocessing
    4. Taylor expanded in y around inf 88.9%

      \[\leadsto x - \color{blue}{-2 \cdot \frac{z}{t}} \]
    5. Step-by-step derivation
      1. associate-*r/88.9%

        \[\leadsto x - \color{blue}{\frac{-2 \cdot z}{t}} \]
      2. *-commutative88.9%

        \[\leadsto x - \frac{\color{blue}{z \cdot -2}}{t} \]
    6. Simplified88.9%

      \[\leadsto x - \color{blue}{\frac{z \cdot -2}{t}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification90.1%

    \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -5.8 \cdot 10^{+14} \lor \neg \left(z \leq 5.2 \cdot 10^{+86}\right):\\ \;\;\;\;x - \frac{y}{z}\\ \mathbf{else}:\\ \;\;\;\;x - \frac{z \cdot -2}{t}\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 75.7% accurate, 17.0× speedup?

\[\begin{array}{l} \\ x \end{array} \]
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
	return x;
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x
end function
public static double code(double x, double y, double z, double t) {
	return x;
}
def code(x, y, z, t):
	return x
function code(x, y, z, t)
	return x
end
function tmp = code(x, y, z, t)
	tmp = x;
end
code[x_, y_, z_, t_] := x
\begin{array}{l}

\\
x
\end{array}
Derivation
  1. Initial program 78.3%

    \[x - \frac{\left(y \cdot 2\right) \cdot z}{\left(z \cdot 2\right) \cdot z - y \cdot t} \]
  2. Simplified85.4%

    \[\leadsto \color{blue}{x - \left(y \cdot 2\right) \cdot \frac{z}{z \cdot \left(2 \cdot z\right) - y \cdot t}} \]
  3. Add Preprocessing
  4. Taylor expanded in x around inf 70.9%

    \[\leadsto \color{blue}{x} \]
  5. Add Preprocessing

Developer target: 99.9% accurate, 1.3× speedup?

\[\begin{array}{l} \\ x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}} \end{array} \]
(FPCore (x y z t)
 :precision binary64
 (- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z)))))
double code(double x, double y, double z, double t) {
	return x - (1.0 / ((z / y) - ((t / 2.0) / z)));
}
real(8) function code(x, y, z, t)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8), intent (in) :: t
    code = x - (1.0d0 / ((z / y) - ((t / 2.0d0) / z)))
end function
public static double code(double x, double y, double z, double t) {
	return x - (1.0 / ((z / y) - ((t / 2.0) / z)));
}
def code(x, y, z, t):
	return x - (1.0 / ((z / y) - ((t / 2.0) / z)))
function code(x, y, z, t)
	return Float64(x - Float64(1.0 / Float64(Float64(z / y) - Float64(Float64(t / 2.0) / z))))
end
function tmp = code(x, y, z, t)
	tmp = x - (1.0 / ((z / y) - ((t / 2.0) / z)));
end
code[x_, y_, z_, t_] := N[(x - N[(1.0 / N[(N[(z / y), $MachinePrecision] - N[(N[(t / 2.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
x - \frac{1}{\frac{z}{y} - \frac{\frac{t}{2}}{z}}
\end{array}

Reproduce

?
herbie shell --seed 2024106 
(FPCore (x y z t)
  :name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
  :precision binary64

  :alt
  (- x (/ 1.0 (- (/ z y) (/ (/ t 2.0) z))))

  (- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))