
(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:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(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}
(FPCore (x y z t) :precision binary64 (+ x (/ -1.0 (+ (/ (/ t z) -2.0) (/ z y)))))
double code(double x, double y, double z, double t) {
return x + (-1.0 / (((t / z) / -2.0) + (z / y)));
}
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) / (((t / z) / (-2.0d0)) + (z / y)))
end function
public static double code(double x, double y, double z, double t) {
return x + (-1.0 / (((t / z) / -2.0) + (z / y)));
}
def code(x, y, z, t): return x + (-1.0 / (((t / z) / -2.0) + (z / y)))
function code(x, y, z, t) return Float64(x + Float64(-1.0 / Float64(Float64(Float64(t / z) / -2.0) + Float64(z / y)))) end
function tmp = code(x, y, z, t) tmp = x + (-1.0 / (((t / z) / -2.0) + (z / y))); end
code[x_, y_, z_, t_] := N[(x + N[(-1.0 / N[(N[(N[(t / z), $MachinePrecision] / -2.0), $MachinePrecision] + N[(z / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{-1}{\frac{\frac{t}{z}}{-2} + \frac{z}{y}}
\end{array}
Initial program 82.7%
Simplified88.4%
clear-num88.0%
un-div-inv88.0%
*-commutative88.0%
associate-*l*88.0%
pow288.0%
Applied egg-rr88.0%
Taylor expanded in y around 0 93.9%
Taylor expanded in x around 0 93.9%
cancel-sign-sub-inv93.9%
metadata-eval93.9%
associate-*r/93.9%
*-commutative93.9%
+-commutative93.9%
*-commutative93.9%
mul-1-neg93.9%
associate-*r/95.8%
unsub-neg95.8%
*-commutative95.8%
Simplified95.8%
clear-num95.8%
inv-pow95.8%
associate-*l/93.8%
associate-/l*97.8%
Applied egg-rr97.8%
unpow-197.8%
div-sub97.8%
*-commutative97.8%
*-commutative97.8%
times-frac97.8%
metadata-eval97.8%
neg-mul-197.8%
distribute-neg-frac297.8%
times-frac99.9%
*-inverses99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7600.0) (not (<= z 1.12e-10))) (- x (/ y z)) (- x (/ (* z -2.0) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7600.0) || !(z <= 1.12e-10)) {
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 <= (-7600.0d0)) .or. (.not. (z <= 1.12d-10))) 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 <= -7600.0) || !(z <= 1.12e-10)) {
tmp = x - (y / z);
} else {
tmp = x - ((z * -2.0) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7600.0) or not (z <= 1.12e-10): tmp = x - (y / z) else: tmp = x - ((z * -2.0) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7600.0) || !(z <= 1.12e-10)) 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 <= -7600.0) || ~((z <= 1.12e-10))) 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, -7600.0], N[Not[LessEqual[z, 1.12e-10]], $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 -7600 \lor \neg \left(z \leq 1.12 \cdot 10^{-10}\right):\\
\;\;\;\;x - \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z \cdot -2}{t}\\
\end{array}
\end{array}
if z < -7600 or 1.12e-10 < z Initial program 75.1%
sub-neg75.1%
+-commutative75.1%
associate-/l*85.1%
distribute-rgt-neg-in85.1%
fma-define85.1%
Simplified87.0%
Taylor expanded in y around 0 87.9%
mul-1-neg87.9%
sub-neg87.9%
Simplified87.9%
if -7600 < z < 1.12e-10Initial program 88.4%
Simplified90.9%
Taylor expanded in y around inf 90.3%
associate-*r/90.3%
*-commutative90.3%
Simplified90.3%
Final simplification89.3%
(FPCore (x y z t) :precision binary64 (if (or (<= z -780000.0) (not (<= z 1.16e-10))) (- x (/ y z)) (+ x (/ 2.0 (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -780000.0) || !(z <= 1.16e-10)) {
tmp = x - (y / z);
} else {
tmp = x + (2.0 / (t / 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 ((z <= (-780000.0d0)) .or. (.not. (z <= 1.16d-10))) then
tmp = x - (y / z)
else
tmp = x + (2.0d0 / (t / z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -780000.0) || !(z <= 1.16e-10)) {
tmp = x - (y / z);
} else {
tmp = x + (2.0 / (t / z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -780000.0) or not (z <= 1.16e-10): tmp = x - (y / z) else: tmp = x + (2.0 / (t / z)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -780000.0) || !(z <= 1.16e-10)) tmp = Float64(x - Float64(y / z)); else tmp = Float64(x + Float64(2.0 / Float64(t / z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -780000.0) || ~((z <= 1.16e-10))) tmp = x - (y / z); else tmp = x + (2.0 / (t / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -780000.0], N[Not[LessEqual[z, 1.16e-10]], $MachinePrecision]], N[(x - N[(y / z), $MachinePrecision]), $MachinePrecision], N[(x + N[(2.0 / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -780000 \lor \neg \left(z \leq 1.16 \cdot 10^{-10}\right):\\
\;\;\;\;x - \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{2}{\frac{t}{z}}\\
\end{array}
\end{array}
if z < -7.8e5 or 1.16e-10 < z Initial program 75.1%
sub-neg75.1%
+-commutative75.1%
associate-/l*85.1%
distribute-rgt-neg-in85.1%
fma-define85.1%
Simplified87.0%
Taylor expanded in y around 0 87.9%
mul-1-neg87.9%
sub-neg87.9%
Simplified87.9%
if -7.8e5 < z < 1.16e-10Initial program 88.4%
Simplified90.9%
clear-num90.2%
un-div-inv90.2%
*-commutative90.2%
associate-*l*90.2%
pow290.2%
Applied egg-rr90.2%
Taylor expanded in y around 0 93.8%
Taylor expanded in x around 0 93.8%
cancel-sign-sub-inv93.8%
metadata-eval93.8%
associate-*r/93.8%
*-commutative93.8%
+-commutative93.8%
*-commutative93.8%
mul-1-neg93.8%
associate-*r/93.4%
unsub-neg93.4%
*-commutative93.4%
Simplified93.4%
Taylor expanded in y around inf 90.3%
cancel-sign-sub-inv90.3%
metadata-eval90.3%
+-commutative90.3%
associate-*r/90.3%
associate-*l/90.2%
associate-/r/90.2%
Simplified90.2%
Final simplification89.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -2.25e+30) (not (<= z 3.8e-116))) (- x (/ y z)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -2.25e+30) || !(z <= 3.8e-116)) {
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 ((z <= (-2.25d+30)) .or. (.not. (z <= 3.8d-116))) 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 ((z <= -2.25e+30) || !(z <= 3.8e-116)) {
tmp = x - (y / z);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -2.25e+30) or not (z <= 3.8e-116): tmp = x - (y / z) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -2.25e+30) || !(z <= 3.8e-116)) 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 ((z <= -2.25e+30) || ~((z <= 3.8e-116))) tmp = x - (y / z); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -2.25e+30], N[Not[LessEqual[z, 3.8e-116]], $MachinePrecision]], N[(x - N[(y / z), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.25 \cdot 10^{+30} \lor \neg \left(z \leq 3.8 \cdot 10^{-116}\right):\\
\;\;\;\;x - \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if z < -2.24999999999999997e30 or 3.8000000000000001e-116 < z Initial program 79.9%
sub-neg79.9%
+-commutative79.9%
associate-/l*88.2%
distribute-rgt-neg-in88.2%
fma-define88.2%
Simplified89.8%
Taylor expanded in y around 0 83.2%
mul-1-neg83.2%
sub-neg83.2%
Simplified83.2%
if -2.24999999999999997e30 < z < 3.8000000000000001e-116Initial program 85.7%
sub-neg85.7%
+-commutative85.7%
associate-/l*88.6%
distribute-rgt-neg-in88.6%
fma-define88.6%
Simplified88.6%
Taylor expanded in y around 0 74.9%
Final simplification79.2%
(FPCore (x y z t) :precision binary64 (if (<= x -1.7e-244) x (if (<= x 6.8e-181) (* z (/ 2.0 t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.7e-244) {
tmp = x;
} else if (x <= 6.8e-181) {
tmp = z * (2.0 / t);
} 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 <= (-1.7d-244)) then
tmp = x
else if (x <= 6.8d-181) then
tmp = z * (2.0d0 / t)
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 <= -1.7e-244) {
tmp = x;
} else if (x <= 6.8e-181) {
tmp = z * (2.0 / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.7e-244: tmp = x elif x <= 6.8e-181: tmp = z * (2.0 / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.7e-244) tmp = x; elseif (x <= 6.8e-181) tmp = Float64(z * Float64(2.0 / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.7e-244) tmp = x; elseif (x <= 6.8e-181) tmp = z * (2.0 / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.7e-244], x, If[LessEqual[x, 6.8e-181], N[(z * N[(2.0 / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.7 \cdot 10^{-244}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-181}:\\
\;\;\;\;z \cdot \frac{2}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.70000000000000004e-244 or 6.8000000000000001e-181 < x Initial program 85.3%
sub-neg85.3%
+-commutative85.3%
associate-/l*91.2%
distribute-rgt-neg-in91.2%
fma-define91.2%
Simplified92.2%
Taylor expanded in y around 0 82.9%
if -1.70000000000000004e-244 < x < 6.8000000000000001e-181Initial program 70.5%
Simplified75.5%
Taylor expanded in y around inf 63.7%
associate-*r/63.7%
*-commutative63.7%
Simplified63.7%
Taylor expanded in x around 0 56.2%
associate-*r/56.2%
*-commutative56.2%
Simplified56.2%
associate-/l*56.0%
Applied egg-rr56.0%
(FPCore (x y z t) :precision binary64 (+ x (/ (* y -2.0) (- (* z 2.0) (* t (/ y z))))))
double code(double x, double y, double z, double t) {
return x + ((y * -2.0) / ((z * 2.0) - (t * (y / 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 + ((y * (-2.0d0)) / ((z * 2.0d0) - (t * (y / z))))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * -2.0) / ((z * 2.0) - (t * (y / z))));
}
def code(x, y, z, t): return x + ((y * -2.0) / ((z * 2.0) - (t * (y / z))))
function code(x, y, z, t) return Float64(x + Float64(Float64(y * -2.0) / Float64(Float64(z * 2.0) - Float64(t * Float64(y / z))))) end
function tmp = code(x, y, z, t) tmp = x + ((y * -2.0) / ((z * 2.0) - (t * (y / z)))); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * -2.0), $MachinePrecision] / N[(N[(z * 2.0), $MachinePrecision] - N[(t * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot -2}{z \cdot 2 - t \cdot \frac{y}{z}}
\end{array}
Initial program 82.7%
Simplified88.4%
clear-num88.0%
un-div-inv88.0%
*-commutative88.0%
associate-*l*88.0%
pow288.0%
Applied egg-rr88.0%
Taylor expanded in y around 0 93.9%
Taylor expanded in x around 0 93.9%
cancel-sign-sub-inv93.9%
metadata-eval93.9%
associate-*r/93.9%
*-commutative93.9%
+-commutative93.9%
*-commutative93.9%
mul-1-neg93.9%
associate-*r/95.8%
unsub-neg95.8%
*-commutative95.8%
Simplified95.8%
Final simplification95.8%
(FPCore (x y z t) :precision binary64 (if (<= x -4.8e-243) x (if (<= x 4.8e-184) (/ y (- z)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.8e-243) {
tmp = x;
} else if (x <= 4.8e-184) {
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 <= (-4.8d-243)) then
tmp = x
else if (x <= 4.8d-184) 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 <= -4.8e-243) {
tmp = x;
} else if (x <= 4.8e-184) {
tmp = y / -z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.8e-243: tmp = x elif x <= 4.8e-184: tmp = y / -z else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.8e-243) tmp = x; elseif (x <= 4.8e-184) tmp = Float64(y / Float64(-z)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.8e-243) tmp = x; elseif (x <= 4.8e-184) tmp = y / -z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.8e-243], x, If[LessEqual[x, 4.8e-184], N[(y / (-z)), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.8 \cdot 10^{-243}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{-184}:\\
\;\;\;\;\frac{y}{-z}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.8000000000000002e-243 or 4.80000000000000049e-184 < x Initial program 85.3%
sub-neg85.3%
+-commutative85.3%
associate-/l*91.2%
distribute-rgt-neg-in91.2%
fma-define91.2%
Simplified92.2%
Taylor expanded in y around 0 82.9%
if -4.8000000000000002e-243 < x < 4.80000000000000049e-184Initial program 70.5%
sub-neg70.5%
+-commutative70.5%
associate-/l*75.5%
distribute-rgt-neg-in75.5%
fma-define75.5%
Simplified75.5%
Taylor expanded in y around 0 39.4%
mul-1-neg39.4%
sub-neg39.4%
Simplified39.4%
Taylor expanded in x around 0 37.2%
neg-mul-137.2%
distribute-neg-frac237.2%
Simplified37.2%
(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}
Initial program 82.7%
sub-neg82.7%
+-commutative82.7%
associate-/l*88.4%
distribute-rgt-neg-in88.4%
fma-define88.4%
Simplified89.2%
Taylor expanded in y around 0 70.0%
(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}
herbie shell --seed 2024158
(FPCore (x y z t)
:name "Numeric.AD.Rank1.Halley:findZero from ad-4.2.4"
:precision binary64
:alt
(! :herbie-platform default (- x (/ 1 (- (/ z y) (/ (/ t 2) z)))))
(- x (/ (* (* y 2.0) z) (- (* (* z 2.0) z) (* y t)))))