
(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}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= (* z t) (- INFINITY)) (/ -1.0 (* z (/ t x))) (if (<= (* z t) 1e+187) (/ x (- y (* z t))) (/ (/ x t) (- z)))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -((double) INFINITY)) {
tmp = -1.0 / (z * (t / x));
} else if ((z * t) <= 1e+187) {
tmp = x / (y - (z * t));
} else {
tmp = (x / t) / -z;
}
return tmp;
}
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -Double.POSITIVE_INFINITY) {
tmp = -1.0 / (z * (t / x));
} else if ((z * t) <= 1e+187) {
tmp = x / (y - (z * t));
} else {
tmp = (x / t) / -z;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (z * t) <= -math.inf: tmp = -1.0 / (z * (t / x)) elif (z * t) <= 1e+187: tmp = x / (y - (z * t)) else: tmp = (x / t) / -z return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= Float64(-Inf)) tmp = Float64(-1.0 / Float64(z * Float64(t / x))); elseif (Float64(z * t) <= 1e+187) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = Float64(Float64(x / t) / Float64(-z)); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z * t) <= -Inf)
tmp = -1.0 / (z * (t / x));
elseif ((z * t) <= 1e+187)
tmp = x / (y - (z * t));
else
tmp = (x / t) / -z;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(-1.0 / N[(z * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+187], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;\frac{-1}{z \cdot \frac{t}{x}}\\
\mathbf{elif}\;z \cdot t \leq 10^{+187}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{-z}\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0Initial program 60.9%
clear-num60.9%
associate-/r/60.9%
Applied egg-rr60.9%
Taylor expanded in y around 0 60.9%
mul-1-neg60.9%
associate-/r*99.6%
distribute-neg-frac299.6%
Simplified99.6%
associate-/l/60.9%
*-un-lft-identity60.9%
times-frac99.8%
add-sqr-sqrt63.0%
sqrt-unprod70.1%
sqr-neg70.1%
sqrt-prod16.7%
add-sqr-sqrt60.3%
frac-2neg60.3%
metadata-eval60.3%
add-sqr-sqrt43.6%
sqrt-unprod70.4%
sqr-neg70.4%
sqrt-prod36.5%
add-sqr-sqrt99.8%
times-frac60.9%
*-commutative60.9%
times-frac99.7%
Applied egg-rr99.7%
*-commutative99.7%
clear-num99.5%
frac-times99.7%
metadata-eval99.7%
associate-/r/99.5%
div-inv99.5%
clear-num99.6%
Applied egg-rr99.6%
if -inf.0 < (*.f64 z t) < 9.99999999999999907e186Initial program 99.9%
if 9.99999999999999907e186 < (*.f64 z t) Initial program 77.0%
clear-num77.0%
associate-/r/77.1%
Applied egg-rr77.1%
Taylor expanded in y around 0 77.0%
mul-1-neg77.0%
associate-/r*99.8%
distribute-neg-frac299.8%
Simplified99.8%
Final simplification99.9%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -1.8e-15) (/ (/ x t) (- z)) (if (<= t 1.2e+113) (/ x y) (/ -1.0 (* z (/ t x))))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.8e-15) {
tmp = (x / t) / -z;
} else if (t <= 1.2e+113) {
tmp = x / y;
} else {
tmp = -1.0 / (z * (t / x));
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 (t <= (-1.8d-15)) then
tmp = (x / t) / -z
else if (t <= 1.2d+113) then
tmp = x / y
else
tmp = (-1.0d0) / (z * (t / x))
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.8e-15) {
tmp = (x / t) / -z;
} else if (t <= 1.2e+113) {
tmp = x / y;
} else {
tmp = -1.0 / (z * (t / x));
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if t <= -1.8e-15: tmp = (x / t) / -z elif t <= 1.2e+113: tmp = x / y else: tmp = -1.0 / (z * (t / x)) return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -1.8e-15) tmp = Float64(Float64(x / t) / Float64(-z)); elseif (t <= 1.2e+113) tmp = Float64(x / y); else tmp = Float64(-1.0 / Float64(z * Float64(t / x))); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -1.8e-15)
tmp = (x / t) / -z;
elseif (t <= 1.2e+113)
tmp = x / y;
else
tmp = -1.0 / (z * (t / x));
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -1.8e-15], N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[t, 1.2e+113], N[(x / y), $MachinePrecision], N[(-1.0 / N[(z * N[(t / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.8 \cdot 10^{-15}:\\
\;\;\;\;\frac{\frac{x}{t}}{-z}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+113}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-1}{z \cdot \frac{t}{x}}\\
\end{array}
\end{array}
if t < -1.8000000000000001e-15Initial program 89.6%
clear-num89.6%
associate-/r/89.4%
Applied egg-rr89.4%
Taylor expanded in y around 0 56.5%
mul-1-neg56.5%
associate-/r*68.2%
distribute-neg-frac268.2%
Simplified68.2%
if -1.8000000000000001e-15 < t < 1.19999999999999992e113Initial program 99.2%
Taylor expanded in y around inf 69.8%
if 1.19999999999999992e113 < t Initial program 86.3%
clear-num86.2%
associate-/r/86.3%
Applied egg-rr86.3%
Taylor expanded in y around 0 69.9%
mul-1-neg69.9%
associate-/r*80.5%
distribute-neg-frac280.5%
Simplified80.5%
associate-/l/69.9%
*-un-lft-identity69.9%
times-frac80.5%
add-sqr-sqrt46.9%
sqrt-unprod50.4%
sqr-neg50.4%
sqrt-prod11.4%
add-sqr-sqrt33.8%
frac-2neg33.8%
metadata-eval33.8%
add-sqr-sqrt22.4%
sqrt-unprod45.8%
sqr-neg45.8%
sqrt-prod33.4%
add-sqr-sqrt80.5%
times-frac69.9%
*-commutative69.9%
times-frac73.4%
Applied egg-rr73.4%
*-commutative73.4%
clear-num73.3%
frac-times75.1%
metadata-eval75.1%
associate-/r/80.4%
div-inv80.5%
clear-num80.3%
Applied egg-rr80.3%
Final simplification71.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= t -3.3e-15) (not (<= t 1.1e+113))) (/ (/ x t) (- z)) (/ x y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e-15) || !(t <= 1.1e+113)) {
tmp = (x / t) / -z;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 ((t <= (-3.3d-15)) .or. (.not. (t <= 1.1d+113))) then
tmp = (x / t) / -z
else
tmp = x / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -3.3e-15) || !(t <= 1.1e+113)) {
tmp = (x / t) / -z;
} else {
tmp = x / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if (t <= -3.3e-15) or not (t <= 1.1e+113): tmp = (x / t) / -z else: tmp = x / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -3.3e-15) || !(t <= 1.1e+113)) tmp = Float64(Float64(x / t) / Float64(-z)); else tmp = Float64(x / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -3.3e-15) || ~((t <= 1.1e+113)))
tmp = (x / t) / -z;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -3.3e-15], N[Not[LessEqual[t, 1.1e+113]], $MachinePrecision]], N[(N[(x / t), $MachinePrecision] / (-z)), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.3 \cdot 10^{-15} \lor \neg \left(t \leq 1.1 \cdot 10^{+113}\right):\\
\;\;\;\;\frac{\frac{x}{t}}{-z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if t < -3.3e-15 or 1.10000000000000005e113 < t Initial program 88.2%
clear-num88.1%
associate-/r/88.1%
Applied egg-rr88.1%
Taylor expanded in y around 0 62.2%
mul-1-neg62.2%
associate-/r*73.5%
distribute-neg-frac273.5%
Simplified73.5%
if -3.3e-15 < t < 1.10000000000000005e113Initial program 99.2%
Taylor expanded in y around inf 69.8%
Final simplification71.4%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -9.5e-28) (/ 1.0 (/ y x)) (if (<= y 9e-23) (/ x (* t (- z))) (/ x y))))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e-28) {
tmp = 1.0 / (y / x);
} else if (y <= 9e-23) {
tmp = x / (t * -z);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-9.5d-28)) then
tmp = 1.0d0 / (y / x)
else if (y <= 9d-23) then
tmp = x / (t * -z)
else
tmp = x / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -9.5e-28) {
tmp = 1.0 / (y / x);
} else if (y <= 9e-23) {
tmp = x / (t * -z);
} else {
tmp = x / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if y <= -9.5e-28: tmp = 1.0 / (y / x) elif y <= 9e-23: tmp = x / (t * -z) else: tmp = x / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -9.5e-28) tmp = Float64(1.0 / Float64(y / x)); elseif (y <= 9e-23) tmp = Float64(x / Float64(t * Float64(-z))); else tmp = Float64(x / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -9.5e-28)
tmp = 1.0 / (y / x);
elseif (y <= 9e-23)
tmp = x / (t * -z);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -9.5e-28], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 9e-23], N[(x / N[(t * (-z)), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9.5 \cdot 10^{-28}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-23}:\\
\;\;\;\;\frac{x}{t \cdot \left(-z\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < -9.50000000000000001e-28Initial program 93.2%
clear-num93.0%
associate-/r/92.9%
Applied egg-rr92.9%
Taylor expanded in y around inf 74.2%
associate-*l/74.4%
*-un-lft-identity74.4%
clear-num74.4%
Applied egg-rr74.4%
if -9.50000000000000001e-28 < y < 8.9999999999999995e-23Initial program 95.0%
Taylor expanded in y around 0 75.2%
associate-*r/75.2%
neg-mul-175.2%
Simplified75.2%
if 8.9999999999999995e-23 < y Initial program 94.7%
Taylor expanded in y around inf 80.9%
Final simplification76.6%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= z -1.4e+187) (/ x (* z t)) (/ x y)))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.4e+187) {
tmp = x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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 <= (-1.4d+187)) then
tmp = x / (z * t)
else
tmp = x / y
end if
code = tmp
end function
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.4e+187) {
tmp = x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): tmp = 0 if z <= -1.4e+187: tmp = x / (z * t) else: tmp = x / y return tmp
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) tmp = 0.0 if (z <= -1.4e+187) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / y); end return tmp end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (z <= -1.4e+187)
tmp = x / (z * t);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[z, -1.4e+187], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+187}:\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if z < -1.39999999999999995e187Initial program 86.5%
clear-num86.4%
associate-/r/86.5%
Applied egg-rr86.5%
Taylor expanded in y around 0 72.9%
associate-*l/72.9%
*-commutative72.9%
times-frac86.1%
metadata-eval86.1%
add-sqr-sqrt0.0%
sqrt-prod54.7%
sqr-neg54.7%
sqrt-unprod54.3%
add-sqr-sqrt54.3%
frac-2neg54.3%
add-sqr-sqrt0.0%
sqrt-prod54.7%
sqr-neg54.7%
sqrt-unprod86.1%
add-sqr-sqrt86.1%
times-frac72.9%
*-un-lft-identity72.9%
associate-/l/86.1%
add-sqr-sqrt86.1%
sqrt-unprod54.7%
sqr-neg54.7%
sqrt-prod0.0%
add-sqr-sqrt54.3%
Applied egg-rr54.3%
Taylor expanded in x around 0 54.9%
if -1.39999999999999995e187 < z Initial program 95.1%
Taylor expanded in y around inf 58.4%
Final simplification58.1%
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x y))
assert(x < y && y < z && z < t);
double code(double x, double y, double z, double t) {
return x / y;
}
NOTE: x, y, z, and t should be sorted in increasing order before calling this function.
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
assert x < y && y < z && z < t;
public static double code(double x, double y, double z, double t) {
return x / y;
}
[x, y, z, t] = sort([x, y, z, t]) def code(x, y, z, t): return x / y
x, y, z, t = sort([x, y, z, t]) function code(x, y, z, t) return Float64(x / y) end
x, y, z, t = num2cell(sort([x, y, z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / y;
end
NOTE: x, y, z, and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := N[(x / y), $MachinePrecision]
\begin{array}{l}
[x, y, z, t] = \mathsf{sort}([x, y, z, t])\\
\\
\frac{x}{y}
\end{array}
Initial program 94.4%
Taylor expanded in y around inf 55.1%
Final simplification55.1%
(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 2024076
(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))))