
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* a z) t)))
(if (<= a -3.9e+146)
(/ (- y (/ x z)) a)
(if (<= a 1.5e+65)
(- (/ y (/ t_1 z)) (/ x t_1))
(+ (/ y a) (/ -1.0 (/ t_1 x)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * z) - t;
double tmp;
if (a <= -3.9e+146) {
tmp = (y - (x / z)) / a;
} else if (a <= 1.5e+65) {
tmp = (y / (t_1 / z)) - (x / t_1);
} else {
tmp = (y / a) + (-1.0 / (t_1 / x));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (a * z) - t
if (a <= (-3.9d+146)) then
tmp = (y - (x / z)) / a
else if (a <= 1.5d+65) then
tmp = (y / (t_1 / z)) - (x / t_1)
else
tmp = (y / a) + ((-1.0d0) / (t_1 / x))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a * z) - t;
double tmp;
if (a <= -3.9e+146) {
tmp = (y - (x / z)) / a;
} else if (a <= 1.5e+65) {
tmp = (y / (t_1 / z)) - (x / t_1);
} else {
tmp = (y / a) + (-1.0 / (t_1 / x));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * z) - t tmp = 0 if a <= -3.9e+146: tmp = (y - (x / z)) / a elif a <= 1.5e+65: tmp = (y / (t_1 / z)) - (x / t_1) else: tmp = (y / a) + (-1.0 / (t_1 / x)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * z) - t) tmp = 0.0 if (a <= -3.9e+146) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (a <= 1.5e+65) tmp = Float64(Float64(y / Float64(t_1 / z)) - Float64(x / t_1)); else tmp = Float64(Float64(y / a) + Float64(-1.0 / Float64(t_1 / x))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * z) - t; tmp = 0.0; if (a <= -3.9e+146) tmp = (y - (x / z)) / a; elseif (a <= 1.5e+65) tmp = (y / (t_1 / z)) - (x / t_1); else tmp = (y / a) + (-1.0 / (t_1 / x)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[a, -3.9e+146], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[a, 1.5e+65], N[(N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y / a), $MachinePrecision] + N[(-1.0 / N[(t$95$1 / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot z - t\\
\mathbf{if}\;a \leq -3.9 \cdot 10^{+146}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;a \leq 1.5 \cdot 10^{+65}:\\
\;\;\;\;\frac{y}{\frac{t_1}{z}} - \frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a} + \frac{-1}{\frac{t_1}{x}}\\
\end{array}
\end{array}
if a < -3.9e146Initial program 63.9%
sub-neg63.9%
+-commutative63.9%
neg-sub063.9%
associate-+l-63.9%
sub0-neg63.9%
neg-mul-163.9%
sub-neg63.9%
+-commutative63.9%
neg-sub063.9%
associate-+l-63.9%
sub0-neg63.9%
neg-mul-163.9%
times-frac63.9%
metadata-eval63.9%
*-lft-identity63.9%
*-commutative63.9%
Simplified63.9%
div-sub63.9%
associate-/l*64.0%
Applied egg-rr64.0%
Taylor expanded in a around inf 86.3%
if -3.9e146 < a < 1.5000000000000001e65Initial program 92.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
sub-neg92.7%
+-commutative92.7%
neg-sub092.7%
associate-+l-92.7%
sub0-neg92.7%
neg-mul-192.7%
times-frac92.7%
metadata-eval92.7%
*-lft-identity92.7%
*-commutative92.7%
Simplified92.7%
div-sub92.7%
associate-/l*97.3%
Applied egg-rr97.3%
if 1.5000000000000001e65 < a Initial program 70.7%
sub-neg70.7%
+-commutative70.7%
neg-sub070.7%
associate-+l-70.7%
sub0-neg70.7%
neg-mul-170.7%
sub-neg70.7%
+-commutative70.7%
neg-sub070.7%
associate-+l-70.7%
sub0-neg70.7%
neg-mul-170.7%
times-frac70.7%
metadata-eval70.7%
*-lft-identity70.7%
*-commutative70.7%
Simplified70.7%
div-sub70.7%
associate-/l*67.2%
Applied egg-rr67.2%
clear-num66.7%
inv-pow66.7%
Applied egg-rr66.7%
unpow-166.7%
Simplified66.7%
Taylor expanded in z around inf 88.6%
Final simplification94.6%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -2000000.0)
(and (not (<= z 2.8e-115)) (or (<= z 1.45e-58) (not (<= z 4.6e+33)))))
(/ (- y (/ x z)) a)
(/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2000000.0) || (!(z <= 2.8e-115) && ((z <= 1.45e-58) || !(z <= 4.6e+33)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-2000000.0d0)) .or. (.not. (z <= 2.8d-115)) .and. (z <= 1.45d-58) .or. (.not. (z <= 4.6d+33))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2000000.0) || (!(z <= 2.8e-115) && ((z <= 1.45e-58) || !(z <= 4.6e+33)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2000000.0) or (not (z <= 2.8e-115) and ((z <= 1.45e-58) or not (z <= 4.6e+33))): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2000000.0) || (!(z <= 2.8e-115) && ((z <= 1.45e-58) || !(z <= 4.6e+33)))) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2000000.0) || (~((z <= 2.8e-115)) && ((z <= 1.45e-58) || ~((z <= 4.6e+33))))) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2000000.0], And[N[Not[LessEqual[z, 2.8e-115]], $MachinePrecision], Or[LessEqual[z, 1.45e-58], N[Not[LessEqual[z, 4.6e+33]], $MachinePrecision]]]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2000000 \lor \neg \left(z \leq 2.8 \cdot 10^{-115}\right) \land \left(z \leq 1.45 \cdot 10^{-58} \lor \neg \left(z \leq 4.6 \cdot 10^{+33}\right)\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -2e6 or 2.79999999999999987e-115 < z < 1.44999999999999995e-58 or 4.60000000000000021e33 < z Initial program 73.1%
sub-neg73.1%
+-commutative73.1%
neg-sub073.1%
associate-+l-73.1%
sub0-neg73.1%
neg-mul-173.1%
sub-neg73.1%
+-commutative73.1%
neg-sub073.1%
associate-+l-73.1%
sub0-neg73.1%
neg-mul-173.1%
times-frac73.1%
metadata-eval73.1%
*-lft-identity73.1%
*-commutative73.1%
Simplified73.1%
div-sub73.2%
associate-/l*81.7%
Applied egg-rr81.7%
Taylor expanded in a around inf 73.2%
if -2e6 < z < 2.79999999999999987e-115 or 1.44999999999999995e-58 < z < 4.60000000000000021e33Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 82.2%
associate-*r/82.2%
neg-mul-182.2%
neg-sub082.2%
sub-neg82.2%
+-commutative82.2%
associate--r+82.2%
neg-sub082.2%
remove-double-neg82.2%
*-commutative82.2%
Simplified82.2%
Final simplification77.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -320000000000.0)
(/ y a)
(if (<= z -4.6e-26)
(* (- z) (/ y t))
(if (<= z 2.25e-115)
(/ x t)
(if (<= z 8e+112) (* (/ x z) (/ -1.0 a)) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -320000000000.0) {
tmp = y / a;
} else if (z <= -4.6e-26) {
tmp = -z * (y / t);
} else if (z <= 2.25e-115) {
tmp = x / t;
} else if (z <= 8e+112) {
tmp = (x / z) * (-1.0 / a);
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-320000000000.0d0)) then
tmp = y / a
else if (z <= (-4.6d-26)) then
tmp = -z * (y / t)
else if (z <= 2.25d-115) then
tmp = x / t
else if (z <= 8d+112) then
tmp = (x / z) * ((-1.0d0) / a)
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -320000000000.0) {
tmp = y / a;
} else if (z <= -4.6e-26) {
tmp = -z * (y / t);
} else if (z <= 2.25e-115) {
tmp = x / t;
} else if (z <= 8e+112) {
tmp = (x / z) * (-1.0 / a);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -320000000000.0: tmp = y / a elif z <= -4.6e-26: tmp = -z * (y / t) elif z <= 2.25e-115: tmp = x / t elif z <= 8e+112: tmp = (x / z) * (-1.0 / a) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -320000000000.0) tmp = Float64(y / a); elseif (z <= -4.6e-26) tmp = Float64(Float64(-z) * Float64(y / t)); elseif (z <= 2.25e-115) tmp = Float64(x / t); elseif (z <= 8e+112) tmp = Float64(Float64(x / z) * Float64(-1.0 / a)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -320000000000.0) tmp = y / a; elseif (z <= -4.6e-26) tmp = -z * (y / t); elseif (z <= 2.25e-115) tmp = x / t; elseif (z <= 8e+112) tmp = (x / z) * (-1.0 / a); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -320000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -4.6e-26], N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.25e-115], N[(x / t), $MachinePrecision], If[LessEqual[z, 8e+112], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -320000000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4.6 \cdot 10^{-26}:\\
\;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.25 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 8 \cdot 10^{+112}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-1}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.2e11 or 7.9999999999999994e112 < z Initial program 67.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
neg-mul-167.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
neg-mul-167.5%
times-frac67.5%
metadata-eval67.5%
*-lft-identity67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in z around inf 57.3%
if -3.2e11 < z < -4.60000000000000018e-26Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 75.2%
associate-*r/75.2%
neg-mul-175.2%
neg-sub075.2%
sub-neg75.2%
+-commutative75.2%
associate--r+75.2%
neg-sub075.2%
remove-double-neg75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x around 0 67.6%
mul-1-neg67.6%
associate-*l/67.6%
*-commutative67.6%
distribute-rgt-neg-in67.6%
distribute-neg-frac67.6%
Simplified67.6%
if -4.60000000000000018e-26 < z < 2.25000000000000011e-115Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 70.2%
if 2.25000000000000011e-115 < z < 7.9999999999999994e112Initial program 95.7%
sub-neg95.7%
+-commutative95.7%
neg-sub095.7%
associate-+l-95.7%
sub0-neg95.7%
neg-mul-195.7%
sub-neg95.7%
+-commutative95.7%
neg-sub095.7%
associate-+l-95.7%
sub0-neg95.7%
neg-mul-195.7%
times-frac95.7%
metadata-eval95.7%
*-lft-identity95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in y around 0 65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in z around inf 43.2%
associate-*r/43.2%
mul-1-neg43.2%
*-commutative43.2%
Simplified43.2%
neg-mul-143.2%
*-commutative43.2%
times-frac47.2%
Applied egg-rr47.2%
Final simplification60.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (* a z) t)))
(if (<= z -5700.0)
(/ (- y (/ x z)) a)
(if (<= z 1.15e-178)
(/ (- x (* y z)) t)
(if (<= z 9e+83) (/ (- x) t_1) (* y (/ z t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (a * z) - t;
double tmp;
if (z <= -5700.0) {
tmp = (y - (x / z)) / a;
} else if (z <= 1.15e-178) {
tmp = (x - (y * z)) / t;
} else if (z <= 9e+83) {
tmp = -x / t_1;
} else {
tmp = y * (z / t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (a * z) - t
if (z <= (-5700.0d0)) then
tmp = (y - (x / z)) / a
else if (z <= 1.15d-178) then
tmp = (x - (y * z)) / t
else if (z <= 9d+83) then
tmp = -x / t_1
else
tmp = y * (z / t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (a * z) - t;
double tmp;
if (z <= -5700.0) {
tmp = (y - (x / z)) / a;
} else if (z <= 1.15e-178) {
tmp = (x - (y * z)) / t;
} else if (z <= 9e+83) {
tmp = -x / t_1;
} else {
tmp = y * (z / t_1);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (a * z) - t tmp = 0 if z <= -5700.0: tmp = (y - (x / z)) / a elif z <= 1.15e-178: tmp = (x - (y * z)) / t elif z <= 9e+83: tmp = -x / t_1 else: tmp = y * (z / t_1) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(a * z) - t) tmp = 0.0 if (z <= -5700.0) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (z <= 1.15e-178) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 9e+83) tmp = Float64(Float64(-x) / t_1); else tmp = Float64(y * Float64(z / t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (a * z) - t; tmp = 0.0; if (z <= -5700.0) tmp = (y - (x / z)) / a; elseif (z <= 1.15e-178) tmp = (x - (y * z)) / t; elseif (z <= 9e+83) tmp = -x / t_1; else tmp = y * (z / t_1); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]}, If[LessEqual[z, -5700.0], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 1.15e-178], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 9e+83], N[((-x) / t$95$1), $MachinePrecision], N[(y * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot z - t\\
\mathbf{if}\;z \leq -5700:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;z \leq 1.15 \cdot 10^{-178}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 9 \cdot 10^{+83}:\\
\;\;\;\;\frac{-x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t_1}\\
\end{array}
\end{array}
if z < -5700Initial program 63.8%
sub-neg63.8%
+-commutative63.8%
neg-sub063.8%
associate-+l-63.8%
sub0-neg63.8%
neg-mul-163.8%
sub-neg63.8%
+-commutative63.8%
neg-sub063.8%
associate-+l-63.8%
sub0-neg63.8%
neg-mul-163.8%
times-frac63.8%
metadata-eval63.8%
*-lft-identity63.8%
*-commutative63.8%
Simplified63.8%
div-sub63.8%
associate-/l*72.1%
Applied egg-rr72.1%
Taylor expanded in a around inf 78.5%
if -5700 < z < 1.14999999999999997e-178Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
neg-sub085.0%
sub-neg85.0%
+-commutative85.0%
associate--r+85.0%
neg-sub085.0%
remove-double-neg85.0%
*-commutative85.0%
Simplified85.0%
if 1.14999999999999997e-178 < z < 8.9999999999999999e83Initial program 98.0%
sub-neg98.0%
+-commutative98.0%
neg-sub098.0%
associate-+l-98.0%
sub0-neg98.0%
neg-mul-198.0%
sub-neg98.0%
+-commutative98.0%
neg-sub098.0%
associate-+l-98.0%
sub0-neg98.0%
neg-mul-198.0%
times-frac98.0%
metadata-eval98.0%
*-lft-identity98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in y around 0 72.7%
neg-mul-172.7%
Simplified72.7%
if 8.9999999999999999e83 < z Initial program 77.0%
sub-neg77.0%
+-commutative77.0%
neg-sub077.0%
associate-+l-77.0%
sub0-neg77.0%
neg-mul-177.0%
sub-neg77.0%
+-commutative77.0%
neg-sub077.0%
associate-+l-77.0%
sub0-neg77.0%
neg-mul-177.0%
times-frac77.0%
metadata-eval77.0%
*-lft-identity77.0%
*-commutative77.0%
Simplified77.0%
Taylor expanded in y around inf 56.3%
*-commutative56.3%
associate-*r/70.0%
*-commutative70.0%
Simplified70.0%
Final simplification78.5%
(FPCore (x y z t a)
:precision binary64
(if (<= z -115000000000.0)
(/ y a)
(if (<= z -3.2e-25)
(* (- z) (/ y t))
(if (<= z 2.8e-115)
(/ x t)
(if (<= z 1.05e+113) (/ (- x) (* a z)) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -115000000000.0) {
tmp = y / a;
} else if (z <= -3.2e-25) {
tmp = -z * (y / t);
} else if (z <= 2.8e-115) {
tmp = x / t;
} else if (z <= 1.05e+113) {
tmp = -x / (a * z);
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-115000000000.0d0)) then
tmp = y / a
else if (z <= (-3.2d-25)) then
tmp = -z * (y / t)
else if (z <= 2.8d-115) then
tmp = x / t
else if (z <= 1.05d+113) then
tmp = -x / (a * z)
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -115000000000.0) {
tmp = y / a;
} else if (z <= -3.2e-25) {
tmp = -z * (y / t);
} else if (z <= 2.8e-115) {
tmp = x / t;
} else if (z <= 1.05e+113) {
tmp = -x / (a * z);
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -115000000000.0: tmp = y / a elif z <= -3.2e-25: tmp = -z * (y / t) elif z <= 2.8e-115: tmp = x / t elif z <= 1.05e+113: tmp = -x / (a * z) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -115000000000.0) tmp = Float64(y / a); elseif (z <= -3.2e-25) tmp = Float64(Float64(-z) * Float64(y / t)); elseif (z <= 2.8e-115) tmp = Float64(x / t); elseif (z <= 1.05e+113) tmp = Float64(Float64(-x) / Float64(a * z)); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -115000000000.0) tmp = y / a; elseif (z <= -3.2e-25) tmp = -z * (y / t); elseif (z <= 2.8e-115) tmp = x / t; elseif (z <= 1.05e+113) tmp = -x / (a * z); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -115000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.2e-25], N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.8e-115], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.05e+113], N[((-x) / N[(a * z), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -115000000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-25}:\\
\;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+113}:\\
\;\;\;\;\frac{-x}{a \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.15e11 or 1.0499999999999999e113 < z Initial program 67.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
neg-mul-167.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
neg-mul-167.5%
times-frac67.5%
metadata-eval67.5%
*-lft-identity67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in z around inf 57.3%
if -1.15e11 < z < -3.2000000000000001e-25Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 75.2%
associate-*r/75.2%
neg-mul-175.2%
neg-sub075.2%
sub-neg75.2%
+-commutative75.2%
associate--r+75.2%
neg-sub075.2%
remove-double-neg75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x around 0 67.6%
mul-1-neg67.6%
associate-*l/67.6%
*-commutative67.6%
distribute-rgt-neg-in67.6%
distribute-neg-frac67.6%
Simplified67.6%
if -3.2000000000000001e-25 < z < 2.79999999999999987e-115Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 70.2%
if 2.79999999999999987e-115 < z < 1.0499999999999999e113Initial program 95.7%
sub-neg95.7%
+-commutative95.7%
neg-sub095.7%
associate-+l-95.7%
sub0-neg95.7%
neg-mul-195.7%
sub-neg95.7%
+-commutative95.7%
neg-sub095.7%
associate-+l-95.7%
sub0-neg95.7%
neg-mul-195.7%
times-frac95.7%
metadata-eval95.7%
*-lft-identity95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in y around 0 65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in z around inf 43.2%
associate-*r/43.2%
mul-1-neg43.2%
*-commutative43.2%
Simplified43.2%
Final simplification60.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -540000000.0)
(/ y a)
(if (<= z -6.8e-28)
(* (- z) (/ y t))
(if (<= z 2.65e-115)
(/ x t)
(if (<= z 8.2e+112) (/ (/ (- x) a) z) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -540000000.0) {
tmp = y / a;
} else if (z <= -6.8e-28) {
tmp = -z * (y / t);
} else if (z <= 2.65e-115) {
tmp = x / t;
} else if (z <= 8.2e+112) {
tmp = (-x / a) / z;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-540000000.0d0)) then
tmp = y / a
else if (z <= (-6.8d-28)) then
tmp = -z * (y / t)
else if (z <= 2.65d-115) then
tmp = x / t
else if (z <= 8.2d+112) then
tmp = (-x / a) / z
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -540000000.0) {
tmp = y / a;
} else if (z <= -6.8e-28) {
tmp = -z * (y / t);
} else if (z <= 2.65e-115) {
tmp = x / t;
} else if (z <= 8.2e+112) {
tmp = (-x / a) / z;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -540000000.0: tmp = y / a elif z <= -6.8e-28: tmp = -z * (y / t) elif z <= 2.65e-115: tmp = x / t elif z <= 8.2e+112: tmp = (-x / a) / z else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -540000000.0) tmp = Float64(y / a); elseif (z <= -6.8e-28) tmp = Float64(Float64(-z) * Float64(y / t)); elseif (z <= 2.65e-115) tmp = Float64(x / t); elseif (z <= 8.2e+112) tmp = Float64(Float64(Float64(-x) / a) / z); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -540000000.0) tmp = y / a; elseif (z <= -6.8e-28) tmp = -z * (y / t); elseif (z <= 2.65e-115) tmp = x / t; elseif (z <= 8.2e+112) tmp = (-x / a) / z; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -540000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -6.8e-28], N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.65e-115], N[(x / t), $MachinePrecision], If[LessEqual[z, 8.2e+112], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -540000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -6.8 \cdot 10^{-28}:\\
\;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.65 \cdot 10^{-115}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+112}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.4e8 or 8.19999999999999951e112 < z Initial program 67.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
neg-mul-167.5%
sub-neg67.5%
+-commutative67.5%
neg-sub067.5%
associate-+l-67.5%
sub0-neg67.5%
neg-mul-167.5%
times-frac67.5%
metadata-eval67.5%
*-lft-identity67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in z around inf 57.3%
if -5.4e8 < z < -6.8000000000000001e-28Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 75.2%
associate-*r/75.2%
neg-mul-175.2%
neg-sub075.2%
sub-neg75.2%
+-commutative75.2%
associate--r+75.2%
neg-sub075.2%
remove-double-neg75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x around 0 67.6%
mul-1-neg67.6%
associate-*l/67.6%
*-commutative67.6%
distribute-rgt-neg-in67.6%
distribute-neg-frac67.6%
Simplified67.6%
if -6.8000000000000001e-28 < z < 2.65e-115Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 70.2%
if 2.65e-115 < z < 8.19999999999999951e112Initial program 95.7%
sub-neg95.7%
+-commutative95.7%
neg-sub095.7%
associate-+l-95.7%
sub0-neg95.7%
neg-mul-195.7%
sub-neg95.7%
+-commutative95.7%
neg-sub095.7%
associate-+l-95.7%
sub0-neg95.7%
neg-mul-195.7%
times-frac95.7%
metadata-eval95.7%
*-lft-identity95.7%
*-commutative95.7%
Simplified95.7%
Taylor expanded in y around 0 65.8%
neg-mul-165.8%
Simplified65.8%
Taylor expanded in z around inf 43.2%
mul-1-neg43.2%
associate-/r*44.6%
distribute-frac-neg44.6%
mul-1-neg44.6%
associate-*r/44.6%
mul-1-neg44.6%
Simplified44.6%
Final simplification60.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -4200000.0)
t_1
(if (<= z 1.7e-176)
(/ (- x (* y z)) t)
(if (<= z 8.5e+92) (/ (- x) (- (* a z) t)) t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -4200000.0) {
tmp = t_1;
} else if (z <= 1.7e-176) {
tmp = (x - (y * z)) / t;
} else if (z <= 8.5e+92) {
tmp = -x / ((a * z) - t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - (x / z)) / a
if (z <= (-4200000.0d0)) then
tmp = t_1
else if (z <= 1.7d-176) then
tmp = (x - (y * z)) / t
else if (z <= 8.5d+92) then
tmp = -x / ((a * 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 a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -4200000.0) {
tmp = t_1;
} else if (z <= 1.7e-176) {
tmp = (x - (y * z)) / t;
} else if (z <= 8.5e+92) {
tmp = -x / ((a * z) - t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -4200000.0: tmp = t_1 elif z <= 1.7e-176: tmp = (x - (y * z)) / t elif z <= 8.5e+92: tmp = -x / ((a * z) - t) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -4200000.0) tmp = t_1; elseif (z <= 1.7e-176) tmp = Float64(Float64(x - Float64(y * z)) / t); elseif (z <= 8.5e+92) tmp = Float64(Float64(-x) / Float64(Float64(a * z) - t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (z <= -4200000.0) tmp = t_1; elseif (z <= 1.7e-176) tmp = (x - (y * z)) / t; elseif (z <= 8.5e+92) tmp = -x / ((a * z) - t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -4200000.0], t$95$1, If[LessEqual[z, 1.7e-176], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 8.5e+92], N[((-x) / N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -4200000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{-176}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+92}:\\
\;\;\;\;\frac{-x}{a \cdot z - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -4.2e6 or 8.5000000000000001e92 < z Initial program 68.4%
sub-neg68.4%
+-commutative68.4%
neg-sub068.4%
associate-+l-68.4%
sub0-neg68.4%
neg-mul-168.4%
sub-neg68.4%
+-commutative68.4%
neg-sub068.4%
associate-+l-68.4%
sub0-neg68.4%
neg-mul-168.4%
times-frac68.4%
metadata-eval68.4%
*-lft-identity68.4%
*-commutative68.4%
Simplified68.4%
div-sub68.5%
associate-/l*78.8%
Applied egg-rr78.8%
Taylor expanded in a around inf 73.7%
if -4.2e6 < z < 1.6999999999999999e-176Initial program 99.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
sub-neg99.9%
+-commutative99.9%
neg-sub099.9%
associate-+l-99.9%
sub0-neg99.9%
neg-mul-199.9%
times-frac99.9%
metadata-eval99.9%
*-lft-identity99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in a around 0 85.0%
associate-*r/85.0%
neg-mul-185.0%
neg-sub085.0%
sub-neg85.0%
+-commutative85.0%
associate--r+85.0%
neg-sub085.0%
remove-double-neg85.0%
*-commutative85.0%
Simplified85.0%
if 1.6999999999999999e-176 < z < 8.5000000000000001e92Initial program 98.0%
sub-neg98.0%
+-commutative98.0%
neg-sub098.0%
associate-+l-98.0%
sub0-neg98.0%
neg-mul-198.0%
sub-neg98.0%
+-commutative98.0%
neg-sub098.0%
associate-+l-98.0%
sub0-neg98.0%
neg-mul-198.0%
times-frac98.0%
metadata-eval98.0%
*-lft-identity98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in y around 0 71.4%
neg-mul-171.4%
Simplified71.4%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.1e+105) (/ (- y (/ x z)) a) (/ (- x (* y z)) (- t (* a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e+105) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (t - (a * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.1d+105)) then
tmp = (y - (x / z)) / a
else
tmp = (x - (y * z)) / (t - (a * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.1e+105) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / (t - (a * z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.1e+105: tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / (t - (a * z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.1e+105) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.1e+105) tmp = (y - (x / z)) / a; else tmp = (x - (y * z)) / (t - (a * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.1e+105], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.1 \cdot 10^{+105}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - a \cdot z}\\
\end{array}
\end{array}
if z < -4.1000000000000002e105Initial program 49.5%
sub-neg49.5%
+-commutative49.5%
neg-sub049.5%
associate-+l-49.5%
sub0-neg49.5%
neg-mul-149.5%
sub-neg49.5%
+-commutative49.5%
neg-sub049.5%
associate-+l-49.5%
sub0-neg49.5%
neg-mul-149.5%
times-frac49.5%
metadata-eval49.5%
*-lft-identity49.5%
*-commutative49.5%
Simplified49.5%
div-sub49.5%
associate-/l*59.9%
Applied egg-rr59.9%
Taylor expanded in a around inf 81.4%
if -4.1000000000000002e105 < z Initial program 93.9%
Final simplification91.6%
(FPCore (x y z t a) :precision binary64 (if (<= z -12800000000000.0) (/ y a) (if (<= z 1.9e+107) (/ (- x (* y z)) t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -12800000000000.0) {
tmp = y / a;
} else if (z <= 1.9e+107) {
tmp = (x - (y * z)) / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-12800000000000.0d0)) then
tmp = y / a
else if (z <= 1.9d+107) then
tmp = (x - (y * z)) / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -12800000000000.0) {
tmp = y / a;
} else if (z <= 1.9e+107) {
tmp = (x - (y * z)) / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -12800000000000.0: tmp = y / a elif z <= 1.9e+107: tmp = (x - (y * z)) / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -12800000000000.0) tmp = Float64(y / a); elseif (z <= 1.9e+107) tmp = Float64(Float64(x - Float64(y * z)) / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -12800000000000.0) tmp = y / a; elseif (z <= 1.9e+107) tmp = (x - (y * z)) / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -12800000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.9e+107], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -12800000000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.9 \cdot 10^{+107}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.28e13 or 1.8999999999999999e107 < z Initial program 67.3%
sub-neg67.3%
+-commutative67.3%
neg-sub067.3%
associate-+l-67.3%
sub0-neg67.3%
neg-mul-167.3%
sub-neg67.3%
+-commutative67.3%
neg-sub067.3%
associate-+l-67.3%
sub0-neg67.3%
neg-mul-167.3%
times-frac67.3%
metadata-eval67.3%
*-lft-identity67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in z around inf 56.3%
if -1.28e13 < z < 1.8999999999999999e107Initial program 99.3%
sub-neg99.3%
+-commutative99.3%
neg-sub099.3%
associate-+l-99.3%
sub0-neg99.3%
neg-mul-199.3%
sub-neg99.3%
+-commutative99.3%
neg-sub099.3%
associate-+l-99.3%
sub0-neg99.3%
neg-mul-199.3%
times-frac99.3%
metadata-eval99.3%
*-lft-identity99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in a around 0 74.7%
associate-*r/74.7%
neg-mul-174.7%
neg-sub074.7%
sub-neg74.7%
+-commutative74.7%
associate--r+74.7%
neg-sub074.7%
remove-double-neg74.7%
*-commutative74.7%
Simplified74.7%
Final simplification67.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -3400000000000.0) (/ y a) (if (<= z -4e-26) (* (- z) (/ y t)) (if (<= z 8.5e+92) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3400000000000.0) {
tmp = y / a;
} else if (z <= -4e-26) {
tmp = -z * (y / t);
} else if (z <= 8.5e+92) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3400000000000.0d0)) then
tmp = y / a
else if (z <= (-4d-26)) then
tmp = -z * (y / t)
else if (z <= 8.5d+92) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3400000000000.0) {
tmp = y / a;
} else if (z <= -4e-26) {
tmp = -z * (y / t);
} else if (z <= 8.5e+92) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3400000000000.0: tmp = y / a elif z <= -4e-26: tmp = -z * (y / t) elif z <= 8.5e+92: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3400000000000.0) tmp = Float64(y / a); elseif (z <= -4e-26) tmp = Float64(Float64(-z) * Float64(y / t)); elseif (z <= 8.5e+92) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3400000000000.0) tmp = y / a; elseif (z <= -4e-26) tmp = -z * (y / t); elseif (z <= 8.5e+92) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3400000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, -4e-26], N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+92], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3400000000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-26}:\\
\;\;\;\;\left(-z\right) \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.4e12 or 8.5000000000000001e92 < z Initial program 67.9%
sub-neg67.9%
+-commutative67.9%
neg-sub067.9%
associate-+l-67.9%
sub0-neg67.9%
neg-mul-167.9%
sub-neg67.9%
+-commutative67.9%
neg-sub067.9%
associate-+l-67.9%
sub0-neg67.9%
neg-mul-167.9%
times-frac67.9%
metadata-eval67.9%
*-lft-identity67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in z around inf 55.4%
if -3.4e12 < z < -4.0000000000000002e-26Initial program 99.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
sub-neg99.7%
+-commutative99.7%
neg-sub099.7%
associate-+l-99.7%
sub0-neg99.7%
neg-mul-199.7%
times-frac99.7%
metadata-eval99.7%
*-lft-identity99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in a around 0 75.2%
associate-*r/75.2%
neg-mul-175.2%
neg-sub075.2%
sub-neg75.2%
+-commutative75.2%
associate--r+75.2%
neg-sub075.2%
remove-double-neg75.2%
*-commutative75.2%
Simplified75.2%
Taylor expanded in x around 0 67.6%
mul-1-neg67.6%
associate-*l/67.6%
*-commutative67.6%
distribute-rgt-neg-in67.6%
distribute-neg-frac67.6%
Simplified67.6%
if -4.0000000000000002e-26 < z < 8.5000000000000001e92Initial program 99.2%
sub-neg99.2%
+-commutative99.2%
neg-sub099.2%
associate-+l-99.2%
sub0-neg99.2%
neg-mul-199.2%
sub-neg99.2%
+-commutative99.2%
neg-sub099.2%
associate-+l-99.2%
sub0-neg99.2%
neg-mul-199.2%
times-frac99.2%
metadata-eval99.2%
*-lft-identity99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in z around 0 59.3%
Final simplification58.0%
(FPCore (x y z t a) :precision binary64 (if (<= z -5800000000000.0) (/ y a) (if (<= z 8.5e+92) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5800000000000.0) {
tmp = y / a;
} else if (z <= 8.5e+92) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-5800000000000.0d0)) then
tmp = y / a
else if (z <= 8.5d+92) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5800000000000.0) {
tmp = y / a;
} else if (z <= 8.5e+92) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5800000000000.0: tmp = y / a elif z <= 8.5e+92: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5800000000000.0) tmp = Float64(y / a); elseif (z <= 8.5e+92) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -5800000000000.0) tmp = y / a; elseif (z <= 8.5e+92) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5800000000000.0], N[(y / a), $MachinePrecision], If[LessEqual[z, 8.5e+92], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5800000000000:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.8e12 or 8.5000000000000001e92 < z Initial program 67.9%
sub-neg67.9%
+-commutative67.9%
neg-sub067.9%
associate-+l-67.9%
sub0-neg67.9%
neg-mul-167.9%
sub-neg67.9%
+-commutative67.9%
neg-sub067.9%
associate-+l-67.9%
sub0-neg67.9%
neg-mul-167.9%
times-frac67.9%
metadata-eval67.9%
*-lft-identity67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in z around inf 55.4%
if -5.8e12 < z < 8.5000000000000001e92Initial program 99.3%
sub-neg99.3%
+-commutative99.3%
neg-sub099.3%
associate-+l-99.3%
sub0-neg99.3%
neg-mul-199.3%
sub-neg99.3%
+-commutative99.3%
neg-sub099.3%
associate-+l-99.3%
sub0-neg99.3%
neg-mul-199.3%
times-frac99.3%
metadata-eval99.3%
*-lft-identity99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in z around 0 56.7%
Final simplification56.1%
(FPCore (x y z t a) :precision binary64 (/ x t))
double code(double x, double y, double z, double t, double a) {
return x / t;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x / t
end function
public static double code(double x, double y, double z, double t, double a) {
return x / t;
}
def code(x, y, z, t, a): return x / t
function code(x, y, z, t, a) return Float64(x / t) end
function tmp = code(x, y, z, t, a) tmp = x / t; end
code[x_, y_, z_, t_, a_] := N[(x / t), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{t}
\end{array}
Initial program 85.8%
sub-neg85.8%
+-commutative85.8%
neg-sub085.8%
associate-+l-85.8%
sub0-neg85.8%
neg-mul-185.8%
sub-neg85.8%
+-commutative85.8%
neg-sub085.8%
associate-+l-85.8%
sub0-neg85.8%
neg-mul-185.8%
times-frac85.8%
metadata-eval85.8%
*-lft-identity85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in z around 0 39.8%
Final simplification39.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* a z))) (t_2 (- (/ x t_1) (/ y (- (/ t z) a)))))
(if (< z -32113435955957344.0)
t_2
(if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 t_1)) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = t - (a * z)
t_2 = (x / t_1) - (y / ((t / z) - a))
if (z < (-32113435955957344.0d0)) then
tmp = t_2
else if (z < 3.5139522372978296d-86) then
tmp = (x - (y * z)) * (1.0d0 / t_1)
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double t_2 = (x / t_1) - (y / ((t / z) - a));
double tmp;
if (z < -32113435955957344.0) {
tmp = t_2;
} else if (z < 3.5139522372978296e-86) {
tmp = (x - (y * z)) * (1.0 / t_1);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (a * z) t_2 = (x / t_1) - (y / ((t / z) - a)) tmp = 0 if z < -32113435955957344.0: tmp = t_2 elif z < 3.5139522372978296e-86: tmp = (x - (y * z)) * (1.0 / t_1) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) t_2 = Float64(Float64(x / t_1) - Float64(y / Float64(Float64(t / z) - a))) tmp = 0.0 if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = Float64(Float64(x - Float64(y * z)) * Float64(1.0 / t_1)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (a * z); t_2 = (x / t_1) - (y / ((t / z) - a)); tmp = 0.0; if (z < -32113435955957344.0) tmp = t_2; elseif (z < 3.5139522372978296e-86) tmp = (x - (y * z)) * (1.0 / t_1); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / t$95$1), $MachinePrecision] - N[(y / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -32113435955957344.0], t$95$2, If[Less[z, 3.5139522372978296e-86], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
t_2 := \frac{x}{t_1} - \frac{y}{\frac{t}{z} - a}\\
\mathbf{if}\;z < -32113435955957344:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z < 3.5139522372978296 \cdot 10^{-86}:\\
\;\;\;\;\left(x - y \cdot z\right) \cdot \frac{1}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
herbie shell --seed 2023229
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< z -32113435955957344.0) (- (/ x (- t (* a z))) (/ y (- (/ t z) a))) (if (< z 3.5139522372978296e-86) (* (- x (* y z)) (/ 1.0 (- t (* a z)))) (- (/ x (- t (* a z))) (/ y (- (/ t z) a)))))
(/ (- x (* y z)) (- t (* a z))))