
(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 11 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 (- (/ y (- a (/ t z))) (/ x (- (* a z) t))))
double code(double x, double y, double z, double t, double a) {
return (y / (a - (t / z))) - (x / ((a * z) - 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 = (y / (a - (t / z))) - (x / ((a * z) - t))
end function
public static double code(double x, double y, double z, double t, double a) {
return (y / (a - (t / z))) - (x / ((a * z) - t));
}
def code(x, y, z, t, a): return (y / (a - (t / z))) - (x / ((a * z) - t))
function code(x, y, z, t, a) return Float64(Float64(y / Float64(a - Float64(t / z))) - Float64(x / Float64(Float64(a * z) - t))) end
function tmp = code(x, y, z, t, a) tmp = (y / (a - (t / z))) - (x / ((a * z) - t)); end
code[x_, y_, z_, t_, a_] := N[(N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{a - \frac{t}{z}} - \frac{x}{a \cdot z - t}
\end{array}
Initial program 86.6%
sub-neg86.6%
+-commutative86.6%
neg-sub086.6%
associate-+l-86.6%
sub0-neg86.6%
neg-mul-186.6%
sub-neg86.6%
+-commutative86.6%
neg-sub086.6%
associate-+l-86.6%
sub0-neg86.6%
neg-mul-186.6%
times-frac86.6%
metadata-eval86.6%
*-lft-identity86.6%
*-commutative86.6%
Simplified86.6%
div-sub86.2%
associate-/l*89.0%
Applied egg-rr89.0%
Taylor expanded in z around 0 96.1%
neg-mul-196.1%
unsub-neg96.1%
Simplified96.1%
Final simplification96.1%
(FPCore (x y z t a)
:precision binary64
(if (or (<= a -1.2e-23)
(not (or (<= a 1.56e-96) (and (not (<= a 1.75e-68)) (<= a 4.1e-7)))))
(/ (- y (/ x z)) a)
(/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -1.2e-23) || !((a <= 1.56e-96) || (!(a <= 1.75e-68) && (a <= 4.1e-7)))) {
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 ((a <= (-1.2d-23)) .or. (.not. (a <= 1.56d-96) .or. (.not. (a <= 1.75d-68)) .and. (a <= 4.1d-7))) 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 ((a <= -1.2e-23) || !((a <= 1.56e-96) || (!(a <= 1.75e-68) && (a <= 4.1e-7)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -1.2e-23) or not ((a <= 1.56e-96) or (not (a <= 1.75e-68) and (a <= 4.1e-7))): tmp = (y - (x / z)) / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -1.2e-23) || !((a <= 1.56e-96) || (!(a <= 1.75e-68) && (a <= 4.1e-7)))) 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 ((a <= -1.2e-23) || ~(((a <= 1.56e-96) || (~((a <= 1.75e-68)) && (a <= 4.1e-7))))) 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[a, -1.2e-23], N[Not[Or[LessEqual[a, 1.56e-96], And[N[Not[LessEqual[a, 1.75e-68]], $MachinePrecision], LessEqual[a, 4.1e-7]]]], $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}\;a \leq -1.2 \cdot 10^{-23} \lor \neg \left(a \leq 1.56 \cdot 10^{-96} \lor \neg \left(a \leq 1.75 \cdot 10^{-68}\right) \land a \leq 4.1 \cdot 10^{-7}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if a < -1.19999999999999998e-23 or 1.5599999999999999e-96 < a < 1.75000000000000006e-68 or 4.0999999999999999e-7 < a Initial program 79.0%
sub-neg79.0%
+-commutative79.0%
neg-sub079.0%
associate-+l-79.0%
sub0-neg79.0%
neg-mul-179.0%
sub-neg79.0%
+-commutative79.0%
neg-sub079.0%
associate-+l-79.0%
sub0-neg79.0%
neg-mul-179.0%
times-frac79.0%
metadata-eval79.0%
*-lft-identity79.0%
*-commutative79.0%
Simplified79.0%
div-sub79.0%
associate-/l*81.4%
Applied egg-rr81.4%
Taylor expanded in a around inf 69.7%
if -1.19999999999999998e-23 < a < 1.5599999999999999e-96 or 1.75000000000000006e-68 < a < 4.0999999999999999e-7Initial program 95.1%
sub-neg95.1%
+-commutative95.1%
neg-sub095.1%
associate-+l-95.1%
sub0-neg95.1%
neg-mul-195.1%
sub-neg95.1%
+-commutative95.1%
neg-sub095.1%
associate-+l-95.1%
sub0-neg95.1%
neg-mul-195.1%
times-frac95.1%
metadata-eval95.1%
*-lft-identity95.1%
*-commutative95.1%
Simplified95.1%
Taylor expanded in a around 0 83.8%
associate-*r/83.8%
neg-mul-183.8%
neg-sub083.8%
sub-neg83.8%
+-commutative83.8%
associate--r+83.8%
neg-sub083.8%
remove-double-neg83.8%
*-commutative83.8%
Simplified83.8%
Final simplification76.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -1.9e+66)
t_1
(if (<= z -3.6e+42)
(* (/ x z) (/ -1.0 a))
(if (or (<= z -6.2e-108) (not (<= z 550.0))) t_1 (/ x t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -1.9e+66) {
tmp = t_1;
} else if (z <= -3.6e+42) {
tmp = (x / z) * (-1.0 / a);
} else if ((z <= -6.2e-108) || !(z <= 550.0)) {
tmp = t_1;
} else {
tmp = x / 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) :: t_1
real(8) :: tmp
t_1 = y / (a - (t / z))
if (z <= (-1.9d+66)) then
tmp = t_1
else if (z <= (-3.6d+42)) then
tmp = (x / z) * ((-1.0d0) / a)
else if ((z <= (-6.2d-108)) .or. (.not. (z <= 550.0d0))) then
tmp = t_1
else
tmp = x / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -1.9e+66) {
tmp = t_1;
} else if (z <= -3.6e+42) {
tmp = (x / z) * (-1.0 / a);
} else if ((z <= -6.2e-108) || !(z <= 550.0)) {
tmp = t_1;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -1.9e+66: tmp = t_1 elif z <= -3.6e+42: tmp = (x / z) * (-1.0 / a) elif (z <= -6.2e-108) or not (z <= 550.0): tmp = t_1 else: tmp = x / t return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -1.9e+66) tmp = t_1; elseif (z <= -3.6e+42) tmp = Float64(Float64(x / z) * Float64(-1.0 / a)); elseif ((z <= -6.2e-108) || !(z <= 550.0)) tmp = t_1; else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -1.9e+66) tmp = t_1; elseif (z <= -3.6e+42) tmp = (x / z) * (-1.0 / a); elseif ((z <= -6.2e-108) || ~((z <= 550.0))) tmp = t_1; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+66], t$95$1, If[LessEqual[z, -3.6e+42], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -6.2e-108], N[Not[LessEqual[z, 550.0]], $MachinePrecision]], t$95$1, N[(x / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+66}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-1}{a}\\
\mathbf{elif}\;z \leq -6.2 \cdot 10^{-108} \lor \neg \left(z \leq 550\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -1.9000000000000001e66 or -3.6000000000000001e42 < z < -6.20000000000000028e-108 or 550 < z Initial program 76.0%
sub-neg76.0%
+-commutative76.0%
neg-sub076.0%
associate-+l-76.0%
sub0-neg76.0%
neg-mul-176.0%
sub-neg76.0%
+-commutative76.0%
neg-sub076.0%
associate-+l-76.0%
sub0-neg76.0%
neg-mul-176.0%
times-frac76.0%
metadata-eval76.0%
*-lft-identity76.0%
*-commutative76.0%
Simplified76.0%
div-sub76.0%
associate-/l*83.8%
Applied egg-rr83.8%
Taylor expanded in z around 0 97.1%
neg-mul-197.1%
unsub-neg97.1%
Simplified97.1%
Taylor expanded in y around inf 72.0%
if -1.9000000000000001e66 < z < -3.6000000000000001e42Initial program 80.8%
sub-neg80.8%
+-commutative80.8%
neg-sub080.8%
associate-+l-80.8%
sub0-neg80.8%
neg-mul-180.8%
sub-neg80.8%
+-commutative80.8%
neg-sub080.8%
associate-+l-80.8%
sub0-neg80.8%
neg-mul-180.8%
times-frac80.8%
metadata-eval80.8%
*-lft-identity80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y around 0 80.8%
neg-mul-180.8%
Simplified80.8%
Taylor expanded in z around inf 80.8%
mul-1-neg80.8%
associate-/r*99.7%
distribute-frac-neg99.7%
mul-1-neg99.7%
associate-*r/99.7%
mul-1-neg99.7%
Simplified99.7%
associate-/l/80.8%
neg-mul-180.8%
*-commutative80.8%
times-frac100.0%
Applied egg-rr100.0%
if -6.20000000000000028e-108 < z < 550Initial 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 56.5%
Final simplification65.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ y (- a (/ t z)))))
(if (<= z -1e+67)
t_1
(if (<= z -9.2e+42)
(* (/ x z) (/ -1.0 a))
(if (or (<= z -4.1e-105) (not (<= z 3.2e+92)))
t_1
(/ (- x (* y z)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y / (a - (t / z));
double tmp;
if (z <= -1e+67) {
tmp = t_1;
} else if (z <= -9.2e+42) {
tmp = (x / z) * (-1.0 / a);
} else if ((z <= -4.1e-105) || !(z <= 3.2e+92)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = y / (a - (t / z))
if (z <= (-1d+67)) then
tmp = t_1
else if (z <= (-9.2d+42)) then
tmp = (x / z) * ((-1.0d0) / a)
else if ((z <= (-4.1d-105)) .or. (.not. (z <= 3.2d+92))) then
tmp = t_1
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 t_1 = y / (a - (t / z));
double tmp;
if (z <= -1e+67) {
tmp = t_1;
} else if (z <= -9.2e+42) {
tmp = (x / z) * (-1.0 / a);
} else if ((z <= -4.1e-105) || !(z <= 3.2e+92)) {
tmp = t_1;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y / (a - (t / z)) tmp = 0 if z <= -1e+67: tmp = t_1 elif z <= -9.2e+42: tmp = (x / z) * (-1.0 / a) elif (z <= -4.1e-105) or not (z <= 3.2e+92): tmp = t_1 else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) t_1 = Float64(y / Float64(a - Float64(t / z))) tmp = 0.0 if (z <= -1e+67) tmp = t_1; elseif (z <= -9.2e+42) tmp = Float64(Float64(x / z) * Float64(-1.0 / a)); elseif ((z <= -4.1e-105) || !(z <= 3.2e+92)) tmp = t_1; else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y / (a - (t / z)); tmp = 0.0; if (z <= -1e+67) tmp = t_1; elseif (z <= -9.2e+42) tmp = (x / z) * (-1.0 / a); elseif ((z <= -4.1e-105) || ~((z <= 3.2e+92))) tmp = t_1; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1e+67], t$95$1, If[LessEqual[z, -9.2e+42], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -4.1e-105], N[Not[LessEqual[z, 3.2e+92]], $MachinePrecision]], t$95$1, N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y}{a - \frac{t}{z}}\\
\mathbf{if}\;z \leq -1 \cdot 10^{+67}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -9.2 \cdot 10^{+42}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-1}{a}\\
\mathbf{elif}\;z \leq -4.1 \cdot 10^{-105} \lor \neg \left(z \leq 3.2 \cdot 10^{+92}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -9.99999999999999983e66 or -9.2e42 < z < -4.1000000000000003e-105 or 3.20000000000000025e92 < z Initial program 73.0%
sub-neg73.0%
+-commutative73.0%
neg-sub073.0%
associate-+l-73.0%
sub0-neg73.0%
neg-mul-173.0%
sub-neg73.0%
+-commutative73.0%
neg-sub073.0%
associate-+l-73.0%
sub0-neg73.0%
neg-mul-173.0%
times-frac73.0%
metadata-eval73.0%
*-lft-identity73.0%
*-commutative73.0%
Simplified73.0%
div-sub73.0%
associate-/l*82.1%
Applied egg-rr82.1%
Taylor expanded in z around 0 97.5%
neg-mul-197.5%
unsub-neg97.5%
Simplified97.5%
Taylor expanded in y around inf 75.0%
if -9.99999999999999983e66 < z < -9.2e42Initial program 80.8%
sub-neg80.8%
+-commutative80.8%
neg-sub080.8%
associate-+l-80.8%
sub0-neg80.8%
neg-mul-180.8%
sub-neg80.8%
+-commutative80.8%
neg-sub080.8%
associate-+l-80.8%
sub0-neg80.8%
neg-mul-180.8%
times-frac80.8%
metadata-eval80.8%
*-lft-identity80.8%
*-commutative80.8%
Simplified80.8%
Taylor expanded in y around 0 80.8%
neg-mul-180.8%
Simplified80.8%
Taylor expanded in z around inf 80.8%
mul-1-neg80.8%
associate-/r*99.7%
distribute-frac-neg99.7%
mul-1-neg99.7%
associate-*r/99.7%
mul-1-neg99.7%
Simplified99.7%
associate-/l/80.8%
neg-mul-180.8%
*-commutative80.8%
times-frac100.0%
Applied egg-rr100.0%
if -4.1000000000000003e-105 < z < 3.20000000000000025e92Initial program 99.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
sub-neg99.1%
+-commutative99.1%
neg-sub099.1%
associate-+l-99.1%
sub0-neg99.1%
neg-mul-199.1%
times-frac99.1%
metadata-eval99.1%
*-lft-identity99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in a around 0 68.8%
associate-*r/68.8%
neg-mul-168.8%
neg-sub068.8%
sub-neg68.8%
+-commutative68.8%
associate--r+68.8%
neg-sub068.8%
remove-double-neg68.8%
*-commutative68.8%
Simplified68.8%
Final simplification72.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.5e+86) (not (<= z 6e+97))) (/ y (- a (/ t z))) (/ (- x (* y z)) (- t (* a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.5e+86) || !(z <= 6e+97)) {
tmp = y / (a - (t / z));
} 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 <= (-1.5d+86)) .or. (.not. (z <= 6d+97))) then
tmp = y / (a - (t / z))
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 <= -1.5e+86) || !(z <= 6e+97)) {
tmp = y / (a - (t / z));
} else {
tmp = (x - (y * z)) / (t - (a * z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.5e+86) or not (z <= 6e+97): tmp = y / (a - (t / z)) else: tmp = (x - (y * z)) / (t - (a * z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.5e+86) || !(z <= 6e+97)) tmp = Float64(y / Float64(a - Float64(t / z))); 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 <= -1.5e+86) || ~((z <= 6e+97))) tmp = y / (a - (t / z)); else tmp = (x - (y * z)) / (t - (a * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.5e+86], N[Not[LessEqual[z, 6e+97]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $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 -1.5 \cdot 10^{+86} \lor \neg \left(z \leq 6 \cdot 10^{+97}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - a \cdot z}\\
\end{array}
\end{array}
if z < -1.49999999999999988e86 or 5.9999999999999997e97 < z Initial program 60.1%
sub-neg60.1%
+-commutative60.1%
neg-sub060.1%
associate-+l-60.1%
sub0-neg60.1%
neg-mul-160.1%
sub-neg60.1%
+-commutative60.1%
neg-sub060.1%
associate-+l-60.1%
sub0-neg60.1%
neg-mul-160.1%
times-frac60.1%
metadata-eval60.1%
*-lft-identity60.1%
*-commutative60.1%
Simplified60.1%
div-sub60.2%
associate-/l*72.8%
Applied egg-rr72.8%
Taylor expanded in z around 0 96.2%
neg-mul-196.2%
unsub-neg96.2%
Simplified96.2%
Taylor expanded in y around inf 82.8%
if -1.49999999999999988e86 < z < 5.9999999999999997e97Initial program 98.2%
Final simplification93.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= y -9e+35) (not (<= y 7e+117))) (/ y (- a (/ t z))) (/ (- x) (- (* a z) t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((y <= -9e+35) || !(y <= 7e+117)) {
tmp = y / (a - (t / z));
} else {
tmp = -x / ((a * 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 ((y <= (-9d+35)) .or. (.not. (y <= 7d+117))) then
tmp = y / (a - (t / z))
else
tmp = -x / ((a * 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 ((y <= -9e+35) || !(y <= 7e+117)) {
tmp = y / (a - (t / z));
} else {
tmp = -x / ((a * z) - t);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (y <= -9e+35) or not (y <= 7e+117): tmp = y / (a - (t / z)) else: tmp = -x / ((a * z) - t) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((y <= -9e+35) || !(y <= 7e+117)) tmp = Float64(y / Float64(a - Float64(t / z))); else tmp = Float64(Float64(-x) / Float64(Float64(a * z) - t)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((y <= -9e+35) || ~((y <= 7e+117))) tmp = y / (a - (t / z)); else tmp = -x / ((a * z) - t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[y, -9e+35], N[Not[LessEqual[y, 7e+117]], $MachinePrecision]], N[(y / N[(a - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-x) / N[(N[(a * z), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+35} \lor \neg \left(y \leq 7 \cdot 10^{+117}\right):\\
\;\;\;\;\frac{y}{a - \frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{-x}{a \cdot z - t}\\
\end{array}
\end{array}
if y < -8.9999999999999993e35 or 6.99999999999999965e117 < y Initial program 75.1%
sub-neg75.1%
+-commutative75.1%
neg-sub075.1%
associate-+l-75.1%
sub0-neg75.1%
neg-mul-175.1%
sub-neg75.1%
+-commutative75.1%
neg-sub075.1%
associate-+l-75.1%
sub0-neg75.1%
neg-mul-175.1%
times-frac75.1%
metadata-eval75.1%
*-lft-identity75.1%
*-commutative75.1%
Simplified75.1%
div-sub74.1%
associate-/l*82.1%
Applied egg-rr82.1%
Taylor expanded in z around 0 95.9%
neg-mul-195.9%
unsub-neg95.9%
Simplified95.9%
Taylor expanded in y around inf 75.1%
if -8.9999999999999993e35 < y < 6.99999999999999965e117Initial program 93.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
neg-mul-193.8%
sub-neg93.8%
+-commutative93.8%
neg-sub093.8%
associate-+l-93.8%
sub0-neg93.8%
neg-mul-193.8%
times-frac93.8%
metadata-eval93.8%
*-lft-identity93.8%
*-commutative93.8%
Simplified93.8%
Taylor expanded in y around 0 74.6%
neg-mul-174.6%
Simplified74.6%
Final simplification74.8%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.35e+66)
(/ y a)
(if (<= z -1.85e-9)
(* (/ x z) (/ -1.0 a))
(if (<= z 1.65e+93) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.35e+66) {
tmp = y / a;
} else if (z <= -1.85e-9) {
tmp = (x / z) * (-1.0 / a);
} else if (z <= 1.65e+93) {
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 <= (-3.35d+66)) then
tmp = y / a
else if (z <= (-1.85d-9)) then
tmp = (x / z) * ((-1.0d0) / a)
else if (z <= 1.65d+93) 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 <= -3.35e+66) {
tmp = y / a;
} else if (z <= -1.85e-9) {
tmp = (x / z) * (-1.0 / a);
} else if (z <= 1.65e+93) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.35e+66: tmp = y / a elif z <= -1.85e-9: tmp = (x / z) * (-1.0 / a) elif z <= 1.65e+93: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.35e+66) tmp = Float64(y / a); elseif (z <= -1.85e-9) tmp = Float64(Float64(x / z) * Float64(-1.0 / a)); elseif (z <= 1.65e+93) 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 <= -3.35e+66) tmp = y / a; elseif (z <= -1.85e-9) tmp = (x / z) * (-1.0 / a); elseif (z <= 1.65e+93) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.35e+66], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.85e-9], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.65e+93], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.35 \cdot 10^{+66}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.85 \cdot 10^{-9}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-1}{a}\\
\mathbf{elif}\;z \leq 1.65 \cdot 10^{+93}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.34999999999999984e66 or 1.65000000000000004e93 < z Initial program 62.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
times-frac62.3%
metadata-eval62.3%
*-lft-identity62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in z around inf 58.8%
if -3.34999999999999984e66 < z < -1.85e-9Initial program 94.8%
sub-neg94.8%
+-commutative94.8%
neg-sub094.8%
associate-+l-94.8%
sub0-neg94.8%
neg-mul-194.8%
sub-neg94.8%
+-commutative94.8%
neg-sub094.8%
associate-+l-94.8%
sub0-neg94.8%
neg-mul-194.8%
times-frac94.8%
metadata-eval94.8%
*-lft-identity94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in y around 0 61.2%
neg-mul-161.2%
Simplified61.2%
Taylor expanded in z around inf 49.7%
mul-1-neg49.7%
associate-/r*54.6%
distribute-frac-neg54.6%
mul-1-neg54.6%
associate-*r/54.6%
mul-1-neg54.6%
Simplified54.6%
associate-/l/49.7%
neg-mul-149.7%
*-commutative49.7%
times-frac54.7%
Applied egg-rr54.7%
if -1.85e-9 < z < 1.65000000000000004e93Initial 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 51.3%
Final simplification54.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -7e+66) (/ y a) (if (<= z -1.95e-10) (/ (- x) (* a z)) (if (<= z 6e+92) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -7e+66) {
tmp = y / a;
} else if (z <= -1.95e-10) {
tmp = -x / (a * z);
} else if (z <= 6e+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 <= (-7d+66)) then
tmp = y / a
else if (z <= (-1.95d-10)) then
tmp = -x / (a * z)
else if (z <= 6d+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 <= -7e+66) {
tmp = y / a;
} else if (z <= -1.95e-10) {
tmp = -x / (a * z);
} else if (z <= 6e+92) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -7e+66: tmp = y / a elif z <= -1.95e-10: tmp = -x / (a * z) elif z <= 6e+92: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -7e+66) tmp = Float64(y / a); elseif (z <= -1.95e-10) tmp = Float64(Float64(-x) / Float64(a * z)); elseif (z <= 6e+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 <= -7e+66) tmp = y / a; elseif (z <= -1.95e-10) tmp = -x / (a * z); elseif (z <= 6e+92) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -7e+66], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.95e-10], N[((-x) / N[(a * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6e+92], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7 \cdot 10^{+66}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.95 \cdot 10^{-10}:\\
\;\;\;\;\frac{-x}{a \cdot z}\\
\mathbf{elif}\;z \leq 6 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.9999999999999994e66 or 6.00000000000000026e92 < z Initial program 62.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
times-frac62.3%
metadata-eval62.3%
*-lft-identity62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in z around inf 58.8%
if -6.9999999999999994e66 < z < -1.95e-10Initial program 94.8%
sub-neg94.8%
+-commutative94.8%
neg-sub094.8%
associate-+l-94.8%
sub0-neg94.8%
neg-mul-194.8%
sub-neg94.8%
+-commutative94.8%
neg-sub094.8%
associate-+l-94.8%
sub0-neg94.8%
neg-mul-194.8%
times-frac94.8%
metadata-eval94.8%
*-lft-identity94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in y around 0 61.2%
neg-mul-161.2%
Simplified61.2%
Taylor expanded in z around inf 49.7%
associate-*r/49.7%
mul-1-neg49.7%
*-commutative49.7%
Simplified49.7%
if -1.95e-10 < z < 6.00000000000000026e92Initial 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 51.3%
Final simplification53.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.9e+66) (/ y a) (if (<= z -3.6e-9) (/ (/ (- x) a) z) (if (<= z 3.2e+92) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.9e+66) {
tmp = y / a;
} else if (z <= -3.6e-9) {
tmp = (-x / a) / z;
} else if (z <= 3.2e+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 <= (-2.9d+66)) then
tmp = y / a
else if (z <= (-3.6d-9)) then
tmp = (-x / a) / z
else if (z <= 3.2d+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 <= -2.9e+66) {
tmp = y / a;
} else if (z <= -3.6e-9) {
tmp = (-x / a) / z;
} else if (z <= 3.2e+92) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.9e+66: tmp = y / a elif z <= -3.6e-9: tmp = (-x / a) / z elif z <= 3.2e+92: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.9e+66) tmp = Float64(y / a); elseif (z <= -3.6e-9) tmp = Float64(Float64(Float64(-x) / a) / z); elseif (z <= 3.2e+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 <= -2.9e+66) tmp = y / a; elseif (z <= -3.6e-9) tmp = (-x / a) / z; elseif (z <= 3.2e+92) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.9e+66], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.6e-9], N[(N[((-x) / a), $MachinePrecision] / z), $MachinePrecision], If[LessEqual[z, 3.2e+92], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.9 \cdot 10^{+66}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.6 \cdot 10^{-9}:\\
\;\;\;\;\frac{\frac{-x}{a}}{z}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.89999999999999986e66 or 3.20000000000000025e92 < z Initial program 62.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
sub-neg62.3%
+-commutative62.3%
neg-sub062.3%
associate-+l-62.3%
sub0-neg62.3%
neg-mul-162.3%
times-frac62.3%
metadata-eval62.3%
*-lft-identity62.3%
*-commutative62.3%
Simplified62.3%
Taylor expanded in z around inf 58.8%
if -2.89999999999999986e66 < z < -3.6e-9Initial program 94.8%
sub-neg94.8%
+-commutative94.8%
neg-sub094.8%
associate-+l-94.8%
sub0-neg94.8%
neg-mul-194.8%
sub-neg94.8%
+-commutative94.8%
neg-sub094.8%
associate-+l-94.8%
sub0-neg94.8%
neg-mul-194.8%
times-frac94.8%
metadata-eval94.8%
*-lft-identity94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in y around 0 61.2%
neg-mul-161.2%
Simplified61.2%
Taylor expanded in z around inf 49.7%
mul-1-neg49.7%
associate-/r*54.6%
distribute-frac-neg54.6%
mul-1-neg54.6%
associate-*r/54.6%
mul-1-neg54.6%
Simplified54.6%
if -3.6e-9 < z < 3.20000000000000025e92Initial 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 51.3%
Final simplification54.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -2.1e+59) (/ y a) (if (<= z 3.2e+92) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e+59) {
tmp = y / a;
} else if (z <= 3.2e+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 <= (-2.1d+59)) then
tmp = y / a
else if (z <= 3.2d+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 <= -2.1e+59) {
tmp = y / a;
} else if (z <= 3.2e+92) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e+59: tmp = y / a elif z <= 3.2e+92: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e+59) tmp = Float64(y / a); elseif (z <= 3.2e+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 <= -2.1e+59) tmp = y / a; elseif (z <= 3.2e+92) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e+59], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.2e+92], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+59}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.09999999999999984e59 or 3.20000000000000025e92 < z Initial program 62.7%
sub-neg62.7%
+-commutative62.7%
neg-sub062.7%
associate-+l-62.7%
sub0-neg62.7%
neg-mul-162.7%
sub-neg62.7%
+-commutative62.7%
neg-sub062.7%
associate-+l-62.7%
sub0-neg62.7%
neg-mul-162.7%
times-frac62.7%
metadata-eval62.7%
*-lft-identity62.7%
*-commutative62.7%
Simplified62.7%
Taylor expanded in z around inf 58.2%
if -2.09999999999999984e59 < z < 3.20000000000000025e92Initial program 98.7%
sub-neg98.7%
+-commutative98.7%
neg-sub098.7%
associate-+l-98.7%
sub0-neg98.7%
neg-mul-198.7%
sub-neg98.7%
+-commutative98.7%
neg-sub098.7%
associate-+l-98.7%
sub0-neg98.7%
neg-mul-198.7%
times-frac98.7%
metadata-eval98.7%
*-lft-identity98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in z around 0 48.7%
Final simplification51.9%
(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 86.6%
sub-neg86.6%
+-commutative86.6%
neg-sub086.6%
associate-+l-86.6%
sub0-neg86.6%
neg-mul-186.6%
sub-neg86.6%
+-commutative86.6%
neg-sub086.6%
associate-+l-86.6%
sub0-neg86.6%
neg-mul-186.6%
times-frac86.6%
metadata-eval86.6%
*-lft-identity86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in z around 0 35.7%
Final simplification35.7%
(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 2023238
(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))))