
(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 7 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: z and t should be sorted in increasing order before calling this function.
(FPCore (x y z t)
:precision binary64
(if (<= (* z t) (- INFINITY))
(/ (/ (- x) z) t)
(if (<= (* z t) 1e+277)
(/ x (- y (* z t)))
(/ 1.0 (/ z (* x (/ -1.0 t)))))))assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -((double) INFINITY)) {
tmp = (-x / z) / t;
} else if ((z * t) <= 1e+277) {
tmp = x / (y - (z * t));
} else {
tmp = 1.0 / (z / (x * (-1.0 / t)));
}
return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -Double.POSITIVE_INFINITY) {
tmp = (-x / z) / t;
} else if ((z * t) <= 1e+277) {
tmp = x / (y - (z * t));
} else {
tmp = 1.0 / (z / (x * (-1.0 / t)));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (z * t) <= -math.inf: tmp = (-x / z) / t elif (z * t) <= 1e+277: tmp = x / (y - (z * t)) else: tmp = 1.0 / (z / (x * (-1.0 / t))) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= Float64(-Inf)) tmp = Float64(Float64(Float64(-x) / z) / t); elseif (Float64(z * t) <= 1e+277) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = Float64(1.0 / Float64(z / Float64(x * Float64(-1.0 / t)))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((z * t) <= -Inf)
tmp = (-x / z) / t;
elseif ((z * t) <= 1e+277)
tmp = x / (y - (z * t));
else
tmp = 1.0 / (z / (x * (-1.0 / t)));
end
tmp_2 = tmp;
end
NOTE: 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[(N[((-x) / z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 1e+277], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(1.0 / N[(z / N[(x * N[(-1.0 / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;\frac{\frac{-x}{z}}{t}\\
\mathbf{elif}\;z \cdot t \leq 10^{+277}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{1}{\frac{z}{x \cdot \frac{-1}{t}}}\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0Initial program 71.7%
clear-num71.7%
inv-pow71.7%
Applied egg-rr71.7%
Taylor expanded in y around 0 71.7%
mul-1-neg71.7%
associate-/l*99.8%
distribute-neg-frac99.8%
Simplified99.8%
unpow-199.8%
clear-num99.8%
frac-2neg99.8%
distribute-neg-frac99.8%
remove-double-neg99.8%
Applied egg-rr99.8%
if -inf.0 < (*.f64 z t) < 1e277Initial program 99.9%
if 1e277 < (*.f64 z t) Initial program 63.8%
clear-num63.8%
associate-/r/63.8%
Applied egg-rr63.8%
Taylor expanded in y around 0 63.8%
associate-/r*68.0%
Simplified68.0%
associate-*l/99.8%
clear-num99.9%
Applied egg-rr99.9%
Final simplification99.9%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= (* z t) (- INFINITY)) (not (<= (* z t) 1e+257))) (/ (/ (- x) z) t) (/ x (- y (* z t)))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (((z * t) <= -((double) INFINITY)) || !((z * t) <= 1e+257)) {
tmp = (-x / z) / t;
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (((z * t) <= -Double.POSITIVE_INFINITY) || !((z * t) <= 1e+257)) {
tmp = (-x / z) / t;
} else {
tmp = x / (y - (z * t));
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if ((z * t) <= -math.inf) or not ((z * t) <= 1e+257): tmp = (-x / z) / t else: tmp = x / (y - (z * t)) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((Float64(z * t) <= Float64(-Inf)) || !(Float64(z * t) <= 1e+257)) tmp = Float64(Float64(Float64(-x) / z) / t); else tmp = Float64(x / Float64(y - Float64(z * t))); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (((z * t) <= -Inf) || ~(((z * t) <= 1e+257)))
tmp = (-x / z) / t;
else
tmp = x / (y - (z * t));
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[Not[LessEqual[N[(z * t), $MachinePrecision], 1e+257]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] / t), $MachinePrecision], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty \lor \neg \left(z \cdot t \leq 10^{+257}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0 or 1.00000000000000003e257 < (*.f64 z t) Initial program 69.2%
clear-num69.2%
inv-pow69.2%
Applied egg-rr69.2%
Taylor expanded in y around 0 69.2%
mul-1-neg69.2%
associate-/l*99.8%
distribute-neg-frac99.8%
Simplified99.8%
unpow-199.8%
clear-num99.9%
frac-2neg99.9%
distribute-neg-frac99.9%
remove-double-neg99.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 z t) < 1.00000000000000003e257Initial program 99.9%
Final simplification99.9%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= t -7.2e-214) (not (<= t 6e+78))) (/ (/ (- x) z) t) (/ x y)))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.2e-214) || !(t <= 6e+78)) {
tmp = (-x / z) / t;
} else {
tmp = x / y;
}
return tmp;
}
NOTE: 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 <= (-7.2d-214)) .or. (.not. (t <= 6d+78))) then
tmp = (-x / z) / t
else
tmp = x / y
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -7.2e-214) || !(t <= 6e+78)) {
tmp = (-x / z) / t;
} else {
tmp = x / y;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (t <= -7.2e-214) or not (t <= 6e+78): tmp = (-x / z) / t else: tmp = x / y return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -7.2e-214) || !(t <= 6e+78)) tmp = Float64(Float64(Float64(-x) / z) / t); else tmp = Float64(x / y); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -7.2e-214) || ~((t <= 6e+78)))
tmp = (-x / z) / t;
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -7.2e-214], N[Not[LessEqual[t, 6e+78]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] / t), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.2 \cdot 10^{-214} \lor \neg \left(t \leq 6 \cdot 10^{+78}\right):\\
\;\;\;\;\frac{\frac{-x}{z}}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if t < -7.2e-214 or 5.99999999999999964e78 < t Initial program 92.3%
clear-num91.5%
inv-pow91.5%
Applied egg-rr91.5%
Taylor expanded in y around 0 61.6%
mul-1-neg61.6%
associate-/l*67.9%
distribute-neg-frac67.9%
Simplified67.9%
unpow-167.9%
clear-num68.5%
frac-2neg68.5%
distribute-neg-frac68.5%
remove-double-neg68.5%
Applied egg-rr68.5%
if -7.2e-214 < t < 5.99999999999999964e78Initial program 98.9%
Taylor expanded in y around inf 71.5%
Final simplification69.6%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= y -7.5e+17) (/ x y) (if (<= y 7.5e-61) (/ (- x) (* z t)) (/ x y))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+17) {
tmp = x / y;
} else if (y <= 7.5e-61) {
tmp = -x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: 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 <= (-7.5d+17)) then
tmp = x / y
else if (y <= 7.5d-61) then
tmp = -x / (z * t)
else
tmp = x / y
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -7.5e+17) {
tmp = x / y;
} else if (y <= 7.5e-61) {
tmp = -x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if y <= -7.5e+17: tmp = x / y elif y <= 7.5e-61: tmp = -x / (z * t) else: tmp = x / y return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (y <= -7.5e+17) tmp = Float64(x / y); elseif (y <= 7.5e-61) tmp = Float64(Float64(-x) / Float64(z * t)); else tmp = Float64(x / y); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (y <= -7.5e+17)
tmp = x / y;
elseif (y <= 7.5e-61)
tmp = -x / (z * t);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[y, -7.5e+17], N[(x / y), $MachinePrecision], If[LessEqual[y, 7.5e-61], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq -7.5 \cdot 10^{+17}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;y \leq 7.5 \cdot 10^{-61}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < -7.5e17 or 7.50000000000000047e-61 < y Initial program 95.6%
Taylor expanded in y around inf 77.9%
if -7.5e17 < y < 7.50000000000000047e-61Initial program 93.9%
Taylor expanded in y around 0 75.9%
associate-*r/75.9%
neg-mul-175.9%
Simplified75.9%
Final simplification76.9%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (<= t -7.8e-96) (/ (/ (- x) t) z) (if (<= t 2.15e+77) (/ x y) (/ (- x) (* z t)))))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.8e-96) {
tmp = (-x / t) / z;
} else if (t <= 2.15e+77) {
tmp = x / y;
} else {
tmp = -x / (z * t);
}
return tmp;
}
NOTE: 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 <= (-7.8d-96)) then
tmp = (-x / t) / z
else if (t <= 2.15d+77) then
tmp = x / y
else
tmp = -x / (z * t)
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -7.8e-96) {
tmp = (-x / t) / z;
} else if (t <= 2.15e+77) {
tmp = x / y;
} else {
tmp = -x / (z * t);
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if t <= -7.8e-96: tmp = (-x / t) / z elif t <= 2.15e+77: tmp = x / y else: tmp = -x / (z * t) return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if (t <= -7.8e-96) tmp = Float64(Float64(Float64(-x) / t) / z); elseif (t <= 2.15e+77) tmp = Float64(x / y); else tmp = Float64(Float64(-x) / Float64(z * t)); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if (t <= -7.8e-96)
tmp = (-x / t) / z;
elseif (t <= 2.15e+77)
tmp = x / y;
else
tmp = -x / (z * t);
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[LessEqual[t, -7.8e-96], N[(N[((-x) / t), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[t, 2.15e+77], N[(x / y), $MachinePrecision], N[((-x) / N[(z * t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.8 \cdot 10^{-96}:\\
\;\;\;\;\frac{\frac{-x}{t}}{z}\\
\mathbf{elif}\;t \leq 2.15 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{z \cdot t}\\
\end{array}
\end{array}
if t < -7.7999999999999997e-96Initial program 94.6%
clear-num93.3%
associate-/r/94.4%
Applied egg-rr94.4%
Taylor expanded in y around 0 61.0%
associate-/r*60.9%
Simplified60.9%
associate-*l/66.8%
Applied egg-rr66.8%
associate-*l/66.9%
neg-mul-166.9%
Applied egg-rr66.9%
if -7.7999999999999997e-96 < t < 2.14999999999999996e77Initial program 99.1%
Taylor expanded in y around inf 70.2%
if 2.14999999999999996e77 < t Initial program 84.7%
Taylor expanded in y around 0 69.2%
associate-*r/69.2%
neg-mul-169.2%
Simplified69.2%
Final simplification68.8%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (if (or (<= t -4.9e+24) (not (<= t 6.5e+216))) (/ x (* z t)) (/ x y)))
assert(z < t);
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.9e+24) || !(t <= 6.5e+216)) {
tmp = x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
NOTE: 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 <= (-4.9d+24)) .or. (.not. (t <= 6.5d+216))) then
tmp = x / (z * t)
else
tmp = x / y
end if
code = tmp
end function
assert z < t;
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.9e+24) || !(t <= 6.5e+216)) {
tmp = x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
[z, t] = sort([z, t]) def code(x, y, z, t): tmp = 0 if (t <= -4.9e+24) or not (t <= 6.5e+216): tmp = x / (z * t) else: tmp = x / y return tmp
z, t = sort([z, t]) function code(x, y, z, t) tmp = 0.0 if ((t <= -4.9e+24) || !(t <= 6.5e+216)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / y); end return tmp end
z, t = num2cell(sort([z, t])){:}
function tmp_2 = code(x, y, z, t)
tmp = 0.0;
if ((t <= -4.9e+24) || ~((t <= 6.5e+216)))
tmp = x / (z * t);
else
tmp = x / y;
end
tmp_2 = tmp;
end
NOTE: z and t should be sorted in increasing order before calling this function. code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.9e+24], N[Not[LessEqual[t, 6.5e+216]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
[z, t] = \mathsf{sort}([z, t])\\
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.9 \cdot 10^{+24} \lor \neg \left(t \leq 6.5 \cdot 10^{+216}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if t < -4.90000000000000029e24 or 6.50000000000000029e216 < t Initial program 91.7%
clear-num90.2%
associate-/r/91.6%
Applied egg-rr91.6%
Taylor expanded in y around 0 70.6%
associate-/r*70.5%
Simplified70.5%
associate-*l/74.9%
Applied egg-rr74.9%
expm1-log1p-u70.3%
expm1-udef44.9%
*-commutative44.9%
frac-2neg44.9%
metadata-eval44.9%
un-div-inv44.9%
add-sqr-sqrt36.9%
sqrt-unprod42.9%
sqr-neg42.9%
sqrt-unprod6.8%
add-sqr-sqrt39.4%
Applied egg-rr39.4%
expm1-def39.0%
expm1-log1p39.3%
associate-/r*36.3%
Simplified36.3%
if -4.90000000000000029e24 < t < 6.50000000000000029e216Initial program 96.1%
Taylor expanded in y around inf 60.4%
Final simplification52.7%
NOTE: z and t should be sorted in increasing order before calling this function. (FPCore (x y z t) :precision binary64 (/ x y))
assert(z < t);
double code(double x, double y, double z, double t) {
return x / y;
}
NOTE: 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 z < t;
public static double code(double x, double y, double z, double t) {
return x / y;
}
[z, t] = sort([z, t]) def code(x, y, z, t): return x / y
z, t = sort([z, t]) function code(x, y, z, t) return Float64(x / y) end
z, t = num2cell(sort([z, t])){:}
function tmp = code(x, y, z, t)
tmp = x / y;
end
NOTE: 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}
[z, t] = \mathsf{sort}([z, t])\\
\\
\frac{x}{y}
\end{array}
Initial program 94.7%
Taylor expanded in y around inf 50.6%
Final simplification50.6%
(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 2023185
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:herbie-target
(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))))