
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (/ (- x (* y z)) (- t (* a z))))
double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = (x - (y * z)) / (t - (a * z))
end function
public static double code(double x, double y, double z, double t, double a) {
return (x - (y * z)) / (t - (a * z));
}
def code(x, y, z, t, a): return (x - (y * z)) / (t - (a * z))
function code(x, y, z, t, a) return Float64(Float64(x - Float64(y * z)) / Float64(t - Float64(a * z))) end
function tmp = code(x, y, z, t, a) tmp = (x - (y * z)) / (t - (a * z)); end
code[x_, y_, z_, t_, a_] := N[(N[(x - N[(y * z), $MachinePrecision]), $MachinePrecision] / N[(t - N[(a * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x - y \cdot z}{t - a \cdot z}
\end{array}
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.8e+142) (not (<= z 2.3e+144))) (/ (- y (/ x z)) a) (/ (- x (* z y)) (fma (- z) a t))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.8e+142) || !(z <= 2.3e+144)) {
tmp = (y - (x / z)) / a;
} else {
tmp = (x - (z * y)) / fma(-z, a, t);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.8e+142) || !(z <= 2.3e+144)) tmp = Float64(Float64(y - Float64(x / z)) / a); else tmp = Float64(Float64(x - Float64(z * y)) / fma(Float64(-z), a, t)); end return tmp end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.8e+142], N[Not[LessEqual[z, 2.3e+144]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[((-z) * a + t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+142} \lor \neg \left(z \leq 2.3 \cdot 10^{+144}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{\mathsf{fma}\left(-z, a, t\right)}\\
\end{array}
\end{array}
if z < -2.8e142 or 2.3000000000000001e144 < z Initial program 47.0%
*-commutative47.0%
Simplified47.0%
sub-neg47.0%
+-commutative47.0%
distribute-lft-neg-in47.0%
fma-def47.0%
Applied egg-rr47.0%
Taylor expanded in x around 0 44.9%
mul-1-neg44.9%
unsub-neg44.9%
mul-1-neg44.9%
sub-neg44.9%
*-commutative44.9%
associate-/l*59.7%
associate-/r/51.5%
mul-1-neg51.5%
sub-neg51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in t around 0 79.1%
distribute-lft-out--79.1%
*-commutative79.1%
associate-/r*84.4%
div-sub86.5%
mul-1-neg86.5%
Simplified86.5%
if -2.8e142 < z < 2.3000000000000001e144Initial program 95.3%
*-commutative95.3%
Simplified95.3%
sub-neg95.3%
+-commutative95.3%
distribute-lft-neg-in95.3%
fma-def95.3%
Applied egg-rr95.3%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.08e+142)
(/ y a)
(if (<= z -8.5e+85)
(* (/ x z) (/ -1.0 a))
(if (<= z -1.1e+68)
(/ y a)
(if (<= z -5.8e+51)
(/ (* z (- y)) t)
(if (or (<= z -3.3e+20) (and (not (<= z -55.0)) (<= z 1.3e+73)))
(/ x (- t (* z a)))
(/ y a)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.08e+142) {
tmp = y / a;
} else if (z <= -8.5e+85) {
tmp = (x / z) * (-1.0 / a);
} else if (z <= -1.1e+68) {
tmp = y / a;
} else if (z <= -5.8e+51) {
tmp = (z * -y) / t;
} else if ((z <= -3.3e+20) || (!(z <= -55.0) && (z <= 1.3e+73))) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.08d+142)) then
tmp = y / a
else if (z <= (-8.5d+85)) then
tmp = (x / z) * ((-1.0d0) / a)
else if (z <= (-1.1d+68)) then
tmp = y / a
else if (z <= (-5.8d+51)) then
tmp = (z * -y) / t
else if ((z <= (-3.3d+20)) .or. (.not. (z <= (-55.0d0))) .and. (z <= 1.3d+73)) then
tmp = x / (t - (z * a))
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.08e+142) {
tmp = y / a;
} else if (z <= -8.5e+85) {
tmp = (x / z) * (-1.0 / a);
} else if (z <= -1.1e+68) {
tmp = y / a;
} else if (z <= -5.8e+51) {
tmp = (z * -y) / t;
} else if ((z <= -3.3e+20) || (!(z <= -55.0) && (z <= 1.3e+73))) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.08e+142: tmp = y / a elif z <= -8.5e+85: tmp = (x / z) * (-1.0 / a) elif z <= -1.1e+68: tmp = y / a elif z <= -5.8e+51: tmp = (z * -y) / t elif (z <= -3.3e+20) or (not (z <= -55.0) and (z <= 1.3e+73)): tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.08e+142) tmp = Float64(y / a); elseif (z <= -8.5e+85) tmp = Float64(Float64(x / z) * Float64(-1.0 / a)); elseif (z <= -1.1e+68) tmp = Float64(y / a); elseif (z <= -5.8e+51) tmp = Float64(Float64(z * Float64(-y)) / t); elseif ((z <= -3.3e+20) || (!(z <= -55.0) && (z <= 1.3e+73))) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.08e+142) tmp = y / a; elseif (z <= -8.5e+85) tmp = (x / z) * (-1.0 / a); elseif (z <= -1.1e+68) tmp = y / a; elseif (z <= -5.8e+51) tmp = (z * -y) / t; elseif ((z <= -3.3e+20) || (~((z <= -55.0)) && (z <= 1.3e+73))) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.08e+142], N[(y / a), $MachinePrecision], If[LessEqual[z, -8.5e+85], N[(N[(x / z), $MachinePrecision] * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.1e+68], N[(y / a), $MachinePrecision], If[LessEqual[z, -5.8e+51], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, -3.3e+20], And[N[Not[LessEqual[z, -55.0]], $MachinePrecision], LessEqual[z, 1.3e+73]]], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+142}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+85}:\\
\;\;\;\;\frac{x}{z} \cdot \frac{-1}{a}\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{+68}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -5.8 \cdot 10^{+51}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{+20} \lor \neg \left(z \leq -55\right) \land z \leq 1.3 \cdot 10^{+73}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.08e142 or -8.4999999999999994e85 < z < -1.09999999999999994e68 or -3.3e20 < z < -55 or 1.3e73 < z Initial program 61.1%
*-commutative61.1%
Simplified61.1%
Taylor expanded in z around inf 70.5%
if -1.08e142 < z < -8.4999999999999994e85Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in t around 0 67.1%
associate-*r/67.1%
neg-mul-167.1%
neg-sub067.1%
sub-neg67.1%
distribute-rgt-neg-out67.1%
+-commutative67.1%
associate--r+67.1%
neg-sub067.1%
distribute-rgt-neg-out67.1%
remove-double-neg67.1%
*-commutative67.1%
Simplified67.1%
Taylor expanded in y around 0 68.0%
neg-mul-168.0%
Simplified68.0%
neg-mul-168.0%
*-commutative68.0%
times-frac78.0%
Applied egg-rr78.0%
if -1.09999999999999994e68 < z < -5.7999999999999997e51Initial program 76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in t around inf 63.6%
Taylor expanded in x around 0 63.7%
mul-1-neg63.7%
distribute-rgt-neg-out63.7%
Simplified63.7%
if -5.7999999999999997e51 < z < -3.3e20 or -55 < z < 1.3e73Initial program 98.1%
*-commutative98.1%
Simplified98.1%
Taylor expanded in x around inf 77.3%
*-commutative77.3%
Simplified77.3%
Final simplification74.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -1.5e+68)
t_2
(if (<= z -9.8e-5)
(* z (/ (- y) t_1))
(if (<= z 1e+51)
(/ x t_1)
(if (<= z 2.35e+144) (/ y (/ t_1 (- z))) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.5e+68) {
tmp = t_2;
} else if (z <= -9.8e-5) {
tmp = z * (-y / t_1);
} else if (z <= 1e+51) {
tmp = x / t_1;
} else if (z <= 2.35e+144) {
tmp = y / (t_1 / -z);
} 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 - (z * a)
t_2 = (y - (x / z)) / a
if (z <= (-1.5d+68)) then
tmp = t_2
else if (z <= (-9.8d-5)) then
tmp = z * (-y / t_1)
else if (z <= 1d+51) then
tmp = x / t_1
else if (z <= 2.35d+144) then
tmp = y / (t_1 / -z)
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 - (z * a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -1.5e+68) {
tmp = t_2;
} else if (z <= -9.8e-5) {
tmp = z * (-y / t_1);
} else if (z <= 1e+51) {
tmp = x / t_1;
} else if (z <= 2.35e+144) {
tmp = y / (t_1 / -z);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (y - (x / z)) / a tmp = 0 if z <= -1.5e+68: tmp = t_2 elif z <= -9.8e-5: tmp = z * (-y / t_1) elif z <= 1e+51: tmp = x / t_1 elif z <= 2.35e+144: tmp = y / (t_1 / -z) else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -1.5e+68) tmp = t_2; elseif (z <= -9.8e-5) tmp = Float64(z * Float64(Float64(-y) / t_1)); elseif (z <= 1e+51) tmp = Float64(x / t_1); elseif (z <= 2.35e+144) tmp = Float64(y / Float64(t_1 / Float64(-z))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -1.5e+68) tmp = t_2; elseif (z <= -9.8e-5) tmp = z * (-y / t_1); elseif (z <= 1e+51) tmp = x / t_1; elseif (z <= 2.35e+144) tmp = y / (t_1 / -z); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -1.5e+68], t$95$2, If[LessEqual[z, -9.8e-5], N[(z * N[((-y) / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+51], N[(x / t$95$1), $MachinePrecision], If[LessEqual[z, 2.35e+144], N[(y / N[(t$95$1 / (-z)), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -1.5 \cdot 10^{+68}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -9.8 \cdot 10^{-5}:\\
\;\;\;\;z \cdot \frac{-y}{t_1}\\
\mathbf{elif}\;z \leq 10^{+51}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{elif}\;z \leq 2.35 \cdot 10^{+144}:\\
\;\;\;\;\frac{y}{\frac{t_1}{-z}}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -1.5000000000000001e68 or 2.3500000000000001e144 < z Initial program 53.7%
*-commutative53.7%
Simplified53.7%
sub-neg53.7%
+-commutative53.7%
distribute-lft-neg-in53.7%
fma-def53.8%
Applied egg-rr53.8%
Taylor expanded in x around 0 52.0%
mul-1-neg52.0%
unsub-neg52.0%
mul-1-neg52.0%
sub-neg52.0%
*-commutative52.0%
associate-/l*63.9%
associate-/r/55.7%
mul-1-neg55.7%
sub-neg55.7%
*-commutative55.7%
Simplified55.7%
Taylor expanded in t around 0 77.9%
distribute-lft-out--77.9%
*-commutative77.9%
associate-/r*83.8%
div-sub85.6%
mul-1-neg85.6%
Simplified85.6%
if -1.5000000000000001e68 < z < -9.8e-5Initial program 81.6%
*-commutative81.6%
Simplified81.6%
sub-neg81.6%
+-commutative81.6%
distribute-lft-neg-in81.6%
fma-def81.6%
Applied egg-rr81.6%
Taylor expanded in x around 0 81.6%
mul-1-neg81.6%
unsub-neg81.6%
mul-1-neg81.6%
sub-neg81.6%
*-commutative81.6%
associate-/l*95.1%
associate-/r/95.3%
mul-1-neg95.3%
sub-neg95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in x around 0 66.8%
mul-1-neg66.8%
*-commutative66.8%
*-commutative66.8%
associate-*r/80.4%
distribute-rgt-neg-in80.4%
distribute-neg-frac80.4%
Simplified80.4%
if -9.8e-5 < z < 1e51Initial program 99.2%
*-commutative99.2%
Simplified99.2%
Taylor expanded in x around inf 79.3%
*-commutative79.3%
Simplified79.3%
if 1e51 < z < 2.3500000000000001e144Initial program 87.2%
*-commutative87.2%
Simplified87.2%
Taylor expanded in x around 0 69.3%
associate-*r/69.3%
*-commutative69.3%
mul-1-neg69.3%
distribute-rgt-neg-out69.3%
associate-/l*77.5%
Simplified77.5%
Final simplification80.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* (/ x z) (/ -1.0 a))))
(if (<= z -1.08e+142)
(/ y a)
(if (<= z -8.6e+85)
t_1
(if (<= z -1.02e+68)
(/ y a)
(if (<= z -1.48e+51)
(/ (* z (- y)) t)
(if (<= z -3.7e+20)
t_1
(if (<= z -0.075)
(/ y a)
(if (<= z 8.6e+22) (/ x t) (/ y a))))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (x / z) * (-1.0 / a);
double tmp;
if (z <= -1.08e+142) {
tmp = y / a;
} else if (z <= -8.6e+85) {
tmp = t_1;
} else if (z <= -1.02e+68) {
tmp = y / a;
} else if (z <= -1.48e+51) {
tmp = (z * -y) / t;
} else if (z <= -3.7e+20) {
tmp = t_1;
} else if (z <= -0.075) {
tmp = y / a;
} else if (z <= 8.6e+22) {
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) * ((-1.0d0) / a)
if (z <= (-1.08d+142)) then
tmp = y / a
else if (z <= (-8.6d+85)) then
tmp = t_1
else if (z <= (-1.02d+68)) then
tmp = y / a
else if (z <= (-1.48d+51)) then
tmp = (z * -y) / t
else if (z <= (-3.7d+20)) then
tmp = t_1
else if (z <= (-0.075d0)) then
tmp = y / a
else if (z <= 8.6d+22) 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) * (-1.0 / a);
double tmp;
if (z <= -1.08e+142) {
tmp = y / a;
} else if (z <= -8.6e+85) {
tmp = t_1;
} else if (z <= -1.02e+68) {
tmp = y / a;
} else if (z <= -1.48e+51) {
tmp = (z * -y) / t;
} else if (z <= -3.7e+20) {
tmp = t_1;
} else if (z <= -0.075) {
tmp = y / a;
} else if (z <= 8.6e+22) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (x / z) * (-1.0 / a) tmp = 0 if z <= -1.08e+142: tmp = y / a elif z <= -8.6e+85: tmp = t_1 elif z <= -1.02e+68: tmp = y / a elif z <= -1.48e+51: tmp = (z * -y) / t elif z <= -3.7e+20: tmp = t_1 elif z <= -0.075: tmp = y / a elif z <= 8.6e+22: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(x / z) * Float64(-1.0 / a)) tmp = 0.0 if (z <= -1.08e+142) tmp = Float64(y / a); elseif (z <= -8.6e+85) tmp = t_1; elseif (z <= -1.02e+68) tmp = Float64(y / a); elseif (z <= -1.48e+51) tmp = Float64(Float64(z * Float64(-y)) / t); elseif (z <= -3.7e+20) tmp = t_1; elseif (z <= -0.075) tmp = Float64(y / a); elseif (z <= 8.6e+22) 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) * (-1.0 / a); tmp = 0.0; if (z <= -1.08e+142) tmp = y / a; elseif (z <= -8.6e+85) tmp = t_1; elseif (z <= -1.02e+68) tmp = y / a; elseif (z <= -1.48e+51) tmp = (z * -y) / t; elseif (z <= -3.7e+20) tmp = t_1; elseif (z <= -0.075) tmp = y / a; elseif (z <= 8.6e+22) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x / z), $MachinePrecision] * N[(-1.0 / a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.08e+142], N[(y / a), $MachinePrecision], If[LessEqual[z, -8.6e+85], t$95$1, If[LessEqual[z, -1.02e+68], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.48e+51], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -3.7e+20], t$95$1, If[LessEqual[z, -0.075], N[(y / a), $MachinePrecision], If[LessEqual[z, 8.6e+22], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{z} \cdot \frac{-1}{a}\\
\mathbf{if}\;z \leq -1.08 \cdot 10^{+142}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -8.6 \cdot 10^{+85}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.02 \cdot 10^{+68}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.48 \cdot 10^{+51}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;z \leq -3.7 \cdot 10^{+20}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -0.075:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 8.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.08e142 or -8.5999999999999998e85 < z < -1.02e68 or -3.7e20 < z < -0.0749999999999999972 or 8.6000000000000004e22 < z Initial program 64.6%
*-commutative64.6%
Simplified64.6%
Taylor expanded in z around inf 65.9%
if -1.08e142 < z < -8.5999999999999998e85 or -1.48e51 < z < -3.7e20Initial program 80.7%
*-commutative80.7%
Simplified80.7%
Taylor expanded in t around 0 58.7%
associate-*r/58.7%
neg-mul-158.7%
neg-sub058.7%
sub-neg58.7%
distribute-rgt-neg-out58.7%
+-commutative58.7%
associate--r+58.7%
neg-sub058.7%
distribute-rgt-neg-out58.7%
remove-double-neg58.7%
*-commutative58.7%
Simplified58.7%
Taylor expanded in y around 0 61.2%
neg-mul-161.2%
Simplified61.2%
neg-mul-161.2%
*-commutative61.2%
times-frac73.4%
Applied egg-rr73.4%
if -1.02e68 < z < -1.48e51Initial program 76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in t around inf 63.6%
Taylor expanded in x around 0 63.7%
mul-1-neg63.7%
distribute-rgt-neg-out63.7%
Simplified63.7%
if -0.0749999999999999972 < z < 8.6000000000000004e22Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.8%
Final simplification61.6%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.75e+142)
(/ y a)
(if (<= z -1.7e+84)
(/ (- x) (* z a))
(if (<= z -1.6e+68)
(/ y a)
(if (<= z -3.9e+51)
(/ (* z (- y)) t)
(if (<= z -7.2) (/ y a) (if (<= z 7.5e+22) (/ x t) (/ y a))))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.75e+142) {
tmp = y / a;
} else if (z <= -1.7e+84) {
tmp = -x / (z * a);
} else if (z <= -1.6e+68) {
tmp = y / a;
} else if (z <= -3.9e+51) {
tmp = (z * -y) / t;
} else if (z <= -7.2) {
tmp = y / a;
} else if (z <= 7.5e+22) {
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 <= (-1.75d+142)) then
tmp = y / a
else if (z <= (-1.7d+84)) then
tmp = -x / (z * a)
else if (z <= (-1.6d+68)) then
tmp = y / a
else if (z <= (-3.9d+51)) then
tmp = (z * -y) / t
else if (z <= (-7.2d0)) then
tmp = y / a
else if (z <= 7.5d+22) 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 <= -1.75e+142) {
tmp = y / a;
} else if (z <= -1.7e+84) {
tmp = -x / (z * a);
} else if (z <= -1.6e+68) {
tmp = y / a;
} else if (z <= -3.9e+51) {
tmp = (z * -y) / t;
} else if (z <= -7.2) {
tmp = y / a;
} else if (z <= 7.5e+22) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.75e+142: tmp = y / a elif z <= -1.7e+84: tmp = -x / (z * a) elif z <= -1.6e+68: tmp = y / a elif z <= -3.9e+51: tmp = (z * -y) / t elif z <= -7.2: tmp = y / a elif z <= 7.5e+22: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.75e+142) tmp = Float64(y / a); elseif (z <= -1.7e+84) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= -1.6e+68) tmp = Float64(y / a); elseif (z <= -3.9e+51) tmp = Float64(Float64(z * Float64(-y)) / t); elseif (z <= -7.2) tmp = Float64(y / a); elseif (z <= 7.5e+22) 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 <= -1.75e+142) tmp = y / a; elseif (z <= -1.7e+84) tmp = -x / (z * a); elseif (z <= -1.6e+68) tmp = y / a; elseif (z <= -3.9e+51) tmp = (z * -y) / t; elseif (z <= -7.2) tmp = y / a; elseif (z <= 7.5e+22) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.75e+142], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.7e+84], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.6e+68], N[(y / a), $MachinePrecision], If[LessEqual[z, -3.9e+51], N[(N[(z * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -7.2], N[(y / a), $MachinePrecision], If[LessEqual[z, 7.5e+22], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+142}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.7 \cdot 10^{+84}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+68}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -3.9 \cdot 10^{+51}:\\
\;\;\;\;\frac{z \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;z \leq -7.2:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.74999999999999999e142 or -1.6999999999999999e84 < z < -1.59999999999999997e68 or -3.89999999999999984e51 < z < -7.20000000000000018 or 7.5000000000000002e22 < z Initial program 64.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in z around inf 63.6%
if -1.74999999999999999e142 < z < -1.6999999999999999e84Initial program 89.1%
*-commutative89.1%
Simplified89.1%
Taylor expanded in t around 0 67.1%
associate-*r/67.1%
neg-mul-167.1%
neg-sub067.1%
sub-neg67.1%
distribute-rgt-neg-out67.1%
+-commutative67.1%
associate--r+67.1%
neg-sub067.1%
distribute-rgt-neg-out67.1%
remove-double-neg67.1%
*-commutative67.1%
Simplified67.1%
Taylor expanded in y around 0 68.0%
neg-mul-168.0%
Simplified68.0%
if -1.59999999999999997e68 < z < -3.89999999999999984e51Initial program 76.0%
*-commutative76.0%
Simplified76.0%
Taylor expanded in t around inf 63.6%
Taylor expanded in x around 0 63.7%
mul-1-neg63.7%
distribute-rgt-neg-out63.7%
Simplified63.7%
if -7.20000000000000018 < z < 7.5000000000000002e22Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.8%
Final simplification60.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.95e+142) (not (<= z 4.6e+144))) (/ (- 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 <= -1.95e+142) || !(z <= 4.6e+144)) {
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 <= (-1.95d+142)) .or. (.not. (z <= 4.6d+144))) 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 <= -1.95e+142) || !(z <= 4.6e+144)) {
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 <= -1.95e+142) or not (z <= 4.6e+144): 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 <= -1.95e+142) || !(z <= 4.6e+144)) 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 <= -1.95e+142) || ~((z <= 4.6e+144))) 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, -1.95e+142], N[Not[LessEqual[z, 4.6e+144]], $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 -1.95 \cdot 10^{+142} \lor \neg \left(z \leq 4.6 \cdot 10^{+144}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -1.95e142 or 4.6000000000000003e144 < z Initial program 47.0%
*-commutative47.0%
Simplified47.0%
sub-neg47.0%
+-commutative47.0%
distribute-lft-neg-in47.0%
fma-def47.0%
Applied egg-rr47.0%
Taylor expanded in x around 0 44.9%
mul-1-neg44.9%
unsub-neg44.9%
mul-1-neg44.9%
sub-neg44.9%
*-commutative44.9%
associate-/l*59.7%
associate-/r/51.5%
mul-1-neg51.5%
sub-neg51.5%
*-commutative51.5%
Simplified51.5%
Taylor expanded in t around 0 79.1%
distribute-lft-out--79.1%
*-commutative79.1%
associate-/r*84.4%
div-sub86.5%
mul-1-neg86.5%
Simplified86.5%
if -1.95e142 < z < 4.6000000000000003e144Initial program 95.3%
Final simplification93.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (- t (* z a))) (t_2 (/ (- y (/ x z)) a)))
(if (<= z -4e+69)
t_2
(if (<= z -7e-5) (* z (/ (- y) t_1)) (if (<= z 7.8e+55) (/ x t_1) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -4e+69) {
tmp = t_2;
} else if (z <= -7e-5) {
tmp = z * (-y / t_1);
} else if (z <= 7.8e+55) {
tmp = x / 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 - (z * a)
t_2 = (y - (x / z)) / a
if (z <= (-4d+69)) then
tmp = t_2
else if (z <= (-7d-5)) then
tmp = z * (-y / t_1)
else if (z <= 7.8d+55) then
tmp = x / 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 - (z * a);
double t_2 = (y - (x / z)) / a;
double tmp;
if (z <= -4e+69) {
tmp = t_2;
} else if (z <= -7e-5) {
tmp = z * (-y / t_1);
} else if (z <= 7.8e+55) {
tmp = x / t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) t_2 = (y - (x / z)) / a tmp = 0 if z <= -4e+69: tmp = t_2 elif z <= -7e-5: tmp = z * (-y / t_1) elif z <= 7.8e+55: tmp = x / t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) t_2 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -4e+69) tmp = t_2; elseif (z <= -7e-5) tmp = Float64(z * Float64(Float64(-y) / t_1)); elseif (z <= 7.8e+55) tmp = Float64(x / t_1); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); t_2 = (y - (x / z)) / a; tmp = 0.0; if (z <= -4e+69) tmp = t_2; elseif (z <= -7e-5) tmp = z * (-y / t_1); elseif (z <= 7.8e+55) tmp = x / t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -4e+69], t$95$2, If[LessEqual[z, -7e-5], N[(z * N[((-y) / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 7.8e+55], N[(x / t$95$1), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
t_2 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -4 \cdot 10^{+69}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-5}:\\
\;\;\;\;z \cdot \frac{-y}{t_1}\\
\mathbf{elif}\;z \leq 7.8 \cdot 10^{+55}:\\
\;\;\;\;\frac{x}{t_1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -4.0000000000000003e69 or 7.80000000000000054e55 < z Initial program 62.8%
*-commutative62.8%
Simplified62.8%
sub-neg62.8%
+-commutative62.8%
distribute-lft-neg-in62.8%
fma-def62.8%
Applied egg-rr62.8%
Taylor expanded in x around 0 61.6%
mul-1-neg61.6%
unsub-neg61.6%
mul-1-neg61.6%
sub-neg61.6%
*-commutative61.6%
associate-/l*72.5%
associate-/r/66.6%
mul-1-neg66.6%
sub-neg66.6%
*-commutative66.6%
Simplified66.6%
Taylor expanded in t around 0 73.0%
distribute-lft-out--73.0%
*-commutative73.0%
associate-/r*77.3%
div-sub78.6%
mul-1-neg78.6%
Simplified78.6%
if -4.0000000000000003e69 < z < -6.9999999999999994e-5Initial program 81.6%
*-commutative81.6%
Simplified81.6%
sub-neg81.6%
+-commutative81.6%
distribute-lft-neg-in81.6%
fma-def81.6%
Applied egg-rr81.6%
Taylor expanded in x around 0 81.6%
mul-1-neg81.6%
unsub-neg81.6%
mul-1-neg81.6%
sub-neg81.6%
*-commutative81.6%
associate-/l*95.1%
associate-/r/95.3%
mul-1-neg95.3%
sub-neg95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in x around 0 66.8%
mul-1-neg66.8%
*-commutative66.8%
*-commutative66.8%
associate-*r/80.4%
distribute-rgt-neg-in80.4%
distribute-neg-frac80.4%
Simplified80.4%
if -6.9999999999999994e-5 < z < 7.80000000000000054e55Initial program 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x around inf 78.9%
*-commutative78.9%
Simplified78.9%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.08e+142)
(/ y a)
(if (<= z -4e+20)
(/ (- x) (* z a))
(if (<= z -18.0) (/ y a) (if (<= z 7.5e+22) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.08e+142) {
tmp = y / a;
} else if (z <= -4e+20) {
tmp = -x / (z * a);
} else if (z <= -18.0) {
tmp = y / a;
} else if (z <= 7.5e+22) {
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 <= (-1.08d+142)) then
tmp = y / a
else if (z <= (-4d+20)) then
tmp = -x / (z * a)
else if (z <= (-18.0d0)) then
tmp = y / a
else if (z <= 7.5d+22) 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 <= -1.08e+142) {
tmp = y / a;
} else if (z <= -4e+20) {
tmp = -x / (z * a);
} else if (z <= -18.0) {
tmp = y / a;
} else if (z <= 7.5e+22) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.08e+142: tmp = y / a elif z <= -4e+20: tmp = -x / (z * a) elif z <= -18.0: tmp = y / a elif z <= 7.5e+22: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.08e+142) tmp = Float64(y / a); elseif (z <= -4e+20) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= -18.0) tmp = Float64(y / a); elseif (z <= 7.5e+22) 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 <= -1.08e+142) tmp = y / a; elseif (z <= -4e+20) tmp = -x / (z * a); elseif (z <= -18.0) tmp = y / a; elseif (z <= 7.5e+22) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.08e+142], N[(y / a), $MachinePrecision], If[LessEqual[z, -4e+20], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -18.0], N[(y / a), $MachinePrecision], If[LessEqual[z, 7.5e+22], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+142}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -4 \cdot 10^{+20}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq -18:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 7.5 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -1.08e142 or -4e20 < z < -18 or 7.5000000000000002e22 < z Initial program 64.9%
*-commutative64.9%
Simplified64.9%
Taylor expanded in z around inf 65.1%
if -1.08e142 < z < -4e20Initial program 76.8%
*-commutative76.8%
Simplified76.8%
Taylor expanded in t around 0 44.3%
associate-*r/44.3%
neg-mul-144.3%
neg-sub044.3%
sub-neg44.3%
distribute-rgt-neg-out44.3%
+-commutative44.3%
associate--r+44.3%
neg-sub044.3%
distribute-rgt-neg-out44.3%
remove-double-neg44.3%
*-commutative44.3%
Simplified44.3%
Taylor expanded in y around 0 41.9%
neg-mul-141.9%
Simplified41.9%
if -18 < z < 7.5000000000000002e22Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.8%
Final simplification58.6%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -7.8) (not (<= z 3.6e+64))) (/ (- y (/ x z)) a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -7.8) || !(z <= 3.6e+64)) {
tmp = (y - (x / z)) / 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 <= (-7.8d0)) .or. (.not. (z <= 3.6d+64))) then
tmp = (y - (x / z)) / 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 <= -7.8) || !(z <= 3.6e+64)) {
tmp = (y - (x / z)) / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -7.8) or not (z <= 3.6e+64): tmp = (y - (x / z)) / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -7.8) || !(z <= 3.6e+64)) tmp = Float64(Float64(y - Float64(x / z)) / 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 <= -7.8) || ~((z <= 3.6e+64))) tmp = (y - (x / z)) / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -7.8], N[Not[LessEqual[z, 3.6e+64]], $MachinePrecision]], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \lor \neg \left(z \leq 3.6 \cdot 10^{+64}\right):\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -7.79999999999999982 or 3.60000000000000014e64 < z Initial program 66.4%
*-commutative66.4%
Simplified66.4%
sub-neg66.4%
+-commutative66.4%
distribute-lft-neg-in66.4%
fma-def66.4%
Applied egg-rr66.4%
Taylor expanded in x around 0 65.4%
mul-1-neg65.4%
unsub-neg65.4%
mul-1-neg65.4%
sub-neg65.4%
*-commutative65.4%
associate-/l*77.0%
associate-/r/72.3%
mul-1-neg72.3%
sub-neg72.3%
*-commutative72.3%
Simplified72.3%
Taylor expanded in t around 0 67.6%
distribute-lft-out--67.6%
*-commutative67.6%
associate-/r*72.0%
div-sub73.0%
mul-1-neg73.0%
Simplified73.0%
if -7.79999999999999982 < z < 3.60000000000000014e64Initial program 99.3%
*-commutative99.3%
Simplified99.3%
Taylor expanded in x around inf 78.5%
*-commutative78.5%
Simplified78.5%
Final simplification76.3%
(FPCore (x y z t a) :precision binary64 (if (<= y -6e+39) (/ (- x (* z y)) t) (if (<= y 3.3e+106) (/ x (- t (* z a))) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6e+39) {
tmp = (x - (z * y)) / t;
} else if (y <= 3.3e+106) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (y <= (-6d+39)) then
tmp = (x - (z * y)) / t
else if (y <= 3.3d+106) then
tmp = x / (t - (z * a))
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (y <= -6e+39) {
tmp = (x - (z * y)) / t;
} else if (y <= 3.3e+106) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if y <= -6e+39: tmp = (x - (z * y)) / t elif y <= 3.3e+106: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (y <= -6e+39) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (y <= 3.3e+106) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (y <= -6e+39) tmp = (x - (z * y)) / t; elseif (y <= 3.3e+106) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[y, -6e+39], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[y, 3.3e+106], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6 \cdot 10^{+39}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+106}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if y < -5.9999999999999999e39Initial program 82.8%
*-commutative82.8%
Simplified82.8%
Taylor expanded in t around inf 55.9%
if -5.9999999999999999e39 < y < 3.30000000000000008e106Initial program 93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in x around inf 81.7%
*-commutative81.7%
Simplified81.7%
if 3.30000000000000008e106 < y Initial program 67.5%
*-commutative67.5%
Simplified67.5%
Taylor expanded in z around inf 52.2%
Final simplification70.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -0.00066) (/ y a) (if (<= z 1.6e+22) (/ x t) (/ y a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -0.00066) {
tmp = y / a;
} else if (z <= 1.6e+22) {
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 <= (-0.00066d0)) then
tmp = y / a
else if (z <= 1.6d+22) 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 <= -0.00066) {
tmp = y / a;
} else if (z <= 1.6e+22) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -0.00066: tmp = y / a elif z <= 1.6e+22: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -0.00066) tmp = Float64(y / a); elseif (z <= 1.6e+22) 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 <= -0.00066) tmp = y / a; elseif (z <= 1.6e+22) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -0.00066], N[(y / a), $MachinePrecision], If[LessEqual[z, 1.6e+22], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -0.00066:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+22}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6.6e-4 or 1.6e22 < z Initial program 67.7%
*-commutative67.7%
Simplified67.7%
Taylor expanded in z around inf 54.9%
if -6.6e-4 < z < 1.6e22Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 57.8%
Final simplification56.6%
(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.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in z around 0 39.5%
Final simplification39.5%
(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 2023268
(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))))