
(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 14 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 (- t (* a z))))
(if (or (<= a -4.2e+213) (not (<= a 1.15e+214)))
(+ (/ y a) (/ (- (/ y (/ (pow a 2.0) t)) (/ x a)) z))
(fma -1.0 (/ y (/ t_1 z)) (/ x t_1)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (a * z);
double tmp;
if ((a <= -4.2e+213) || !(a <= 1.15e+214)) {
tmp = (y / a) + (((y / (pow(a, 2.0) / t)) - (x / a)) / z);
} else {
tmp = fma(-1.0, (y / (t_1 / z)), (x / t_1));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(t - Float64(a * z)) tmp = 0.0 if ((a <= -4.2e+213) || !(a <= 1.15e+214)) tmp = Float64(Float64(y / a) + Float64(Float64(Float64(y / Float64((a ^ 2.0) / t)) - Float64(x / a)) / z)); else tmp = fma(-1.0, Float64(y / Float64(t_1 / z)), Float64(x / t_1)); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[a, -4.2e+213], N[Not[LessEqual[a, 1.15e+214]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(y / N[(N[Power[a, 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(x / a), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(-1.0 * N[(y / N[(t$95$1 / z), $MachinePrecision]), $MachinePrecision] + N[(x / t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - a \cdot z\\
\mathbf{if}\;a \leq -4.2 \cdot 10^{+213} \lor \neg \left(a \leq 1.15 \cdot 10^{+214}\right):\\
\;\;\;\;\frac{y}{a} + \frac{\frac{y}{\frac{{a}^{2}}{t}} - \frac{x}{a}}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-1, \frac{y}{\frac{t\_1}{z}}, \frac{x}{t\_1}\right)\\
\end{array}
\end{array}
if a < -4.2000000000000001e213 or 1.15e214 < a Initial program 45.8%
*-commutative45.8%
Simplified45.8%
Taylor expanded in z around inf 67.2%
+-commutative67.2%
associate--l+67.2%
associate-/r*76.8%
associate-*r/76.8%
associate-/r*76.8%
associate-*r/76.8%
div-sub76.8%
distribute-lft-out--76.8%
associate-*r/76.8%
mul-1-neg76.8%
unsub-neg76.8%
Simplified94.5%
if -4.2000000000000001e213 < a < 1.15e214Initial program 90.4%
*-commutative90.4%
Simplified90.4%
Taylor expanded in x around 0 90.4%
fma-def90.4%
associate-/l*94.7%
*-commutative94.7%
*-commutative94.7%
Simplified94.7%
Final simplification94.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -6.8e+213) (not (<= a 9.5e+211))) (+ (/ y a) (/ (- (/ y (/ (pow a 2.0) t)) (/ x a)) z)) (/ (- x (* y z)) (- t (* a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -6.8e+213) || !(a <= 9.5e+211)) {
tmp = (y / a) + (((y / (pow(a, 2.0) / t)) - (x / a)) / 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 ((a <= (-6.8d+213)) .or. (.not. (a <= 9.5d+211))) then
tmp = (y / a) + (((y / ((a ** 2.0d0) / t)) - (x / a)) / 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 ((a <= -6.8e+213) || !(a <= 9.5e+211)) {
tmp = (y / a) + (((y / (Math.pow(a, 2.0) / t)) - (x / a)) / z);
} else {
tmp = (x - (y * z)) / (t - (a * z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -6.8e+213) or not (a <= 9.5e+211): tmp = (y / a) + (((y / (math.pow(a, 2.0) / t)) - (x / a)) / z) else: tmp = (x - (y * z)) / (t - (a * z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -6.8e+213) || !(a <= 9.5e+211)) tmp = Float64(Float64(y / a) + Float64(Float64(Float64(y / Float64((a ^ 2.0) / t)) - Float64(x / a)) / 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 ((a <= -6.8e+213) || ~((a <= 9.5e+211))) tmp = (y / a) + (((y / ((a ^ 2.0) / t)) - (x / a)) / z); else tmp = (x - (y * z)) / (t - (a * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -6.8e+213], N[Not[LessEqual[a, 9.5e+211]], $MachinePrecision]], N[(N[(y / a), $MachinePrecision] + N[(N[(N[(y / N[(N[Power[a, 2.0], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] - N[(x / a), $MachinePrecision]), $MachinePrecision] / z), $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}\;a \leq -6.8 \cdot 10^{+213} \lor \neg \left(a \leq 9.5 \cdot 10^{+211}\right):\\
\;\;\;\;\frac{y}{a} + \frac{\frac{y}{\frac{{a}^{2}}{t}} - \frac{x}{a}}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - a \cdot z}\\
\end{array}
\end{array}
if a < -6.79999999999999983e213 or 9.4999999999999997e211 < a Initial program 45.8%
*-commutative45.8%
Simplified45.8%
Taylor expanded in z around inf 67.2%
+-commutative67.2%
associate--l+67.2%
associate-/r*76.8%
associate-*r/76.8%
associate-/r*76.8%
associate-*r/76.8%
div-sub76.8%
distribute-lft-out--76.8%
associate-*r/76.8%
mul-1-neg76.8%
unsub-neg76.8%
Simplified94.5%
if -6.79999999999999983e213 < a < 9.4999999999999997e211Initial program 90.4%
Final simplification90.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- (/ x t) (* z (/ y t)))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.2e+74)
t_2
(if (<= z -7e-166)
t_1
(if (<= z 7e-108)
(/ x (- t (* a z)))
(if (<= z 7.5e-16)
t_1
(if (or (<= z 0.00064) (not (<= z 1.8e+44)))
t_2
(/ (- x (* y z)) t))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x / t) - (z * (y / t));
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.2e+74) {
tmp = t_2;
} else if (z <= -7e-166) {
tmp = t_1;
} else if (z <= 7e-108) {
tmp = x / (t - (a * z));
} else if (z <= 7.5e-16) {
tmp = t_1;
} else if ((z <= 0.00064) || !(z <= 1.8e+44)) {
tmp = t_2;
} 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) :: t_2
real(8) :: tmp
t_1 = (x / t) - (z * (y / t))
t_2 = (y - (x / z)) / a
if (z <= (-1.2d+74)) then
tmp = t_2
else if (z <= (-7d-166)) then
tmp = t_1
else if (z <= 7d-108) then
tmp = x / (t - (a * z))
else if (z <= 7.5d-16) then
tmp = t_1
else if ((z <= 0.00064d0) .or. (.not. (z <= 1.8d+44))) then
tmp = t_2
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 = (x / t) - (z * (y / t));
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.2e+74) {
tmp = t_2;
} else if (z <= -7e-166) {
tmp = t_1;
} else if (z <= 7e-108) {
tmp = x / (t - (a * z));
} else if (z <= 7.5e-16) {
tmp = t_1;
} else if ((z <= 0.00064) || !(z <= 1.8e+44)) {
tmp = t_2;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x / t) - (z * (y / t)) t_2 = (y - (x / z)) / a tmp = 0 if z <= -1.2e+74: tmp = t_2 elif z <= -7e-166: tmp = t_1 elif z <= 7e-108: tmp = x / (t - (a * z)) elif z <= 7.5e-16: tmp = t_1 elif (z <= 0.00064) or not (z <= 1.8e+44): tmp = t_2 else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x / t) - Float64(z * Float64(y / t))) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1.2e+74) tmp = t_2; elseif (z <= -7e-166) tmp = t_1; elseif (z <= 7e-108) tmp = Float64(x / Float64(t - Float64(a * z))); elseif (z <= 7.5e-16) tmp = t_1; elseif ((z <= 0.00064) || !(z <= 1.8e+44)) tmp = t_2; else tmp = Float64(Float64(x - Float64(y * z)) / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x / t) - (z * (y / t)); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -1.2e+74) tmp = t_2; elseif (z <= -7e-166) tmp = t_1; elseif (z <= 7e-108) tmp = x / (t - (a * z)); elseif (z <= 7.5e-16) tmp = t_1; elseif ((z <= 0.00064) || ~((z <= 1.8e+44))) tmp = t_2; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / t), $MachinePrecision] - N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.2e+74], t$95$2, If[LessEqual[z, -7e-166], t$95$1, If[LessEqual[z, 7e-108], N[(x / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.5e-16], t$95$1, If[Or[LessEqual[z, 0.00064], N[Not[LessEqual[z, 1.8e+44]], $MachinePrecision]], t$95$2, N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{t} - z \cdot \frac{y}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.2 \cdot 10^{+74}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-166}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{t - a \cdot z}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.00064 \lor \neg \left(z \leq 1.8 \cdot 10^{+44}\right):\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.20000000000000004e74 or 7.5e-16 < z < 6.40000000000000052e-4 or 1.8e44 < z Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in x around 0 70.4%
fma-def70.4%
associate-/l*79.6%
*-commutative79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in a around inf 78.1%
mul-1-neg78.1%
unsub-neg78.1%
Simplified78.1%
if -1.20000000000000004e74 < z < -6.9999999999999998e-166 or 6.9999999999999997e-108 < z < 7.5e-16Initial program 91.7%
*-commutative91.7%
Simplified91.7%
Taylor expanded in t around inf 70.5%
div-sub70.4%
*-commutative70.4%
associate-/l*75.1%
Applied egg-rr75.1%
clear-num75.0%
associate-/r/75.0%
clear-num75.1%
Applied egg-rr75.1%
if -6.9999999999999998e-166 < z < 6.9999999999999997e-108Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 87.0%
*-commutative87.0%
Simplified87.0%
if 6.40000000000000052e-4 < z < 1.8e44Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 69.6%
Final simplification79.2%
(FPCore (x y z t a)
:precision binary64
(if (or (<= z -1.25e+74)
(and (not (<= z 1.45e-13)) (or (<= z 5.9e-5) (not (<= z 1.3e+44)))))
(/ (- y (/ x z)) a)
(/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.25e+74) || (!(z <= 1.45e-13) && ((z <= 5.9e-5) || !(z <= 1.3e+44)))) {
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 <= (-1.25d+74)) .or. (.not. (z <= 1.45d-13)) .and. (z <= 5.9d-5) .or. (.not. (z <= 1.3d+44))) 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 <= -1.25e+74) || (!(z <= 1.45e-13) && ((z <= 5.9e-5) || !(z <= 1.3e+44)))) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.25e+74) or (not (z <= 1.45e-13) and ((z <= 5.9e-5) or not (z <= 1.3e+44))): 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 <= -1.25e+74) || (!(z <= 1.45e-13) && ((z <= 5.9e-5) || !(z <= 1.3e+44)))) 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 <= -1.25e+74) || (~((z <= 1.45e-13)) && ((z <= 5.9e-5) || ~((z <= 1.3e+44))))) 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, -1.25e+74], And[N[Not[LessEqual[z, 1.45e-13]], $MachinePrecision], Or[LessEqual[z, 5.9e-5], N[Not[LessEqual[z, 1.3e+44]], $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 -1.25 \cdot 10^{+74} \lor \neg \left(z \leq 1.45 \cdot 10^{-13}\right) \land \left(z \leq 5.9 \cdot 10^{-5} \lor \neg \left(z \leq 1.3 \cdot 10^{+44}\right)\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.24999999999999991e74 or 1.4499999999999999e-13 < z < 5.8999999999999998e-5 or 1.3e44 < z Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in x around 0 70.4%
fma-def70.4%
associate-/l*79.6%
*-commutative79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in a around inf 78.1%
mul-1-neg78.1%
unsub-neg78.1%
Simplified78.1%
if -1.24999999999999991e74 < z < 1.4499999999999999e-13 or 5.8999999999999998e-5 < z < 1.3e44Initial program 96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in t around inf 77.2%
Final simplification77.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -1.06e+74)
t_1
(if (<= z 8.5e-14)
(- (/ x t) (/ z (/ t y)))
(if (or (<= z 0.000112) (not (<= z 7.8e+43)))
t_1
(/ (- x (* y z)) t))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -1.06e+74) {
tmp = t_1;
} else if (z <= 8.5e-14) {
tmp = (x / t) - (z / (t / y));
} else if ((z <= 0.000112) || !(z <= 7.8e+43)) {
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 - (x / z)) / a
if (z <= (-1.06d+74)) then
tmp = t_1
else if (z <= 8.5d-14) then
tmp = (x / t) - (z / (t / y))
else if ((z <= 0.000112d0) .or. (.not. (z <= 7.8d+43))) 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 - (x / z)) / a;
double tmp;
if (z <= -1.06e+74) {
tmp = t_1;
} else if (z <= 8.5e-14) {
tmp = (x / t) - (z / (t / y));
} else if ((z <= 0.000112) || !(z <= 7.8e+43)) {
tmp = t_1;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -1.06e+74: tmp = t_1 elif z <= 8.5e-14: tmp = (x / t) - (z / (t / y)) elif (z <= 0.000112) or not (z <= 7.8e+43): tmp = t_1 else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1.06e+74) tmp = t_1; elseif (z <= 8.5e-14) tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); elseif ((z <= 0.000112) || !(z <= 7.8e+43)) 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 - (x / z)) / a; tmp = 0.0; if (z <= -1.06e+74) tmp = t_1; elseif (z <= 8.5e-14) tmp = (x / t) - (z / (t / y)); elseif ((z <= 0.000112) || ~((z <= 7.8e+43))) 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[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.06e+74], t$95$1, If[LessEqual[z, 8.5e-14], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, 0.000112], N[Not[LessEqual[z, 7.8e+43]], $MachinePrecision]], t$95$1, N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.06 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 0.000112 \lor \neg \left(z \leq 7.8 \cdot 10^{+43}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -1.05999999999999999e74 or 8.50000000000000038e-14 < z < 1.11999999999999998e-4 or 7.8000000000000001e43 < z Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in x around 0 70.4%
fma-def70.4%
associate-/l*79.6%
*-commutative79.6%
*-commutative79.6%
Simplified79.6%
Taylor expanded in a around inf 78.1%
mul-1-neg78.1%
unsub-neg78.1%
Simplified78.1%
if -1.05999999999999999e74 < z < 8.50000000000000038e-14Initial program 96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 78.0%
div-sub78.0%
*-commutative78.0%
associate-/l*78.7%
Applied egg-rr78.7%
if 1.11999999999999998e-4 < z < 7.8000000000000001e43Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 69.6%
Final simplification77.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -1.3e+74)
t_1
(if (<= z 8.5e-24)
(- (/ x t) (/ z (/ t y)))
(if (<= z 1.4e+44) (* z (/ (- y) (- t (* a z)))) 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 <= -1.3e+74) {
tmp = t_1;
} else if (z <= 8.5e-24) {
tmp = (x / t) - (z / (t / y));
} else if (z <= 1.4e+44) {
tmp = z * (-y / (t - (a * z)));
} 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 <= (-1.3d+74)) then
tmp = t_1
else if (z <= 8.5d-24) then
tmp = (x / t) - (z / (t / y))
else if (z <= 1.4d+44) then
tmp = z * (-y / (t - (a * z)))
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 <= -1.3e+74) {
tmp = t_1;
} else if (z <= 8.5e-24) {
tmp = (x / t) - (z / (t / y));
} else if (z <= 1.4e+44) {
tmp = z * (-y / (t - (a * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -1.3e+74: tmp = t_1 elif z <= 8.5e-24: tmp = (x / t) - (z / (t / y)) elif z <= 1.4e+44: tmp = z * (-y / (t - (a * z))) 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 <= -1.3e+74) tmp = t_1; elseif (z <= 8.5e-24) tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); elseif (z <= 1.4e+44) tmp = Float64(z * Float64(Float64(-y) / Float64(t - Float64(a * z)))); 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 <= -1.3e+74) tmp = t_1; elseif (z <= 8.5e-24) tmp = (x / t) - (z / (t / y)); elseif (z <= 1.4e+44) tmp = z * (-y / (t - (a * z))); 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, -1.3e+74], t$95$1, If[LessEqual[z, 8.5e-24], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e+44], N[(z * N[((-y) / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.3 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-24}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{+44}:\\
\;\;\;\;z \cdot \frac{-y}{t - a \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.3e74 or 1.4e44 < z Initial program 68.9%
*-commutative68.9%
Simplified68.9%
Taylor expanded in x around 0 68.9%
fma-def68.9%
associate-/l*78.5%
*-commutative78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in a around inf 76.9%
mul-1-neg76.9%
unsub-neg76.9%
Simplified76.9%
if -1.3e74 < z < 8.5000000000000002e-24Initial program 96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 77.9%
div-sub77.8%
*-commutative77.8%
associate-/l*78.5%
Applied egg-rr78.5%
if 8.5000000000000002e-24 < z < 1.4e44Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around 0 85.8%
mul-1-neg85.8%
associate-/l*86.0%
associate-/r/85.7%
sub-neg85.7%
+-commutative85.7%
distribute-rgt-neg-in85.7%
fma-udef85.7%
distribute-rgt-neg-in85.7%
fma-udef85.7%
distribute-rgt-neg-in85.7%
+-commutative85.7%
sub-neg85.7%
*-commutative85.7%
Simplified85.7%
Final simplification78.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -1.1e+74)
t_1
(if (<= z 7.5e-15)
(- (/ x t) (/ z (/ t y)))
(if (<= z 1.45e+44) (/ (* y (- z)) (- t (* a z))) 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 <= -1.1e+74) {
tmp = t_1;
} else if (z <= 7.5e-15) {
tmp = (x / t) - (z / (t / y));
} else if (z <= 1.45e+44) {
tmp = (y * -z) / (t - (a * z));
} 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 <= (-1.1d+74)) then
tmp = t_1
else if (z <= 7.5d-15) then
tmp = (x / t) - (z / (t / y))
else if (z <= 1.45d+44) then
tmp = (y * -z) / (t - (a * z))
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 <= -1.1e+74) {
tmp = t_1;
} else if (z <= 7.5e-15) {
tmp = (x / t) - (z / (t / y));
} else if (z <= 1.45e+44) {
tmp = (y * -z) / (t - (a * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -1.1e+74: tmp = t_1 elif z <= 7.5e-15: tmp = (x / t) - (z / (t / y)) elif z <= 1.45e+44: tmp = (y * -z) / (t - (a * z)) 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 <= -1.1e+74) tmp = t_1; elseif (z <= 7.5e-15) tmp = Float64(Float64(x / t) - Float64(z / Float64(t / y))); elseif (z <= 1.45e+44) tmp = Float64(Float64(y * Float64(-z)) / Float64(t - Float64(a * z))); 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 <= -1.1e+74) tmp = t_1; elseif (z <= 7.5e-15) tmp = (x / t) - (z / (t / y)); elseif (z <= 1.45e+44) tmp = (y * -z) / (t - (a * z)); 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, -1.1e+74], t$95$1, If[LessEqual[z, 7.5e-15], N[(N[(x / t), $MachinePrecision] - N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+44], N[(N[(y * (-z)), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.1 \cdot 10^{+74}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{-15}:\\
\;\;\;\;\frac{x}{t} - \frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+44}:\\
\;\;\;\;\frac{y \cdot \left(-z\right)}{t - a \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.1000000000000001e74 or 1.4500000000000001e44 < z Initial program 68.9%
*-commutative68.9%
Simplified68.9%
Taylor expanded in x around 0 68.9%
fma-def68.9%
associate-/l*78.5%
*-commutative78.5%
*-commutative78.5%
Simplified78.5%
Taylor expanded in a around inf 76.9%
mul-1-neg76.9%
unsub-neg76.9%
Simplified76.9%
if -1.1000000000000001e74 < z < 7.4999999999999996e-15Initial program 96.0%
*-commutative96.0%
Simplified96.0%
Taylor expanded in t around inf 78.0%
div-sub78.0%
*-commutative78.0%
associate-/l*78.7%
Applied egg-rr78.7%
if 7.4999999999999996e-15 < z < 1.4500000000000001e44Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around 0 85.2%
mul-1-neg85.2%
*-commutative85.2%
distribute-rgt-neg-in85.2%
Simplified85.2%
Final simplification78.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.52e+102)
(/ y a)
(if (<= z -5.8e+37)
(* y (/ (- z) t))
(if (<= z 1.4e-12) (/ x (- t (* a z))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.52e+102) {
tmp = y / a;
} else if (z <= -5.8e+37) {
tmp = y * (-z / t);
} else if (z <= 1.4e-12) {
tmp = x / (t - (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 <= (-1.52d+102)) then
tmp = y / a
else if (z <= (-5.8d+37)) then
tmp = y * (-z / t)
else if (z <= 1.4d-12) then
tmp = x / (t - (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 <= -1.52e+102) {
tmp = y / a;
} else if (z <= -5.8e+37) {
tmp = y * (-z / t);
} else if (z <= 1.4e-12) {
tmp = x / (t - (a * z));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.52e+102: tmp = y / a elif z <= -5.8e+37: tmp = y * (-z / t) elif z <= 1.4e-12: tmp = x / (t - (a * z)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.52e+102) tmp = Float64(y / a); elseif (z <= -5.8e+37) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= 1.4e-12) tmp = Float64(x / Float64(t - 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 <= -1.52e+102) tmp = y / a; elseif (z <= -5.8e+37) tmp = y * (-z / t); elseif (z <= 1.4e-12) tmp = x / (t - (a * z)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.52e+102], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.8e+37], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.4e-12], N[(x / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.52 \cdot 10^{+102}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+37}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq 1.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{t - a \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.5199999999999999e102 or 1.4000000000000001e-12 < z Initial program 73.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in z around inf 60.7%
if -1.5199999999999999e102 < z < -5.79999999999999957e37Initial program 69.9%
*-commutative69.9%
Simplified69.9%
clear-num69.8%
associate-/r/69.9%
sub-neg69.9%
+-commutative69.9%
*-commutative69.9%
distribute-rgt-neg-in69.9%
fma-def69.9%
Applied egg-rr69.9%
Taylor expanded in a around 0 52.3%
Taylor expanded in x around 0 39.8%
mul-1-neg39.8%
associate-*r/55.1%
distribute-rgt-neg-in55.1%
distribute-neg-frac55.1%
Simplified55.1%
if -5.79999999999999957e37 < z < 1.4000000000000001e-12Initial program 98.9%
*-commutative98.9%
Simplified98.9%
Taylor expanded in x around inf 76.3%
*-commutative76.3%
Simplified76.3%
Final simplification67.1%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.1e+118) (not (<= z 3.5e+188))) (/ (- 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 <= -1.1e+118) || !(z <= 3.5e+188)) {
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 <= (-1.1d+118)) .or. (.not. (z <= 3.5d+188))) 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 <= -1.1e+118) || !(z <= 3.5e+188)) {
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 <= -1.1e+118) or not (z <= 3.5e+188): 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 <= -1.1e+118) || !(z <= 3.5e+188)) 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 <= -1.1e+118) || ~((z <= 3.5e+188))) 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[Or[LessEqual[z, -1.1e+118], N[Not[LessEqual[z, 3.5e+188]], $MachinePrecision]], 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 -1.1 \cdot 10^{+118} \lor \neg \left(z \leq 3.5 \cdot 10^{+188}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t - a \cdot z}\\
\end{array}
\end{array}
if z < -1.09999999999999993e118 or 3.50000000000000008e188 < z Initial program 60.0%
*-commutative60.0%
Simplified60.0%
Taylor expanded in x around 0 60.0%
fma-def60.0%
associate-/l*71.1%
*-commutative71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in a around inf 86.3%
mul-1-neg86.3%
unsub-neg86.3%
Simplified86.3%
if -1.09999999999999993e118 < z < 3.50000000000000008e188Initial program 92.4%
Final simplification90.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= a -2.2e-46) (not (<= a 8.5e+132))) (/ (- y (/ x z)) a) (- (/ x t) (* y (/ z t)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((a <= -2.2e-46) || !(a <= 8.5e+132)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (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 <= (-2.2d-46)) .or. (.not. (a <= 8.5d+132))) then
tmp = (y - (x / z)) / a
else
tmp = (x / t) - (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 <= -2.2e-46) || !(a <= 8.5e+132)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x / t) - (y * (z / t));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (a <= -2.2e-46) or not (a <= 8.5e+132): tmp = (y - (x / z)) / a else: tmp = (x / t) - (y * (z / t)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((a <= -2.2e-46) || !(a <= 8.5e+132)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x / t) - Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((a <= -2.2e-46) || ~((a <= 8.5e+132))) tmp = (y - (x / z)) / a; else tmp = (x / t) - (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[a, -2.2e-46], N[Not[LessEqual[a, 8.5e+132]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x / t), $MachinePrecision] - N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.2 \cdot 10^{-46} \lor \neg \left(a \leq 8.5 \cdot 10^{+132}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t} - y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if a < -2.2000000000000001e-46 or 8.49999999999999969e132 < a Initial program 71.3%
*-commutative71.3%
Simplified71.3%
Taylor expanded in x around 0 71.4%
fma-def71.4%
associate-/l*73.8%
*-commutative73.8%
*-commutative73.8%
Simplified73.8%
Taylor expanded in a around inf 78.3%
mul-1-neg78.3%
unsub-neg78.3%
Simplified78.3%
if -2.2000000000000001e-46 < a < 8.49999999999999969e132Initial program 92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 69.0%
div-sub69.0%
sub-neg69.0%
*-commutative69.0%
associate-/l*70.1%
Applied egg-rr70.1%
sub-neg70.1%
associate-/r/71.9%
Simplified71.9%
Final simplification74.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -5e+102) (/ y a) (if (<= z -1.2e+19) (* y (/ (- z) t)) (if (<= z 4.8e-14) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5e+102) {
tmp = y / a;
} else if (z <= -1.2e+19) {
tmp = y * (-z / t);
} else if (z <= 4.8e-14) {
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 <= (-5d+102)) then
tmp = y / a
else if (z <= (-1.2d+19)) then
tmp = y * (-z / t)
else if (z <= 4.8d-14) 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 <= -5e+102) {
tmp = y / a;
} else if (z <= -1.2e+19) {
tmp = y * (-z / t);
} else if (z <= 4.8e-14) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5e+102: tmp = y / a elif z <= -1.2e+19: tmp = y * (-z / t) elif z <= 4.8e-14: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5e+102) tmp = Float64(y / a); elseif (z <= -1.2e+19) tmp = Float64(y * Float64(Float64(-z) / t)); elseif (z <= 4.8e-14) 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 <= -5e+102) tmp = y / a; elseif (z <= -1.2e+19) tmp = y * (-z / t); elseif (z <= 4.8e-14) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5e+102], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.2e+19], N[(y * N[((-z) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.8e-14], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+102}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.2 \cdot 10^{+19}:\\
\;\;\;\;y \cdot \frac{-z}{t}\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5e102 or 4.8e-14 < z Initial program 73.6%
*-commutative73.6%
Simplified73.6%
Taylor expanded in z around inf 60.7%
if -5e102 < z < -1.2e19Initial program 70.9%
*-commutative70.9%
Simplified70.9%
clear-num70.8%
associate-/r/70.8%
sub-neg70.8%
+-commutative70.8%
*-commutative70.8%
distribute-rgt-neg-in70.8%
fma-def70.8%
Applied egg-rr70.8%
Taylor expanded in a around 0 52.2%
Taylor expanded in x around 0 41.6%
mul-1-neg41.6%
associate-*r/54.4%
distribute-rgt-neg-in54.4%
distribute-neg-frac54.4%
Simplified54.4%
if -1.2e19 < z < 4.8e-14Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 65.8%
Final simplification62.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -4.2e+102) (not (<= z 8.2e+43))) (/ y a) (/ (- x (* y z)) t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -4.2e+102) || !(z <= 8.2e+43)) {
tmp = y / 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 <= (-4.2d+102)) .or. (.not. (z <= 8.2d+43))) then
tmp = y / 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 <= -4.2e+102) || !(z <= 8.2e+43)) {
tmp = y / a;
} else {
tmp = (x - (y * z)) / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -4.2e+102) or not (z <= 8.2e+43): tmp = y / a else: tmp = (x - (y * z)) / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -4.2e+102) || !(z <= 8.2e+43)) tmp = Float64(y / 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 <= -4.2e+102) || ~((z <= 8.2e+43))) tmp = y / a; else tmp = (x - (y * z)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -4.2e+102], N[Not[LessEqual[z, 8.2e+43]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{+102} \lor \neg \left(z \leq 8.2 \cdot 10^{+43}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - y \cdot z}{t}\\
\end{array}
\end{array}
if z < -4.20000000000000003e102 or 8.2000000000000001e43 < z Initial program 68.4%
*-commutative68.4%
Simplified68.4%
Taylor expanded in z around inf 63.5%
if -4.20000000000000003e102 < z < 8.2000000000000001e43Initial program 94.9%
*-commutative94.9%
Simplified94.9%
Taylor expanded in t around inf 71.7%
Final simplification68.5%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9500000.0) (not (<= z 2.6e-15))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9500000.0) || !(z <= 2.6e-15)) {
tmp = y / a;
} 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) :: tmp
if ((z <= (-9500000.0d0)) .or. (.not. (z <= 2.6d-15))) then
tmp = y / a
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 tmp;
if ((z <= -9500000.0) || !(z <= 2.6e-15)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9500000.0) or not (z <= 2.6e-15): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9500000.0) || !(z <= 2.6e-15)) tmp = Float64(y / a); else tmp = Float64(x / t); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9500000.0) || ~((z <= 2.6e-15))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9500000.0], N[Not[LessEqual[z, 2.6e-15]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9500000 \lor \neg \left(z \leq 2.6 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -9.5e6 or 2.60000000000000004e-15 < z Initial program 73.4%
*-commutative73.4%
Simplified73.4%
Taylor expanded in z around inf 54.8%
if -9.5e6 < z < 2.60000000000000004e-15Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 66.9%
Final simplification59.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 84.4%
*-commutative84.4%
Simplified84.4%
Taylor expanded in z around 0 37.0%
Final simplification37.0%
(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 2024027
(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))))