
(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 (if (or (<= z -2.1e+107) (not (<= z 2.7e+135))) (/ (- y (/ x z)) a) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+107) || !(z <= 2.7e+135)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * 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+107)) .or. (.not. (z <= 2.7d+135))) then
tmp = (y - (x / z)) / a
else
tmp = (x - (z * y)) / (t - (z * 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+107) || !(z <= 2.7e+135)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+107) or not (z <= 2.7e+135): tmp = (y - (x / z)) / a else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+107) || !(z <= 2.7e+135)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e+107) || ~((z <= 2.7e+135))) tmp = (y - (x / z)) / a; else tmp = (x - (z * y)) / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+107], N[Not[LessEqual[z, 2.7e+135]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+107} \lor \neg \left(z \leq 2.7 \cdot 10^{+135}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -2.1e107 or 2.69999999999999985e135 < z Initial program 57.2%
*-commutative57.2%
Simplified57.2%
Taylor expanded in t around 0 48.2%
associate-*r/48.2%
*-commutative48.2%
associate-/r*66.0%
associate-*r/66.0%
mul-1-neg66.0%
div-sub66.0%
associate-/l*85.6%
*-inverses85.6%
Simplified85.6%
Taylor expanded in x around 0 82.4%
+-commutative82.4%
mul-1-neg82.4%
sub-neg82.4%
associate-/l/85.6%
div-sub85.6%
Simplified85.6%
if -2.1e107 < z < 2.69999999999999985e135Initial program 97.5%
Final simplification93.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ x (* z (- a)))))
(if (<= z -1.25e+107)
(/ y a)
(if (<= z -7.4e+44)
t_1
(if (<= z -4e+25)
(/ y a)
(if (<= z -3.1e-23)
(* y (/ z (- t)))
(if (<= z -4e-109) t_1 (if (<= z 4.35e+77) (/ x t) (/ y a)))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x / (z * -a);
double tmp;
if (z <= -1.25e+107) {
tmp = y / a;
} else if (z <= -7.4e+44) {
tmp = t_1;
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -3.1e-23) {
tmp = y * (z / -t);
} else if (z <= -4e-109) {
tmp = t_1;
} else if (z <= 4.35e+77) {
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) :: t_1
real(8) :: tmp
t_1 = x / (z * -a)
if (z <= (-1.25d+107)) then
tmp = y / a
else if (z <= (-7.4d+44)) then
tmp = t_1
else if (z <= (-4d+25)) then
tmp = y / a
else if (z <= (-3.1d-23)) then
tmp = y * (z / -t)
else if (z <= (-4d-109)) then
tmp = t_1
else if (z <= 4.35d+77) 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 t_1 = x / (z * -a);
double tmp;
if (z <= -1.25e+107) {
tmp = y / a;
} else if (z <= -7.4e+44) {
tmp = t_1;
} else if (z <= -4e+25) {
tmp = y / a;
} else if (z <= -3.1e-23) {
tmp = y * (z / -t);
} else if (z <= -4e-109) {
tmp = t_1;
} else if (z <= 4.35e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x / (z * -a) tmp = 0 if z <= -1.25e+107: tmp = y / a elif z <= -7.4e+44: tmp = t_1 elif z <= -4e+25: tmp = y / a elif z <= -3.1e-23: tmp = y * (z / -t) elif z <= -4e-109: tmp = t_1 elif z <= 4.35e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(x / Float64(z * Float64(-a))) tmp = 0.0 if (z <= -1.25e+107) tmp = Float64(y / a); elseif (z <= -7.4e+44) tmp = t_1; elseif (z <= -4e+25) tmp = Float64(y / a); elseif (z <= -3.1e-23) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= -4e-109) tmp = t_1; elseif (z <= 4.35e+77) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x / (z * -a); tmp = 0.0; if (z <= -1.25e+107) tmp = y / a; elseif (z <= -7.4e+44) tmp = t_1; elseif (z <= -4e+25) tmp = y / a; elseif (z <= -3.1e-23) tmp = y * (z / -t); elseif (z <= -4e-109) tmp = t_1; elseif (z <= 4.35e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.25e+107], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.4e+44], t$95$1, If[LessEqual[z, -4e+25], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.1e-23], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4e-109], t$95$1, If[LessEqual[z, 4.35e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z \cdot \left(-a\right)}\\
\mathbf{if}\;z \leq -1.25 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{+44}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+25}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-23}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{-109}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.35 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.25e107 or -7.4000000000000002e44 < z < -4.00000000000000036e25 or 4.3500000000000003e77 < z Initial program 60.9%
*-commutative60.9%
Simplified60.9%
Taylor expanded in z around inf 74.0%
if -1.25e107 < z < -7.4000000000000002e44 or -3.0999999999999999e-23 < z < -4e-109Initial program 90.9%
*-commutative90.9%
Simplified90.9%
Taylor expanded in x around inf 62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in t around 0 50.3%
associate-*r/50.3%
neg-mul-150.3%
Simplified50.3%
if -4.00000000000000036e25 < z < -3.0999999999999999e-23Initial program 99.8%
*-commutative99.8%
Simplified99.8%
clear-num98.8%
associate-/r/99.5%
sub-neg99.5%
+-commutative99.5%
*-commutative99.5%
distribute-rgt-neg-in99.5%
fma-define99.5%
Applied egg-rr99.5%
Taylor expanded in a around 0 90.0%
Taylor expanded in x around 0 60.3%
mul-1-neg60.3%
associate-/l*60.3%
distribute-rgt-neg-in60.3%
distribute-neg-frac260.3%
Simplified60.3%
if -4e-109 < z < 4.3500000000000003e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.4%
Final simplification63.1%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (/ x (- t (* z a)))))
(if (<= z -1.7e+107)
(/ y a)
(if (<= z -7.5e-110)
t_2
(if (<= z -3.1e-173)
t_1
(if (<= z 5.5e-16) t_2 (if (<= z 2.3e+78) t_1 (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = x / (t - (z * a));
double tmp;
if (z <= -1.7e+107) {
tmp = y / a;
} else if (z <= -7.5e-110) {
tmp = t_2;
} else if (z <= -3.1e-173) {
tmp = t_1;
} else if (z <= 5.5e-16) {
tmp = t_2;
} else if (z <= 2.3e+78) {
tmp = t_1;
} 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (x - (z * y)) / t
t_2 = x / (t - (z * a))
if (z <= (-1.7d+107)) then
tmp = y / a
else if (z <= (-7.5d-110)) then
tmp = t_2
else if (z <= (-3.1d-173)) then
tmp = t_1
else if (z <= 5.5d-16) then
tmp = t_2
else if (z <= 2.3d+78) then
tmp = t_1
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 t_1 = (x - (z * y)) / t;
double t_2 = x / (t - (z * a));
double tmp;
if (z <= -1.7e+107) {
tmp = y / a;
} else if (z <= -7.5e-110) {
tmp = t_2;
} else if (z <= -3.1e-173) {
tmp = t_1;
} else if (z <= 5.5e-16) {
tmp = t_2;
} else if (z <= 2.3e+78) {
tmp = t_1;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t t_2 = x / (t - (z * a)) tmp = 0 if z <= -1.7e+107: tmp = y / a elif z <= -7.5e-110: tmp = t_2 elif z <= -3.1e-173: tmp = t_1 elif z <= 5.5e-16: tmp = t_2 elif z <= 2.3e+78: tmp = t_1 else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) t_2 = Float64(x / Float64(t - Float64(z * a))) tmp = 0.0 if (z <= -1.7e+107) tmp = Float64(y / a); elseif (z <= -7.5e-110) tmp = t_2; elseif (z <= -3.1e-173) tmp = t_1; elseif (z <= 5.5e-16) tmp = t_2; elseif (z <= 2.3e+78) tmp = t_1; else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (z * y)) / t; t_2 = x / (t - (z * a)); tmp = 0.0; if (z <= -1.7e+107) tmp = y / a; elseif (z <= -7.5e-110) tmp = t_2; elseif (z <= -3.1e-173) tmp = t_1; elseif (z <= 5.5e-16) tmp = t_2; elseif (z <= 2.3e+78) tmp = t_1; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.7e+107], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.5e-110], t$95$2, If[LessEqual[z, -3.1e-173], t$95$1, If[LessEqual[z, 5.5e-16], t$95$2, If[LessEqual[z, 2.3e+78], t$95$1, N[(y / a), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
t_2 := \frac{x}{t - z \cdot a}\\
\mathbf{if}\;z \leq -1.7 \cdot 10^{+107}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.5 \cdot 10^{-110}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.1 \cdot 10^{-173}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-16}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+78}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.6999999999999998e107 or 2.3000000000000002e78 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -1.6999999999999998e107 < z < -7.50000000000000053e-110 or -3.10000000000000005e-173 < z < 5.49999999999999964e-16Initial program 97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in x around inf 76.7%
*-commutative76.7%
Simplified76.7%
if -7.50000000000000053e-110 < z < -3.10000000000000005e-173 or 5.49999999999999964e-16 < z < 2.3000000000000002e78Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 82.1%
Final simplification76.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- x (* z y)) t)) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -9e+29)
t_2
(if (<= z -3.5e-27)
t_1
(if (<= z -2e-84)
t_2
(if (<= z 5.4e-16)
(/ x (- t (* z a)))
(if (<= z 3.6e+77) t_1 t_2)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x - (z * y)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -9e+29) {
tmp = t_2;
} else if (z <= -3.5e-27) {
tmp = t_1;
} else if (z <= -2e-84) {
tmp = t_2;
} else if (z <= 5.4e-16) {
tmp = x / (t - (z * a));
} else if (z <= 3.6e+77) {
tmp = 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 = (x - (z * y)) / t
t_2 = (y - (x / z)) / a
if (z <= (-9d+29)) then
tmp = t_2
else if (z <= (-3.5d-27)) then
tmp = t_1
else if (z <= (-2d-84)) then
tmp = t_2
else if (z <= 5.4d-16) then
tmp = x / (t - (z * a))
else if (z <= 3.6d+77) then
tmp = 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 = (x - (z * y)) / t;
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -9e+29) {
tmp = t_2;
} else if (z <= -3.5e-27) {
tmp = t_1;
} else if (z <= -2e-84) {
tmp = t_2;
} else if (z <= 5.4e-16) {
tmp = x / (t - (z * a));
} else if (z <= 3.6e+77) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x - (z * y)) / t t_2 = (y - (x / z)) / a tmp = 0 if z <= -9e+29: tmp = t_2 elif z <= -3.5e-27: tmp = t_1 elif z <= -2e-84: tmp = t_2 elif z <= 5.4e-16: tmp = x / (t - (z * a)) elif z <= 3.6e+77: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x - Float64(z * y)) / t) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -9e+29) tmp = t_2; elseif (z <= -3.5e-27) tmp = t_1; elseif (z <= -2e-84) tmp = t_2; elseif (z <= 5.4e-16) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 3.6e+77) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (x - (z * y)) / t; t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -9e+29) tmp = t_2; elseif (z <= -3.5e-27) tmp = t_1; elseif (z <= -2e-84) tmp = t_2; elseif (z <= 5.4e-16) tmp = x / (t - (z * a)); elseif (z <= 3.6e+77) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -9e+29], t$95$2, If[LessEqual[z, -3.5e-27], t$95$1, If[LessEqual[z, -2e-84], t$95$2, If[LessEqual[z, 5.4e-16], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+77], t$95$1, t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x - z \cdot y}{t}\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -9 \cdot 10^{+29}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -2 \cdot 10^{-84}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;z \leq 5.4 \cdot 10^{-16}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+77}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if z < -9.0000000000000005e29 or -3.5000000000000001e-27 < z < -2.0000000000000001e-84 or 3.5999999999999998e77 < z Initial program 67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in t around 0 53.8%
associate-*r/53.8%
*-commutative53.8%
associate-/r*68.2%
associate-*r/68.2%
mul-1-neg68.2%
div-sub68.2%
associate-/l*82.4%
*-inverses82.4%
Simplified82.4%
Taylor expanded in x around 0 78.7%
+-commutative78.7%
mul-1-neg78.7%
sub-neg78.7%
associate-/l/82.4%
div-sub82.4%
Simplified82.4%
if -9.0000000000000005e29 < z < -3.5000000000000001e-27 or 5.39999999999999999e-16 < z < 3.5999999999999998e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 80.5%
if -2.0000000000000001e-84 < z < 5.39999999999999999e-16Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in x around inf 82.4%
*-commutative82.4%
Simplified82.4%
Final simplification82.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+106)
(/ y a)
(if (<= z -3500000.0)
(/ (/ x a) (- z))
(if (<= z -2.2e-22)
(* z (/ y (- t)))
(if (<= z -2.5e-108)
(/ x (* z (- a)))
(if (<= z 3.6e+77) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+106) {
tmp = y / a;
} else if (z <= -3500000.0) {
tmp = (x / a) / -z;
} else if (z <= -2.2e-22) {
tmp = z * (y / -t);
} else if (z <= -2.5e-108) {
tmp = x / (z * -a);
} else if (z <= 3.6e+77) {
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 <= (-6.6d+106)) then
tmp = y / a
else if (z <= (-3500000.0d0)) then
tmp = (x / a) / -z
else if (z <= (-2.2d-22)) then
tmp = z * (y / -t)
else if (z <= (-2.5d-108)) then
tmp = x / (z * -a)
else if (z <= 3.6d+77) 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 <= -6.6e+106) {
tmp = y / a;
} else if (z <= -3500000.0) {
tmp = (x / a) / -z;
} else if (z <= -2.2e-22) {
tmp = z * (y / -t);
} else if (z <= -2.5e-108) {
tmp = x / (z * -a);
} else if (z <= 3.6e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+106: tmp = y / a elif z <= -3500000.0: tmp = (x / a) / -z elif z <= -2.2e-22: tmp = z * (y / -t) elif z <= -2.5e-108: tmp = x / (z * -a) elif z <= 3.6e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+106) tmp = Float64(y / a); elseif (z <= -3500000.0) tmp = Float64(Float64(x / a) / Float64(-z)); elseif (z <= -2.2e-22) tmp = Float64(z * Float64(y / Float64(-t))); elseif (z <= -2.5e-108) tmp = Float64(x / Float64(z * Float64(-a))); elseif (z <= 3.6e+77) 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 <= -6.6e+106) tmp = y / a; elseif (z <= -3500000.0) tmp = (x / a) / -z; elseif (z <= -2.2e-22) tmp = z * (y / -t); elseif (z <= -2.5e-108) tmp = x / (z * -a); elseif (z <= 3.6e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+106], N[(y / a), $MachinePrecision], If[LessEqual[z, -3500000.0], N[(N[(x / a), $MachinePrecision] / (-z)), $MachinePrecision], If[LessEqual[z, -2.2e-22], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.5e-108], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3500000:\\
\;\;\;\;\frac{\frac{x}{a}}{-z}\\
\mathbf{elif}\;z \leq -2.2 \cdot 10^{-22}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq -2.5 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.60000000000000015e106 or 3.5999999999999998e77 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -6.60000000000000015e106 < z < -3.5e6Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in a around inf 77.0%
Taylor expanded in x around inf 59.3%
associate-/r*50.6%
Simplified50.6%
Taylor expanded in t around 0 45.7%
mul-1-neg45.7%
Simplified45.7%
if -3.5e6 < z < -2.2000000000000001e-22Initial program 99.8%
*-commutative99.8%
Simplified99.8%
clear-num98.4%
associate-/r/99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around 0 71.4%
mul-1-neg71.4%
associate-/l*71.4%
distribute-rgt-neg-in71.4%
distribute-neg-frac271.4%
Simplified71.4%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
associate-*r/71.4%
*-commutative71.4%
associate-*l/71.4%
associate-*r/71.6%
distribute-rgt-neg-in71.6%
distribute-neg-frac271.6%
Simplified71.6%
if -2.2000000000000001e-22 < z < -2.5e-108Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in t around 0 57.1%
associate-*r/57.1%
neg-mul-157.1%
Simplified57.1%
if -2.5e-108 < z < 3.5999999999999998e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.4%
Final simplification63.1%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6.6e+106)
(/ y a)
(if (<= z -195000000.0)
(/ (/ x z) (- a))
(if (<= z -2.02e-22)
(* z (/ y (- t)))
(if (<= z -1.02e-108)
(/ x (* z (- a)))
(if (<= z 4e+77) (/ x t) (/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6.6e+106) {
tmp = y / a;
} else if (z <= -195000000.0) {
tmp = (x / z) / -a;
} else if (z <= -2.02e-22) {
tmp = z * (y / -t);
} else if (z <= -1.02e-108) {
tmp = x / (z * -a);
} else if (z <= 4e+77) {
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 <= (-6.6d+106)) then
tmp = y / a
else if (z <= (-195000000.0d0)) then
tmp = (x / z) / -a
else if (z <= (-2.02d-22)) then
tmp = z * (y / -t)
else if (z <= (-1.02d-108)) then
tmp = x / (z * -a)
else if (z <= 4d+77) 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 <= -6.6e+106) {
tmp = y / a;
} else if (z <= -195000000.0) {
tmp = (x / z) / -a;
} else if (z <= -2.02e-22) {
tmp = z * (y / -t);
} else if (z <= -1.02e-108) {
tmp = x / (z * -a);
} else if (z <= 4e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6.6e+106: tmp = y / a elif z <= -195000000.0: tmp = (x / z) / -a elif z <= -2.02e-22: tmp = z * (y / -t) elif z <= -1.02e-108: tmp = x / (z * -a) elif z <= 4e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6.6e+106) tmp = Float64(y / a); elseif (z <= -195000000.0) tmp = Float64(Float64(x / z) / Float64(-a)); elseif (z <= -2.02e-22) tmp = Float64(z * Float64(y / Float64(-t))); elseif (z <= -1.02e-108) tmp = Float64(x / Float64(z * Float64(-a))); elseif (z <= 4e+77) 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 <= -6.6e+106) tmp = y / a; elseif (z <= -195000000.0) tmp = (x / z) / -a; elseif (z <= -2.02e-22) tmp = z * (y / -t); elseif (z <= -1.02e-108) tmp = x / (z * -a); elseif (z <= 4e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6.6e+106], N[(y / a), $MachinePrecision], If[LessEqual[z, -195000000.0], N[(N[(x / z), $MachinePrecision] / (-a)), $MachinePrecision], If[LessEqual[z, -2.02e-22], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.02e-108], N[(x / N[(z * (-a)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.6 \cdot 10^{+106}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -195000000:\\
\;\;\;\;\frac{\frac{x}{z}}{-a}\\
\mathbf{elif}\;z \leq -2.02 \cdot 10^{-22}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{-108}:\\
\;\;\;\;\frac{x}{z \cdot \left(-a\right)}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.60000000000000015e106 or 3.99999999999999993e77 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -6.60000000000000015e106 < z < -1.95e8Initial program 86.0%
*-commutative86.0%
Simplified86.0%
Taylor expanded in x around inf 59.3%
*-commutative59.3%
Simplified59.3%
Taylor expanded in t around 0 40.7%
mul-1-neg40.7%
associate-/l/49.9%
distribute-neg-frac49.9%
distribute-neg-frac249.9%
Simplified49.9%
if -1.95e8 < z < -2.02e-22Initial program 99.8%
*-commutative99.8%
Simplified99.8%
clear-num98.4%
associate-/r/99.8%
sub-neg99.8%
+-commutative99.8%
*-commutative99.8%
distribute-rgt-neg-in99.8%
fma-define99.8%
Applied egg-rr99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in x around 0 71.4%
mul-1-neg71.4%
associate-/l*71.4%
distribute-rgt-neg-in71.4%
distribute-neg-frac271.4%
Simplified71.4%
Taylor expanded in y around 0 71.4%
mul-1-neg71.4%
associate-*r/71.4%
*-commutative71.4%
associate-*l/71.4%
associate-*r/71.6%
distribute-rgt-neg-in71.6%
distribute-neg-frac271.6%
Simplified71.6%
if -2.02e-22 < z < -1.02000000000000008e-108Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 63.3%
*-commutative63.3%
Simplified63.3%
Taylor expanded in t around 0 57.1%
associate-*r/57.1%
neg-mul-157.1%
Simplified57.1%
if -1.02000000000000008e-108 < z < 3.99999999999999993e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.4%
Final simplification63.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.5e+70)
(/ y a)
(if (<= z -4.5e-110)
(* y (/ z (- t)))
(if (<= z 3.6e+77) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.5e+70) {
tmp = y / a;
} else if (z <= -4.5e-110) {
tmp = y * (z / -t);
} else if (z <= 3.6e+77) {
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 <= (-5.5d+70)) then
tmp = y / a
else if (z <= (-4.5d-110)) then
tmp = y * (z / -t)
else if (z <= 3.6d+77) 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 <= -5.5e+70) {
tmp = y / a;
} else if (z <= -4.5e-110) {
tmp = y * (z / -t);
} else if (z <= 3.6e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.5e+70: tmp = y / a elif z <= -4.5e-110: tmp = y * (z / -t) elif z <= 3.6e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.5e+70) tmp = Float64(y / a); elseif (z <= -4.5e-110) tmp = Float64(y * Float64(z / Float64(-t))); elseif (z <= 3.6e+77) 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 <= -5.5e+70) tmp = y / a; elseif (z <= -4.5e-110) tmp = y * (z / -t); elseif (z <= 3.6e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.5e+70], N[(y / a), $MachinePrecision], If[LessEqual[z, -4.5e-110], N[(y * N[(z / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.5 \cdot 10^{+70}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4.5 \cdot 10^{-110}:\\
\;\;\;\;y \cdot \frac{z}{-t}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.49999999999999986e70 or 3.5999999999999998e77 < z Initial program 61.7%
*-commutative61.7%
Simplified61.7%
Taylor expanded in z around inf 70.0%
if -5.49999999999999986e70 < z < -4.5000000000000001e-110Initial program 97.0%
*-commutative97.0%
Simplified97.0%
clear-num96.8%
associate-/r/96.8%
sub-neg96.8%
+-commutative96.8%
*-commutative96.8%
distribute-rgt-neg-in96.8%
fma-define96.8%
Applied egg-rr96.8%
Taylor expanded in a around 0 49.8%
Taylor expanded in x around 0 36.8%
mul-1-neg36.8%
associate-/l*36.9%
distribute-rgt-neg-in36.9%
distribute-neg-frac236.9%
Simplified36.9%
if -4.5000000000000001e-110 < z < 3.5999999999999998e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.9%
Final simplification59.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2e+60)
(/ y a)
(if (<= z -7.2e-110)
(* z (/ y (- t)))
(if (<= z 3.6e+77) (/ x t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2e+60) {
tmp = y / a;
} else if (z <= -7.2e-110) {
tmp = z * (y / -t);
} else if (z <= 3.6e+77) {
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 <= (-2d+60)) then
tmp = y / a
else if (z <= (-7.2d-110)) then
tmp = z * (y / -t)
else if (z <= 3.6d+77) 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 <= -2e+60) {
tmp = y / a;
} else if (z <= -7.2e-110) {
tmp = z * (y / -t);
} else if (z <= 3.6e+77) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2e+60: tmp = y / a elif z <= -7.2e-110: tmp = z * (y / -t) elif z <= 3.6e+77: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2e+60) tmp = Float64(y / a); elseif (z <= -7.2e-110) tmp = Float64(z * Float64(y / Float64(-t))); elseif (z <= 3.6e+77) 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 <= -2e+60) tmp = y / a; elseif (z <= -7.2e-110) tmp = z * (y / -t); elseif (z <= 3.6e+77) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2e+60], N[(y / a), $MachinePrecision], If[LessEqual[z, -7.2e-110], N[(z * N[(y / (-t)), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.6e+77], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2 \cdot 10^{+60}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{-110}:\\
\;\;\;\;z \cdot \frac{y}{-t}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{+77}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.9999999999999999e60 or 3.5999999999999998e77 < z Initial program 63.1%
*-commutative63.1%
Simplified63.1%
Taylor expanded in z around inf 68.5%
if -1.9999999999999999e60 < z < -7.1999999999999999e-110Initial program 96.7%
*-commutative96.7%
Simplified96.7%
clear-num96.4%
associate-/r/96.6%
sub-neg96.6%
+-commutative96.6%
*-commutative96.6%
distribute-rgt-neg-in96.6%
fma-define96.6%
Applied egg-rr96.6%
Taylor expanded in a around 0 49.7%
Taylor expanded in x around 0 37.9%
mul-1-neg37.9%
associate-/l*37.9%
distribute-rgt-neg-in37.9%
distribute-neg-frac237.9%
Simplified37.9%
Taylor expanded in y around 0 37.9%
mul-1-neg37.9%
associate-*r/37.9%
*-commutative37.9%
associate-*l/37.9%
associate-*r/40.7%
distribute-rgt-neg-in40.7%
distribute-neg-frac240.7%
Simplified40.7%
if -7.1999999999999999e-110 < z < 3.5999999999999998e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.9%
Final simplification60.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+106) (not (<= z 1.1e+79))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+106) || !(z <= 1.1e+79)) {
tmp = y / a;
} else {
tmp = x / (t - (z * 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 <= (-9d+106)) .or. (.not. (z <= 1.1d+79))) then
tmp = y / a
else
tmp = x / (t - (z * 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 <= -9e+106) || !(z <= 1.1e+79)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+106) or not (z <= 1.1e+79): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+106) || !(z <= 1.1e+79)) tmp = Float64(y / a); else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -9e+106) || ~((z <= 1.1e+79))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e+106], N[Not[LessEqual[z, 1.1e+79]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+106} \lor \neg \left(z \leq 1.1 \cdot 10^{+79}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -8.9999999999999994e106 or 1.0999999999999999e79 < z Initial program 60.5%
*-commutative60.5%
Simplified60.5%
Taylor expanded in z around inf 73.8%
if -8.9999999999999994e106 < z < 1.0999999999999999e79Initial program 98.0%
*-commutative98.0%
Simplified98.0%
Taylor expanded in x around inf 71.9%
*-commutative71.9%
Simplified71.9%
Final simplification72.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+28) (not (<= z 4.35e+77))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+28) || !(z <= 4.35e+77)) {
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 <= (-9d+28)) .or. (.not. (z <= 4.35d+77))) 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 <= -9e+28) || !(z <= 4.35e+77)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+28) or not (z <= 4.35e+77): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+28) || !(z <= 4.35e+77)) 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 <= -9e+28) || ~((z <= 4.35e+77))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -9e+28], N[Not[LessEqual[z, 4.35e+77]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9 \cdot 10^{+28} \lor \neg \left(z \leq 4.35 \cdot 10^{+77}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -8.9999999999999994e28 or 4.3500000000000003e77 < z Initial program 64.1%
*-commutative64.1%
Simplified64.1%
Taylor expanded in z around inf 65.9%
if -8.9999999999999994e28 < z < 4.3500000000000003e77Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 50.8%
Final simplification57.7%
(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 83.6%
*-commutative83.6%
Simplified83.6%
Taylor expanded in z around 0 33.7%
Final simplification33.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 2024080
(FPCore (x y z t a)
:name "Diagrams.Solve.Tridiagonal:solveTriDiagonal from diagrams-solve-0.1, A"
:precision binary64
:alt
(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))))