
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
return x / (y - (z * 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 - (z * t))
end function
public static double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
def code(x, y, z, t): return x / (y - (z * t))
function code(x, y, z, t) return Float64(x / Float64(y - Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x / (y - (z * t)); end
code[x_, y_, z_, t_] := N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z \cdot t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 6 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
return x / (y - (z * 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 - (z * t))
end function
public static double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
def code(x, y, z, t): return x / (y - (z * t))
function code(x, y, z, t) return Float64(x / Float64(y - Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x / (y - (z * t)); end
code[x_, y_, z_, t_] := N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z \cdot t}
\end{array}
(FPCore (x y z t) :precision binary64 (/ x (- y (* z t))))
double code(double x, double y, double z, double t) {
return x / (y - (z * 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 - (z * t))
end function
public static double code(double x, double y, double z, double t) {
return x / (y - (z * t));
}
def code(x, y, z, t): return x / (y - (z * t))
function code(x, y, z, t) return Float64(x / Float64(y - Float64(z * t))) end
function tmp = code(x, y, z, t) tmp = x / (y - (z * t)); end
code[x_, y_, z_, t_] := N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y - z \cdot t}
\end{array}
Initial program 98.0%
Final simplification98.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ x (* t (- z)))))
(if (<= z -2.2e+158)
t_1
(if (<= z -1.45e+153)
(/ x y)
(if (<= z -2.1e+136)
t_1
(if (or (<= z -1.1e+102) (and (not (<= z -7.6e+29)) (<= z 8e-156)))
(/ x y)
(/ (/ x t) (- z))))))))
double code(double x, double y, double z, double t) {
double t_1 = x / (t * -z);
double tmp;
if (z <= -2.2e+158) {
tmp = t_1;
} else if (z <= -1.45e+153) {
tmp = x / y;
} else if (z <= -2.1e+136) {
tmp = t_1;
} else if ((z <= -1.1e+102) || (!(z <= -7.6e+29) && (z <= 8e-156))) {
tmp = x / y;
} else {
tmp = (x / 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) :: t_1
real(8) :: tmp
t_1 = x / (t * -z)
if (z <= (-2.2d+158)) then
tmp = t_1
else if (z <= (-1.45d+153)) then
tmp = x / y
else if (z <= (-2.1d+136)) then
tmp = t_1
else if ((z <= (-1.1d+102)) .or. (.not. (z <= (-7.6d+29))) .and. (z <= 8d-156)) then
tmp = x / y
else
tmp = (x / t) / -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = x / (t * -z);
double tmp;
if (z <= -2.2e+158) {
tmp = t_1;
} else if (z <= -1.45e+153) {
tmp = x / y;
} else if (z <= -2.1e+136) {
tmp = t_1;
} else if ((z <= -1.1e+102) || (!(z <= -7.6e+29) && (z <= 8e-156))) {
tmp = x / y;
} else {
tmp = (x / t) / -z;
}
return tmp;
}
def code(x, y, z, t): t_1 = x / (t * -z) tmp = 0 if z <= -2.2e+158: tmp = t_1 elif z <= -1.45e+153: tmp = x / y elif z <= -2.1e+136: tmp = t_1 elif (z <= -1.1e+102) or (not (z <= -7.6e+29) and (z <= 8e-156)): tmp = x / y else: tmp = (x / t) / -z return tmp
function code(x, y, z, t) t_1 = Float64(x / Float64(t * Float64(-z))) tmp = 0.0 if (z <= -2.2e+158) tmp = t_1; elseif (z <= -1.45e+153) tmp = Float64(x / y); elseif (z <= -2.1e+136) tmp = t_1; elseif ((z <= -1.1e+102) || (!(z <= -7.6e+29) && (z <= 8e-156))) tmp = Float64(x / y); else tmp = Float64(Float64(x / t) / Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x / (t * -z); tmp = 0.0; if (z <= -2.2e+158) tmp = t_1; elseif (z <= -1.45e+153) tmp = x / y; elseif (z <= -2.1e+136) tmp = t_1; elseif ((z <= -1.1e+102) || (~((z <= -7.6e+29)) && (z <= 8e-156))) tmp = x / y; else tmp = (x / t) / -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x / N[(t * (-z)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.2e+158], t$95$1, If[LessEqual[z, -1.45e+153], N[(x / y), $MachinePrecision], If[LessEqual[z, -2.1e+136], t$95$1, If[Or[LessEqual[z, -1.1e+102], And[N[Not[LessEqual[z, -7.6e+29]], $MachinePrecision], LessEqual[z, 8e-156]]], N[(x / y), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t \cdot \left(-z\right)}\\
\mathbf{if}\;z \leq -2.2 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+153}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{+136}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{+102} \lor \neg \left(z \leq -7.6 \cdot 10^{+29}\right) \land z \leq 8 \cdot 10^{-156}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{-z}\\
\end{array}
\end{array}
if z < -2.2000000000000001e158 or -1.45000000000000001e153 < z < -2.0999999999999999e136Initial program 96.7%
Taylor expanded in y around 0 79.1%
associate-*r/79.1%
neg-mul-179.1%
Simplified79.1%
if -2.2000000000000001e158 < z < -1.45000000000000001e153 or -2.0999999999999999e136 < z < -1.10000000000000004e102 or -7.59999999999999942e29 < z < 8.00000000000000032e-156Initial program 99.9%
Taylor expanded in y around inf 77.5%
if -1.10000000000000004e102 < z < -7.59999999999999942e29 or 8.00000000000000032e-156 < z Initial program 96.4%
Taylor expanded in y around 0 60.8%
associate-*r/60.8%
neg-mul-160.8%
Simplified60.8%
distribute-frac-neg60.8%
*-commutative60.8%
associate-/l/61.2%
Applied egg-rr61.2%
Final simplification70.7%
(FPCore (x y z t)
:precision binary64
(if (<= z -7.8e+158)
(* x (/ (/ -1.0 z) t))
(if (<= z -1.45e+153)
(/ x y)
(if (<= z -1.95e+136)
(/ (/ x (- z)) t)
(if (or (<= z -2.15e+96) (and (not (<= z -1.05e+31)) (<= z 8e-156)))
(/ x y)
(/ (/ x t) (- z)))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e+158) {
tmp = x * ((-1.0 / z) / t);
} else if (z <= -1.45e+153) {
tmp = x / y;
} else if (z <= -1.95e+136) {
tmp = (x / -z) / t;
} else if ((z <= -2.15e+96) || (!(z <= -1.05e+31) && (z <= 8e-156))) {
tmp = x / y;
} else {
tmp = (x / 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 <= (-7.8d+158)) then
tmp = x * (((-1.0d0) / z) / t)
else if (z <= (-1.45d+153)) then
tmp = x / y
else if (z <= (-1.95d+136)) then
tmp = (x / -z) / t
else if ((z <= (-2.15d+96)) .or. (.not. (z <= (-1.05d+31))) .and. (z <= 8d-156)) then
tmp = x / y
else
tmp = (x / t) / -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.8e+158) {
tmp = x * ((-1.0 / z) / t);
} else if (z <= -1.45e+153) {
tmp = x / y;
} else if (z <= -1.95e+136) {
tmp = (x / -z) / t;
} else if ((z <= -2.15e+96) || (!(z <= -1.05e+31) && (z <= 8e-156))) {
tmp = x / y;
} else {
tmp = (x / t) / -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.8e+158: tmp = x * ((-1.0 / z) / t) elif z <= -1.45e+153: tmp = x / y elif z <= -1.95e+136: tmp = (x / -z) / t elif (z <= -2.15e+96) or (not (z <= -1.05e+31) and (z <= 8e-156)): tmp = x / y else: tmp = (x / t) / -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.8e+158) tmp = Float64(x * Float64(Float64(-1.0 / z) / t)); elseif (z <= -1.45e+153) tmp = Float64(x / y); elseif (z <= -1.95e+136) tmp = Float64(Float64(x / Float64(-z)) / t); elseif ((z <= -2.15e+96) || (!(z <= -1.05e+31) && (z <= 8e-156))) tmp = Float64(x / y); else tmp = Float64(Float64(x / t) / Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.8e+158) tmp = x * ((-1.0 / z) / t); elseif (z <= -1.45e+153) tmp = x / y; elseif (z <= -1.95e+136) tmp = (x / -z) / t; elseif ((z <= -2.15e+96) || (~((z <= -1.05e+31)) && (z <= 8e-156))) tmp = x / y; else tmp = (x / t) / -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.8e+158], N[(x * N[(N[(-1.0 / z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.45e+153], N[(x / y), $MachinePrecision], If[LessEqual[z, -1.95e+136], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, -2.15e+96], And[N[Not[LessEqual[z, -1.05e+31]], $MachinePrecision], LessEqual[z, 8e-156]]], N[(x / y), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+158}:\\
\;\;\;\;x \cdot \frac{\frac{-1}{z}}{t}\\
\mathbf{elif}\;z \leq -1.45 \cdot 10^{+153}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\
\mathbf{elif}\;z \leq -2.15 \cdot 10^{+96} \lor \neg \left(z \leq -1.05 \cdot 10^{+31}\right) \land z \leq 8 \cdot 10^{-156}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{-z}\\
\end{array}
\end{array}
if z < -7.8e158Initial program 96.5%
Taylor expanded in t around inf 89.9%
div-inv89.8%
Applied egg-rr89.8%
Taylor expanded in t around inf 77.6%
metadata-eval77.6%
*-commutative77.6%
distribute-neg-frac77.6%
associate-/r*80.7%
distribute-neg-frac80.7%
distribute-neg-frac80.7%
metadata-eval80.7%
Simplified80.7%
if -7.8e158 < z < -1.45000000000000001e153 or -1.9500000000000001e136 < z < -2.15000000000000001e96 or -1.04999999999999989e31 < z < 8.00000000000000032e-156Initial program 99.9%
Taylor expanded in y around inf 77.5%
if -1.45000000000000001e153 < z < -1.9500000000000001e136Initial program 99.2%
Taylor expanded in t around inf 99.2%
div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in t around inf 99.2%
metadata-eval99.2%
*-commutative99.2%
distribute-neg-frac99.2%
associate-/r*99.2%
distribute-neg-frac99.2%
distribute-neg-frac99.2%
metadata-eval99.2%
Simplified99.2%
associate-*r/99.2%
frac-2neg99.2%
metadata-eval99.2%
un-div-inv100.0%
Applied egg-rr100.0%
if -2.15000000000000001e96 < z < -1.04999999999999989e31 or 8.00000000000000032e-156 < z Initial program 96.4%
Taylor expanded in y around 0 60.8%
associate-*r/60.8%
neg-mul-160.8%
Simplified60.8%
distribute-frac-neg60.8%
*-commutative60.8%
associate-/l/61.2%
Applied egg-rr61.2%
Final simplification71.0%
(FPCore (x y z t)
:precision binary64
(if (<= z -2.6e+136)
(/ (/ x (- z)) t)
(if (or (<= z -2.5e+102) (and (not (<= z -2.05e+33)) (<= z 8e-156)))
(/ x y)
(/ (/ x t) (- z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.6e+136) {
tmp = (x / -z) / t;
} else if ((z <= -2.5e+102) || (!(z <= -2.05e+33) && (z <= 8e-156))) {
tmp = x / y;
} else {
tmp = (x / 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 <= (-2.6d+136)) then
tmp = (x / -z) / t
else if ((z <= (-2.5d+102)) .or. (.not. (z <= (-2.05d+33))) .and. (z <= 8d-156)) then
tmp = x / y
else
tmp = (x / t) / -z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.6e+136) {
tmp = (x / -z) / t;
} else if ((z <= -2.5e+102) || (!(z <= -2.05e+33) && (z <= 8e-156))) {
tmp = x / y;
} else {
tmp = (x / t) / -z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.6e+136: tmp = (x / -z) / t elif (z <= -2.5e+102) or (not (z <= -2.05e+33) and (z <= 8e-156)): tmp = x / y else: tmp = (x / t) / -z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.6e+136) tmp = Float64(Float64(x / Float64(-z)) / t); elseif ((z <= -2.5e+102) || (!(z <= -2.05e+33) && (z <= 8e-156))) tmp = Float64(x / y); else tmp = Float64(Float64(x / t) / Float64(-z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.6e+136) tmp = (x / -z) / t; elseif ((z <= -2.5e+102) || (~((z <= -2.05e+33)) && (z <= 8e-156))) tmp = x / y; else tmp = (x / t) / -z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.6e+136], N[(N[(x / (-z)), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, -2.5e+102], And[N[Not[LessEqual[z, -2.05e+33]], $MachinePrecision], LessEqual[z, 8e-156]]], N[(x / y), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+136}:\\
\;\;\;\;\frac{\frac{x}{-z}}{t}\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{+102} \lor \neg \left(z \leq -2.05 \cdot 10^{+33}\right) \land z \leq 8 \cdot 10^{-156}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{-z}\\
\end{array}
\end{array}
if z < -2.6000000000000001e136Initial program 96.8%
Taylor expanded in t around inf 87.9%
div-inv87.8%
Applied egg-rr87.8%
Taylor expanded in t around inf 76.6%
metadata-eval76.6%
*-commutative76.6%
distribute-neg-frac76.6%
associate-/r*79.4%
distribute-neg-frac79.4%
distribute-neg-frac79.4%
metadata-eval79.4%
Simplified79.4%
associate-*r/79.7%
frac-2neg79.7%
metadata-eval79.7%
un-div-inv79.6%
Applied egg-rr79.6%
if -2.6000000000000001e136 < z < -2.5e102 or -2.04999999999999997e33 < z < 8.00000000000000032e-156Initial program 99.9%
Taylor expanded in y around inf 77.3%
if -2.5e102 < z < -2.04999999999999997e33 or 8.00000000000000032e-156 < z Initial program 96.4%
Taylor expanded in y around 0 60.8%
associate-*r/60.8%
neg-mul-160.8%
Simplified60.8%
distribute-frac-neg60.8%
*-commutative60.8%
associate-/l/61.2%
Applied egg-rr61.2%
Final simplification70.7%
(FPCore (x y z t) :precision binary64 (if (<= y -155000.0) (/ 1.0 (/ y x)) (if (<= y 6.5e-104) (/ (/ x t) (- z)) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -155000.0) {
tmp = 1.0 / (y / x);
} else if (y <= 6.5e-104) {
tmp = (x / t) / -z;
} else {
tmp = x / y;
}
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 (y <= (-155000.0d0)) then
tmp = 1.0d0 / (y / x)
else if (y <= 6.5d-104) then
tmp = (x / t) / -z
else
tmp = x / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -155000.0) {
tmp = 1.0 / (y / x);
} else if (y <= 6.5e-104) {
tmp = (x / t) / -z;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -155000.0: tmp = 1.0 / (y / x) elif y <= 6.5e-104: tmp = (x / t) / -z else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -155000.0) tmp = Float64(1.0 / Float64(y / x)); elseif (y <= 6.5e-104) tmp = Float64(Float64(x / t) / Float64(-z)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -155000.0) tmp = 1.0 / (y / x); elseif (y <= 6.5e-104) tmp = (x / t) / -z; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -155000.0], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 6.5e-104], N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -155000:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 6.5 \cdot 10^{-104}:\\
\;\;\;\;\frac{\frac{x}{t}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < -155000Initial program 98.2%
Taylor expanded in t around inf 81.0%
div-inv80.8%
Applied egg-rr80.8%
Taylor expanded in t around 0 80.2%
un-div-inv80.6%
clear-num80.8%
Applied egg-rr80.8%
if -155000 < y < 6.49999999999999991e-104Initial program 97.0%
Taylor expanded in y around 0 74.4%
associate-*r/74.4%
neg-mul-174.4%
Simplified74.4%
distribute-frac-neg74.4%
*-commutative74.4%
associate-/l/72.4%
Applied egg-rr72.4%
if 6.49999999999999991e-104 < y Initial program 99.0%
Taylor expanded in y around inf 73.0%
Final simplification74.5%
(FPCore (x y z t) :precision binary64 (/ x y))
double code(double x, double y, double z, double t) {
return x / 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 / y
end function
public static double code(double x, double y, double z, double t) {
return x / y;
}
def code(x, y, z, t): return x / y
function code(x, y, z, t) return Float64(x / y) end
function tmp = code(x, y, z, t) tmp = x / y; end
code[x_, y_, z_, t_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y}
\end{array}
Initial program 98.0%
Taylor expanded in y around inf 56.9%
Final simplification56.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ 1.0 (- (/ y x) (* (/ z x) t)))))
(if (< x -1.618195973607049e+50)
t_1
(if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = 1.0 / ((y / x) - ((z / x) * t));
double tmp;
if (x < -1.618195973607049e+50) {
tmp = t_1;
} else if (x < 2.1378306434876444e+131) {
tmp = x / (y - (z * t));
} 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) :: tmp
t_1 = 1.0d0 / ((y / x) - ((z / x) * t))
if (x < (-1.618195973607049d+50)) then
tmp = t_1
else if (x < 2.1378306434876444d+131) then
tmp = x / (y - (z * t))
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 = 1.0 / ((y / x) - ((z / x) * t));
double tmp;
if (x < -1.618195973607049e+50) {
tmp = t_1;
} else if (x < 2.1378306434876444e+131) {
tmp = x / (y - (z * t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = 1.0 / ((y / x) - ((z / x) * t)) tmp = 0 if x < -1.618195973607049e+50: tmp = t_1 elif x < 2.1378306434876444e+131: tmp = x / (y - (z * t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(1.0 / Float64(Float64(y / x) - Float64(Float64(z / x) * t))) tmp = 0.0 if (x < -1.618195973607049e+50) tmp = t_1; elseif (x < 2.1378306434876444e+131) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = 1.0 / ((y / x) - ((z / x) * t)); tmp = 0.0; if (x < -1.618195973607049e+50) tmp = t_1; elseif (x < 2.1378306434876444e+131) tmp = x / (y - (z * t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(1.0 / N[(N[(y / x), $MachinePrecision] - N[(N[(z / x), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[x, -1.618195973607049e+50], t$95$1, If[Less[x, 2.1378306434876444e+131], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{\frac{y}{x} - \frac{z}{x} \cdot t}\\
\mathbf{if}\;x < -1.618195973607049 \cdot 10^{+50}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x < 2.1378306434876444 \cdot 10^{+131}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024115
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(if (< x -1.618195973607049e+50) (/ 1.0 (- (/ y x) (* (/ z x) t))) (if (< x 2.1378306434876444e+131) (/ x (- y (* z t))) (/ 1.0 (- (/ y x) (* (/ z x) t)))))
(/ x (- y (* z t))))