
(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 8 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 (if (<= (* z t) (- INFINITY)) (/ (/ -1.0 (/ z x)) t) (if (<= (* z t) 2e+242) (/ x (- y (* z t))) (/ (/ x (- t)) z))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -((double) INFINITY)) {
tmp = (-1.0 / (z / x)) / t;
} else if ((z * t) <= 2e+242) {
tmp = x / (y - (z * t));
} else {
tmp = (x / -t) / z;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z * t) <= -Double.POSITIVE_INFINITY) {
tmp = (-1.0 / (z / x)) / t;
} else if ((z * t) <= 2e+242) {
tmp = x / (y - (z * t));
} else {
tmp = (x / -t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -math.inf: tmp = (-1.0 / (z / x)) / t elif (z * t) <= 2e+242: tmp = x / (y - (z * t)) else: tmp = (x / -t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= Float64(-Inf)) tmp = Float64(Float64(-1.0 / Float64(z / x)) / t); elseif (Float64(z * t) <= 2e+242) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = Float64(Float64(x / Float64(-t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -Inf) tmp = (-1.0 / (z / x)) / t; elseif ((z * t) <= 2e+242) tmp = x / (y - (z * t)); else tmp = (x / -t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[N[(z * t), $MachinePrecision], (-Infinity)], N[(N[(-1.0 / N[(z / x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[N[(z * t), $MachinePrecision], 2e+242], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-t)), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;\frac{\frac{-1}{\frac{z}{x}}}{t}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+242}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{-t}}{z}\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0Initial program 71.0%
Taylor expanded in t around -inf 99.9%
Taylor expanded in z around inf 99.9%
clear-num100.0%
inv-pow100.0%
Applied egg-rr100.0%
unpow-1100.0%
Simplified100.0%
if -inf.0 < (*.f64 z t) < 2.0000000000000001e242Initial program 99.9%
if 2.0000000000000001e242 < (*.f64 z t) Initial program 59.2%
clear-num59.3%
inv-pow59.3%
Applied egg-rr59.3%
Taylor expanded in t around inf 94.7%
+-commutative94.7%
mul-1-neg94.7%
unsub-neg94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in t around inf 59.2%
neg-mul-159.2%
associate-/r*99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t)
:precision binary64
(if (<= t -2e-203)
(/ (/ x z) (- t))
(if (<= t 2.9e+59)
(/ x y)
(if (<= t 2.6e+160) (/ x (* z (- t))) (/ (/ x (- t)) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2e-203) {
tmp = (x / z) / -t;
} else if (t <= 2.9e+59) {
tmp = x / y;
} else if (t <= 2.6e+160) {
tmp = x / (z * -t);
} 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 (t <= (-2d-203)) then
tmp = (x / z) / -t
else if (t <= 2.9d+59) then
tmp = x / y
else if (t <= 2.6d+160) then
tmp = x / (z * -t)
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 (t <= -2e-203) {
tmp = (x / z) / -t;
} else if (t <= 2.9e+59) {
tmp = x / y;
} else if (t <= 2.6e+160) {
tmp = x / (z * -t);
} else {
tmp = (x / -t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2e-203: tmp = (x / z) / -t elif t <= 2.9e+59: tmp = x / y elif t <= 2.6e+160: tmp = x / (z * -t) else: tmp = (x / -t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2e-203) tmp = Float64(Float64(x / z) / Float64(-t)); elseif (t <= 2.9e+59) tmp = Float64(x / y); elseif (t <= 2.6e+160) tmp = Float64(x / Float64(z * Float64(-t))); else tmp = Float64(Float64(x / Float64(-t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2e-203) tmp = (x / z) / -t; elseif (t <= 2.9e+59) tmp = x / y; elseif (t <= 2.6e+160) tmp = x / (z * -t); else tmp = (x / -t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2e-203], N[(N[(x / z), $MachinePrecision] / (-t)), $MachinePrecision], If[LessEqual[t, 2.9e+59], N[(x / y), $MachinePrecision], If[LessEqual[t, 2.6e+160], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-t)), $MachinePrecision] / z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-203}:\\
\;\;\;\;\frac{\frac{x}{z}}{-t}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{+59}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{elif}\;t \leq 2.6 \cdot 10^{+160}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{-t}}{z}\\
\end{array}
\end{array}
if t < -2.0000000000000001e-203Initial program 95.5%
Taylor expanded in t around -inf 38.1%
Taylor expanded in z around inf 49.6%
mul-1-neg49.6%
distribute-neg-frac249.6%
Applied egg-rr49.6%
if -2.0000000000000001e-203 < t < 2.89999999999999991e59Initial program 99.0%
Taylor expanded in y around inf 71.1%
if 2.89999999999999991e59 < t < 2.6e160Initial program 92.2%
Taylor expanded in y around 0 73.3%
associate-*r/73.3%
neg-mul-173.3%
Simplified73.3%
if 2.6e160 < t Initial program 73.2%
clear-num73.0%
inv-pow73.0%
Applied egg-rr73.0%
Taylor expanded in t around inf 88.5%
+-commutative88.5%
mul-1-neg88.5%
unsub-neg88.5%
*-commutative88.5%
Simplified88.5%
Taylor expanded in t around inf 64.4%
neg-mul-164.4%
associate-/r*89.7%
distribute-frac-neg89.7%
distribute-neg-frac289.7%
Simplified89.7%
Final simplification64.7%
(FPCore (x y z t) :precision binary64 (if (<= (* z t) (- INFINITY)) (/ (/ x z) (- t)) (if (<= (* z t) 2e+242) (/ x (- y (* z t))) (/ (/ x (- t)) z))))
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) <= 2e+242) {
tmp = x / (y - (z * t));
} else {
tmp = (x / -t) / z;
}
return tmp;
}
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) <= 2e+242) {
tmp = x / (y - (z * t));
} else {
tmp = (x / -t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z * t) <= -math.inf: tmp = (x / z) / -t elif (z * t) <= 2e+242: tmp = x / (y - (z * t)) else: tmp = (x / -t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (Float64(z * t) <= Float64(-Inf)) tmp = Float64(Float64(x / z) / Float64(-t)); elseif (Float64(z * t) <= 2e+242) tmp = Float64(x / Float64(y - Float64(z * t))); else tmp = Float64(Float64(x / Float64(-t)) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z * t) <= -Inf) tmp = (x / z) / -t; elseif ((z * t) <= 2e+242) tmp = x / (y - (z * t)); else tmp = (x / -t) / z; end tmp_2 = tmp; end
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], 2e+242], N[(x / N[(y - N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x / (-t)), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \cdot t \leq -\infty:\\
\;\;\;\;\frac{\frac{x}{z}}{-t}\\
\mathbf{elif}\;z \cdot t \leq 2 \cdot 10^{+242}:\\
\;\;\;\;\frac{x}{y - z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{-t}}{z}\\
\end{array}
\end{array}
if (*.f64 z t) < -inf.0Initial program 71.0%
Taylor expanded in t around -inf 99.9%
Taylor expanded in z around inf 99.9%
mul-1-neg99.9%
distribute-neg-frac299.9%
Applied egg-rr99.9%
if -inf.0 < (*.f64 z t) < 2.0000000000000001e242Initial program 99.9%
if 2.0000000000000001e242 < (*.f64 z t) Initial program 59.2%
clear-num59.3%
inv-pow59.3%
Applied egg-rr59.3%
Taylor expanded in t around inf 94.7%
+-commutative94.7%
mul-1-neg94.7%
unsub-neg94.7%
*-commutative94.7%
Simplified94.7%
Taylor expanded in t around inf 59.2%
neg-mul-159.2%
associate-/r*99.9%
distribute-frac-neg99.9%
distribute-neg-frac299.9%
Simplified99.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2e-203) (not (<= t 8.8e+59))) (/ (/ x z) (- t)) (/ x y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2e-203) || !(t <= 8.8e+59)) {
tmp = (x / z) / -t;
} 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 ((t <= (-2d-203)) .or. (.not. (t <= 8.8d+59))) then
tmp = (x / z) / -t
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 ((t <= -2e-203) || !(t <= 8.8e+59)) {
tmp = (x / z) / -t;
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2e-203) or not (t <= 8.8e+59): tmp = (x / z) / -t else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2e-203) || !(t <= 8.8e+59)) tmp = Float64(Float64(x / z) / Float64(-t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2e-203) || ~((t <= 8.8e+59))) tmp = (x / z) / -t; else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2e-203], N[Not[LessEqual[t, 8.8e+59]], $MachinePrecision]], N[(N[(x / z), $MachinePrecision] / (-t)), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2 \cdot 10^{-203} \lor \neg \left(t \leq 8.8 \cdot 10^{+59}\right):\\
\;\;\;\;\frac{\frac{x}{z}}{-t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if t < -2.0000000000000001e-203 or 8.7999999999999998e59 < t Initial program 90.9%
Taylor expanded in t around -inf 46.8%
Taylor expanded in z around inf 59.8%
mul-1-neg59.8%
distribute-neg-frac259.8%
Applied egg-rr59.8%
if -2.0000000000000001e-203 < t < 8.7999999999999998e59Initial program 99.0%
Taylor expanded in y around inf 71.1%
Final simplification64.1%
(FPCore (x y z t) :precision binary64 (if (<= y -3.9e-11) (/ 1.0 (/ y x)) (if (<= y 4.4e-34) (/ x (* z (- t))) (/ x y))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -3.9e-11) {
tmp = 1.0 / (y / x);
} else if (y <= 4.4e-34) {
tmp = x / (z * -t);
} 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 <= (-3.9d-11)) then
tmp = 1.0d0 / (y / x)
else if (y <= 4.4d-34) then
tmp = x / (z * -t)
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 <= -3.9e-11) {
tmp = 1.0 / (y / x);
} else if (y <= 4.4e-34) {
tmp = x / (z * -t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -3.9e-11: tmp = 1.0 / (y / x) elif y <= 4.4e-34: tmp = x / (z * -t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -3.9e-11) tmp = Float64(1.0 / Float64(y / x)); elseif (y <= 4.4e-34) tmp = Float64(x / Float64(z * Float64(-t))); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -3.9e-11) tmp = 1.0 / (y / x); elseif (y <= 4.4e-34) tmp = x / (z * -t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -3.9e-11], N[(1.0 / N[(y / x), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.4e-34], N[(x / N[(z * (-t)), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.9 \cdot 10^{-11}:\\
\;\;\;\;\frac{1}{\frac{y}{x}}\\
\mathbf{elif}\;y \leq 4.4 \cdot 10^{-34}:\\
\;\;\;\;\frac{x}{z \cdot \left(-t\right)}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if y < -3.9000000000000001e-11Initial program 93.7%
Taylor expanded in y around inf 75.7%
clear-num76.9%
inv-pow76.9%
Applied egg-rr76.9%
unpow-176.9%
Simplified76.9%
if -3.9000000000000001e-11 < y < 4.3999999999999998e-34Initial program 94.3%
Taylor expanded in y around 0 69.9%
associate-*r/69.9%
neg-mul-169.9%
Simplified69.9%
if 4.3999999999999998e-34 < y Initial program 93.7%
Taylor expanded in y around inf 79.2%
Final simplification74.3%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2300000000000.0) (not (<= t 2.4e+240))) (/ x (* z t)) (/ x y)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2300000000000.0) || !(t <= 2.4e+240)) {
tmp = x / (z * t);
} 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 ((t <= (-2300000000000.0d0)) .or. (.not. (t <= 2.4d+240))) then
tmp = x / (z * t)
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 ((t <= -2300000000000.0) || !(t <= 2.4e+240)) {
tmp = x / (z * t);
} else {
tmp = x / y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2300000000000.0) or not (t <= 2.4e+240): tmp = x / (z * t) else: tmp = x / y return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2300000000000.0) || !(t <= 2.4e+240)) tmp = Float64(x / Float64(z * t)); else tmp = Float64(x / y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -2300000000000.0) || ~((t <= 2.4e+240))) tmp = x / (z * t); else tmp = x / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2300000000000.0], N[Not[LessEqual[t, 2.4e+240]], $MachinePrecision]], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], N[(x / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2300000000000 \lor \neg \left(t \leq 2.4 \cdot 10^{+240}\right):\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y}\\
\end{array}
\end{array}
if t < -2.3e12 or 2.3999999999999999e240 < t Initial program 90.3%
Taylor expanded in y around 0 59.4%
associate-*r/59.4%
neg-mul-159.4%
Simplified59.4%
neg-sub059.4%
sub-neg59.4%
add-sqr-sqrt33.3%
sqrt-unprod44.8%
sqr-neg44.8%
sqrt-unprod14.2%
add-sqr-sqrt38.7%
Applied egg-rr38.7%
+-lft-identity38.7%
Simplified38.7%
if -2.3e12 < t < 2.3999999999999999e240Initial program 95.5%
Taylor expanded in y around inf 60.8%
Final simplification54.2%
(FPCore (x y z t) :precision binary64 (if (<= t -2300000000000.0) (/ x (* z t)) (if (<= t 1e+108) (/ x y) (/ (/ x t) z))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2300000000000.0) {
tmp = x / (z * t);
} else if (t <= 1e+108) {
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 (t <= (-2300000000000.0d0)) then
tmp = x / (z * t)
else if (t <= 1d+108) 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 (t <= -2300000000000.0) {
tmp = x / (z * t);
} else if (t <= 1e+108) {
tmp = x / y;
} else {
tmp = (x / t) / z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2300000000000.0: tmp = x / (z * t) elif t <= 1e+108: tmp = x / y else: tmp = (x / t) / z return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2300000000000.0) tmp = Float64(x / Float64(z * t)); elseif (t <= 1e+108) tmp = Float64(x / y); else tmp = Float64(Float64(x / t) / z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2300000000000.0) tmp = x / (z * t); elseif (t <= 1e+108) tmp = x / y; else tmp = (x / t) / z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2300000000000.0], N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1e+108], N[(x / y), $MachinePrecision], N[(N[(x / t), $MachinePrecision] / z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2300000000000:\\
\;\;\;\;\frac{x}{z \cdot t}\\
\mathbf{elif}\;t \leq 10^{+108}:\\
\;\;\;\;\frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{t}}{z}\\
\end{array}
\end{array}
if t < -2.3e12Initial program 92.3%
Taylor expanded in y around 0 55.8%
associate-*r/55.8%
neg-mul-155.8%
Simplified55.8%
neg-sub055.8%
sub-neg55.8%
add-sqr-sqrt32.8%
sqrt-unprod41.7%
sqr-neg41.7%
sqrt-unprod9.7%
add-sqr-sqrt34.6%
Applied egg-rr34.6%
+-lft-identity34.6%
Simplified34.6%
if -2.3e12 < t < 1e108Initial program 99.3%
Taylor expanded in y around inf 68.1%
if 1e108 < t Initial program 76.4%
Taylor expanded in t around -inf 66.0%
Taylor expanded in z around inf 84.3%
mul-1-neg84.3%
associate-/l/67.9%
distribute-frac-neg67.9%
associate-/r*85.7%
add-sqr-sqrt41.3%
sqrt-unprod47.7%
sqr-neg47.7%
sqrt-unprod20.6%
add-sqr-sqrt36.4%
Applied egg-rr36.4%
Final simplification55.1%
(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 94.0%
Taylor expanded in y around inf 54.2%
(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 2024133
(FPCore (x y z t)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, B"
:precision binary64
:alt
(! :herbie-platform default (if (< x -161819597360704900000000000000000000000000000000000) (/ 1 (- (/ y x) (* (/ z x) t))) (if (< x 213783064348764440000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (/ x (- y (* z t))) (/ 1 (- (/ y x) (* (/ z x) t))))))
(/ x (- y (* z t))))