
(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 (let* ((t_1 (- t (* z a)))) (if (<= z 4.8e+92) (- (/ x t_1) (/ (* z y) t_1)) (/ (- y (/ x z)) a))))
double code(double x, double y, double z, double t, double a) {
double t_1 = t - (z * a);
double tmp;
if (z <= 4.8e+92) {
tmp = (x / t_1) - ((z * y) / t_1);
} else {
tmp = (y - (x / 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) :: t_1
real(8) :: tmp
t_1 = t - (z * a)
if (z <= 4.8d+92) then
tmp = (x / t_1) - ((z * y) / t_1)
else
tmp = (y - (x / z)) / a
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 tmp;
if (z <= 4.8e+92) {
tmp = (x / t_1) - ((z * y) / t_1);
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = t - (z * a) tmp = 0 if z <= 4.8e+92: tmp = (x / t_1) - ((z * y) / t_1) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) t_1 = Float64(t - Float64(z * a)) tmp = 0.0 if (z <= 4.8e+92) tmp = Float64(Float64(x / t_1) - Float64(Float64(z * y) / t_1)); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = t - (z * a); tmp = 0.0; if (z <= 4.8e+92) tmp = (x / t_1) - ((z * y) / t_1); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, 4.8e+92], N[(N[(x / t$95$1), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t - z \cdot a\\
\mathbf{if}\;z \leq 4.8 \cdot 10^{+92}:\\
\;\;\;\;\frac{x}{t_1} - \frac{z \cdot y}{t_1}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < 4.80000000000000009e92Initial program 93.9%
*-commutative93.9%
Simplified93.9%
clear-num92.8%
associate-/r/93.5%
sub-neg93.5%
+-commutative93.5%
*-commutative93.5%
distribute-rgt-neg-in93.5%
fma-def93.5%
Applied egg-rr93.5%
Taylor expanded in x around 0 93.9%
+-commutative93.9%
mul-1-neg93.9%
sub-neg93.9%
mul-1-neg93.9%
associate-/l*93.3%
mul-1-neg93.3%
sub-neg93.3%
associate-/l*93.9%
unsub-neg93.9%
*-commutative93.9%
*-commutative93.9%
Simplified93.9%
if 4.80000000000000009e92 < z Initial program 53.2%
*-commutative53.2%
Simplified53.2%
clear-num53.2%
associate-/r/53.1%
sub-neg53.1%
+-commutative53.1%
*-commutative53.1%
distribute-rgt-neg-in53.1%
fma-def53.1%
Applied egg-rr53.1%
Taylor expanded in x around 0 51.4%
+-commutative51.4%
mul-1-neg51.4%
sub-neg51.4%
mul-1-neg51.4%
associate-/l*70.3%
mul-1-neg70.3%
sub-neg70.3%
associate-/l*51.4%
unsub-neg51.4%
*-commutative51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in t around 0 84.5%
distribute-lft-out--84.5%
*-commutative84.5%
associate-/r*85.5%
div-sub87.3%
sub-neg87.3%
mul-1-neg87.3%
+-commutative87.3%
associate-*r/87.3%
distribute-lft-in87.3%
neg-mul-187.3%
mul-1-neg87.3%
remove-double-neg87.3%
mul-1-neg87.3%
unsub-neg87.3%
Simplified87.3%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)) (t_2 (- t (* z a))))
(if (<= z -8.4e+21)
t_1
(if (<= z -7.4e-53)
(- (/ x t) (/ y (/ t z)))
(if (<= z -2.3e-70)
t_1
(if (<= z 3.6)
(/ x t_2)
(if (<= z 3.8e+82) (* y (/ (- z) t_2)) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double t_2 = t - (z * a);
double tmp;
if (z <= -8.4e+21) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x / t) - (y / (t / z));
} else if (z <= -2.3e-70) {
tmp = t_1;
} else if (z <= 3.6) {
tmp = x / t_2;
} else if (z <= 3.8e+82) {
tmp = y * (-z / t_2);
} 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) :: t_2
real(8) :: tmp
t_1 = (y - (x / z)) / a
t_2 = t - (z * a)
if (z <= (-8.4d+21)) then
tmp = t_1
else if (z <= (-7.4d-53)) then
tmp = (x / t) - (y / (t / z))
else if (z <= (-2.3d-70)) then
tmp = t_1
else if (z <= 3.6d0) then
tmp = x / t_2
else if (z <= 3.8d+82) then
tmp = y * (-z / t_2)
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 t_2 = t - (z * a);
double tmp;
if (z <= -8.4e+21) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x / t) - (y / (t / z));
} else if (z <= -2.3e-70) {
tmp = t_1;
} else if (z <= 3.6) {
tmp = x / t_2;
} else if (z <= 3.8e+82) {
tmp = y * (-z / t_2);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a t_2 = t - (z * a) tmp = 0 if z <= -8.4e+21: tmp = t_1 elif z <= -7.4e-53: tmp = (x / t) - (y / (t / z)) elif z <= -2.3e-70: tmp = t_1 elif z <= 3.6: tmp = x / t_2 elif z <= 3.8e+82: tmp = y * (-z / t_2) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) t_2 = Float64(t - Float64(z * a)) tmp = 0.0 if (z <= -8.4e+21) tmp = t_1; elseif (z <= -7.4e-53) tmp = Float64(Float64(x / t) - Float64(y / Float64(t / z))); elseif (z <= -2.3e-70) tmp = t_1; elseif (z <= 3.6) tmp = Float64(x / t_2); elseif (z <= 3.8e+82) tmp = Float64(y * Float64(Float64(-z) / t_2)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; t_2 = t - (z * a); tmp = 0.0; if (z <= -8.4e+21) tmp = t_1; elseif (z <= -7.4e-53) tmp = (x / t) - (y / (t / z)); elseif (z <= -2.3e-70) tmp = t_1; elseif (z <= 3.6) tmp = x / t_2; elseif (z <= 3.8e+82) tmp = y * (-z / t_2); 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]}, Block[{t$95$2 = N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.4e+21], t$95$1, If[LessEqual[z, -7.4e-53], N[(N[(x / t), $MachinePrecision] - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -2.3e-70], t$95$1, If[LessEqual[z, 3.6], N[(x / t$95$2), $MachinePrecision], If[LessEqual[z, 3.8e+82], N[(y * N[((-z) / t$95$2), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
t_2 := t - z \cdot a\\
\mathbf{if}\;z \leq -8.4 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{x}{t} - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq -2.3 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3.6:\\
\;\;\;\;\frac{x}{t_2}\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+82}:\\
\;\;\;\;y \cdot \frac{-z}{t_2}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -8.4e21 or -7.39999999999999965e-53 < z < -2.30000000000000001e-70 or 3.80000000000000033e82 < z Initial program 66.2%
*-commutative66.2%
Simplified66.2%
clear-num66.2%
associate-/r/66.1%
sub-neg66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt-neg-in66.1%
fma-def66.1%
Applied egg-rr66.1%
Taylor expanded in x around 0 65.3%
+-commutative65.3%
mul-1-neg65.3%
sub-neg65.3%
mul-1-neg65.3%
associate-/l*77.9%
mul-1-neg77.9%
sub-neg77.9%
associate-/l*65.3%
unsub-neg65.3%
*-commutative65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in t around 0 78.6%
distribute-lft-out--78.6%
*-commutative78.6%
associate-/r*80.9%
div-sub81.8%
sub-neg81.8%
mul-1-neg81.8%
+-commutative81.8%
associate-*r/81.8%
distribute-lft-in81.8%
neg-mul-181.8%
mul-1-neg81.8%
remove-double-neg81.8%
mul-1-neg81.8%
unsub-neg81.8%
Simplified81.8%
if -8.4e21 < z < -7.39999999999999965e-53Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 69.7%
div-sub69.7%
associate-/l*69.7%
Applied egg-rr69.7%
if -2.30000000000000001e-70 < z < 3.60000000000000009Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
Simplified78.3%
if 3.60000000000000009 < z < 3.80000000000000033e82Initial program 86.4%
*-commutative86.4%
Simplified86.4%
clear-num85.9%
associate-/r/85.7%
sub-neg85.7%
+-commutative85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
fma-def85.7%
Applied egg-rr85.7%
Taylor expanded in x around 0 86.4%
+-commutative86.4%
mul-1-neg86.4%
sub-neg86.4%
mul-1-neg86.4%
associate-/l*99.8%
mul-1-neg99.8%
sub-neg99.8%
associate-/l*86.4%
unsub-neg86.4%
*-commutative86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in x around 0 65.7%
mul-1-neg65.7%
*-commutative65.7%
associate-*r/79.3%
distribute-lft-neg-in79.3%
Simplified79.3%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -7.2e+21)
t_1
(if (<= z -7.4e-53)
(/ (- x (* z y)) t)
(if (<= z -3.3e-70)
t_1
(if (<= z 2.0)
(/ x (- t (* z a)))
(if (<= z 2.95e+82) (* z (/ y (- (* z a) t))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -7.2e+21) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x - (z * y)) / t;
} else if (z <= -3.3e-70) {
tmp = t_1;
} else if (z <= 2.0) {
tmp = x / (t - (z * a));
} else if (z <= 2.95e+82) {
tmp = z * (y / ((z * a) - t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - (x / z)) / a
if (z <= (-7.2d+21)) then
tmp = t_1
else if (z <= (-7.4d-53)) then
tmp = (x - (z * y)) / t
else if (z <= (-3.3d-70)) then
tmp = t_1
else if (z <= 2.0d0) then
tmp = x / (t - (z * a))
else if (z <= 2.95d+82) then
tmp = z * (y / ((z * a) - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -7.2e+21) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x - (z * y)) / t;
} else if (z <= -3.3e-70) {
tmp = t_1;
} else if (z <= 2.0) {
tmp = x / (t - (z * a));
} else if (z <= 2.95e+82) {
tmp = z * (y / ((z * a) - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -7.2e+21: tmp = t_1 elif z <= -7.4e-53: tmp = (x - (z * y)) / t elif z <= -3.3e-70: tmp = t_1 elif z <= 2.0: tmp = x / (t - (z * a)) elif z <= 2.95e+82: tmp = z * (y / ((z * a) - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -7.2e+21) tmp = t_1; elseif (z <= -7.4e-53) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= -3.3e-70) tmp = t_1; elseif (z <= 2.0) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 2.95e+82) tmp = Float64(z * Float64(y / Float64(Float64(z * a) - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (z <= -7.2e+21) tmp = t_1; elseif (z <= -7.4e-53) tmp = (x - (z * y)) / t; elseif (z <= -3.3e-70) tmp = t_1; elseif (z <= 2.0) tmp = x / (t - (z * a)); elseif (z <= 2.95e+82) tmp = z * (y / ((z * a) - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -7.2e+21], t$95$1, If[LessEqual[z, -7.4e-53], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, -3.3e-70], t$95$1, If[LessEqual[z, 2.0], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.95e+82], N[(z * N[(y / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -7.2 \cdot 10^{+21}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq -3.3 \cdot 10^{-70}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 2:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 2.95 \cdot 10^{+82}:\\
\;\;\;\;z \cdot \frac{y}{z \cdot a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -7.2e21 or -7.39999999999999965e-53 < z < -3.30000000000000016e-70 or 2.9499999999999998e82 < z Initial program 66.2%
*-commutative66.2%
Simplified66.2%
clear-num66.2%
associate-/r/66.1%
sub-neg66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt-neg-in66.1%
fma-def66.1%
Applied egg-rr66.1%
Taylor expanded in x around 0 65.3%
+-commutative65.3%
mul-1-neg65.3%
sub-neg65.3%
mul-1-neg65.3%
associate-/l*77.9%
mul-1-neg77.9%
sub-neg77.9%
associate-/l*65.3%
unsub-neg65.3%
*-commutative65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in t around 0 78.6%
distribute-lft-out--78.6%
*-commutative78.6%
associate-/r*80.9%
div-sub81.8%
sub-neg81.8%
mul-1-neg81.8%
+-commutative81.8%
associate-*r/81.8%
distribute-lft-in81.8%
neg-mul-181.8%
mul-1-neg81.8%
remove-double-neg81.8%
mul-1-neg81.8%
unsub-neg81.8%
Simplified81.8%
if -7.2e21 < z < -7.39999999999999965e-53Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 69.7%
if -3.30000000000000016e-70 < z < 2Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
Simplified78.3%
if 2 < z < 2.9499999999999998e82Initial program 86.4%
*-commutative86.4%
Simplified86.4%
clear-num85.9%
associate-/r/85.7%
sub-neg85.7%
+-commutative85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
fma-def85.7%
Applied egg-rr85.7%
Taylor expanded in x around 0 86.4%
+-commutative86.4%
mul-1-neg86.4%
sub-neg86.4%
mul-1-neg86.4%
associate-/l*99.8%
mul-1-neg99.8%
sub-neg99.8%
associate-/l*86.4%
unsub-neg86.4%
*-commutative86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in x around 0 65.7%
mul-1-neg65.7%
*-commutative65.7%
associate-*l/79.1%
distribute-rgt-neg-in79.1%
Simplified79.1%
frac-2neg79.1%
associate-*l/65.7%
add-sqr-sqrt0.0%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod1.6%
add-sqr-sqrt1.6%
distribute-lft-neg-in1.6%
distribute-rgt-neg-in1.6%
add-sqr-sqrt0.0%
sqrt-unprod65.7%
sqr-neg65.7%
sqrt-unprod65.2%
add-sqr-sqrt65.7%
sub-neg65.7%
distribute-neg-in65.7%
distribute-lft-neg-in65.7%
add-sqr-sqrt0.0%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod28.4%
add-sqr-sqrt28.4%
Applied egg-rr65.7%
associate-/l*79.1%
associate-/r/79.1%
+-commutative79.1%
unsub-neg79.1%
Simplified79.1%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -3.3e+22)
t_1
(if (<= z -7.4e-53)
(- (/ x t) (/ y (/ t z)))
(if (<= z -1.35e-71)
t_1
(if (<= z 0.49)
(/ x (- t (* z a)))
(if (<= z 1.7e+82) (* z (/ y (- (* z a) t))) t_1)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -3.3e+22) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x / t) - (y / (t / z));
} else if (z <= -1.35e-71) {
tmp = t_1;
} else if (z <= 0.49) {
tmp = x / (t - (z * a));
} else if (z <= 1.7e+82) {
tmp = z * (y / ((z * a) - t));
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = (y - (x / z)) / a
if (z <= (-3.3d+22)) then
tmp = t_1
else if (z <= (-7.4d-53)) then
tmp = (x / t) - (y / (t / z))
else if (z <= (-1.35d-71)) then
tmp = t_1
else if (z <= 0.49d0) then
tmp = x / (t - (z * a))
else if (z <= 1.7d+82) then
tmp = z * (y / ((z * a) - t))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -3.3e+22) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x / t) - (y / (t / z));
} else if (z <= -1.35e-71) {
tmp = t_1;
} else if (z <= 0.49) {
tmp = x / (t - (z * a));
} else if (z <= 1.7e+82) {
tmp = z * (y / ((z * a) - t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -3.3e+22: tmp = t_1 elif z <= -7.4e-53: tmp = (x / t) - (y / (t / z)) elif z <= -1.35e-71: tmp = t_1 elif z <= 0.49: tmp = x / (t - (z * a)) elif z <= 1.7e+82: tmp = z * (y / ((z * a) - t)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -3.3e+22) tmp = t_1; elseif (z <= -7.4e-53) tmp = Float64(Float64(x / t) - Float64(y / Float64(t / z))); elseif (z <= -1.35e-71) tmp = t_1; elseif (z <= 0.49) tmp = Float64(x / Float64(t - Float64(z * a))); elseif (z <= 1.7e+82) tmp = Float64(z * Float64(y / Float64(Float64(z * a) - t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (z <= -3.3e+22) tmp = t_1; elseif (z <= -7.4e-53) tmp = (x / t) - (y / (t / z)); elseif (z <= -1.35e-71) tmp = t_1; elseif (z <= 0.49) tmp = x / (t - (z * a)); elseif (z <= 1.7e+82) tmp = z * (y / ((z * a) - t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]}, If[LessEqual[z, -3.3e+22], t$95$1, If[LessEqual[z, -7.4e-53], N[(N[(x / t), $MachinePrecision] - N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.35e-71], t$95$1, If[LessEqual[z, 0.49], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.7e+82], N[(z * N[(y / N[(N[(z * a), $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -3.3 \cdot 10^{+22}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{x}{t} - \frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq -1.35 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.49:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+82}:\\
\;\;\;\;z \cdot \frac{y}{z \cdot a - t}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -3.2999999999999998e22 or -7.39999999999999965e-53 < z < -1.3500000000000001e-71 or 1.69999999999999997e82 < z Initial program 66.2%
*-commutative66.2%
Simplified66.2%
clear-num66.2%
associate-/r/66.1%
sub-neg66.1%
+-commutative66.1%
*-commutative66.1%
distribute-rgt-neg-in66.1%
fma-def66.1%
Applied egg-rr66.1%
Taylor expanded in x around 0 65.3%
+-commutative65.3%
mul-1-neg65.3%
sub-neg65.3%
mul-1-neg65.3%
associate-/l*77.9%
mul-1-neg77.9%
sub-neg77.9%
associate-/l*65.3%
unsub-neg65.3%
*-commutative65.3%
*-commutative65.3%
Simplified65.3%
Taylor expanded in t around 0 78.6%
distribute-lft-out--78.6%
*-commutative78.6%
associate-/r*80.9%
div-sub81.8%
sub-neg81.8%
mul-1-neg81.8%
+-commutative81.8%
associate-*r/81.8%
distribute-lft-in81.8%
neg-mul-181.8%
mul-1-neg81.8%
remove-double-neg81.8%
mul-1-neg81.8%
unsub-neg81.8%
Simplified81.8%
if -3.2999999999999998e22 < z < -7.39999999999999965e-53Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 69.7%
div-sub69.7%
associate-/l*69.7%
Applied egg-rr69.7%
if -1.3500000000000001e-71 < z < 0.48999999999999999Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 78.3%
*-commutative78.3%
Simplified78.3%
if 0.48999999999999999 < z < 1.69999999999999997e82Initial program 86.4%
*-commutative86.4%
Simplified86.4%
clear-num85.9%
associate-/r/85.7%
sub-neg85.7%
+-commutative85.7%
*-commutative85.7%
distribute-rgt-neg-in85.7%
fma-def85.7%
Applied egg-rr85.7%
Taylor expanded in x around 0 86.4%
+-commutative86.4%
mul-1-neg86.4%
sub-neg86.4%
mul-1-neg86.4%
associate-/l*99.8%
mul-1-neg99.8%
sub-neg99.8%
associate-/l*86.4%
unsub-neg86.4%
*-commutative86.4%
*-commutative86.4%
Simplified86.4%
Taylor expanded in x around 0 65.7%
mul-1-neg65.7%
*-commutative65.7%
associate-*l/79.1%
distribute-rgt-neg-in79.1%
Simplified79.1%
frac-2neg79.1%
associate-*l/65.7%
add-sqr-sqrt0.0%
sqrt-unprod1.6%
sqr-neg1.6%
sqrt-unprod1.6%
add-sqr-sqrt1.6%
distribute-lft-neg-in1.6%
distribute-rgt-neg-in1.6%
add-sqr-sqrt0.0%
sqrt-unprod65.7%
sqr-neg65.7%
sqrt-unprod65.2%
add-sqr-sqrt65.7%
sub-neg65.7%
distribute-neg-in65.7%
distribute-lft-neg-in65.7%
add-sqr-sqrt0.0%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod28.4%
add-sqr-sqrt28.4%
Applied egg-rr65.7%
associate-/l*79.1%
associate-/r/79.1%
+-commutative79.1%
unsub-neg79.1%
Simplified79.1%
Final simplification79.3%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -5.9e+23)
t_1
(if (<= z -7.4e-53)
(/ (- x (* z y)) t)
(if (or (<= z -1.8e-75) (not (<= z 350.0))) t_1 (/ x (- t (* z a))))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -5.9e+23) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x - (z * y)) / t;
} else if ((z <= -1.8e-75) || !(z <= 350.0)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = (y - (x / z)) / a
if (z <= (-5.9d+23)) then
tmp = t_1
else if (z <= (-7.4d-53)) then
tmp = (x - (z * y)) / t
else if ((z <= (-1.8d-75)) .or. (.not. (z <= 350.0d0))) then
tmp = t_1
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 t_1 = (y - (x / z)) / a;
double tmp;
if (z <= -5.9e+23) {
tmp = t_1;
} else if (z <= -7.4e-53) {
tmp = (x - (z * y)) / t;
} else if ((z <= -1.8e-75) || !(z <= 350.0)) {
tmp = t_1;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -5.9e+23: tmp = t_1 elif z <= -7.4e-53: tmp = (x - (z * y)) / t elif (z <= -1.8e-75) or not (z <= 350.0): tmp = t_1 else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y - Float64(x / z)) / a) tmp = 0.0 if (z <= -5.9e+23) tmp = t_1; elseif (z <= -7.4e-53) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif ((z <= -1.8e-75) || !(z <= 350.0)) tmp = t_1; else tmp = Float64(x / Float64(t - Float64(z * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y - (x / z)) / a; tmp = 0.0; if (z <= -5.9e+23) tmp = t_1; elseif (z <= -7.4e-53) tmp = (x - (z * y)) / t; elseif ((z <= -1.8e-75) || ~((z <= 350.0))) tmp = t_1; else tmp = x / (t - (z * a)); 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, -5.9e+23], t$95$1, If[LessEqual[z, -7.4e-53], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[Or[LessEqual[z, -1.8e-75], N[Not[LessEqual[z, 350.0]], $MachinePrecision]], t$95$1, N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -5.9 \cdot 10^{+23}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.4 \cdot 10^{-53}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-75} \lor \neg \left(z \leq 350\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -5.89999999999999987e23 or -7.39999999999999965e-53 < z < -1.8e-75 or 350 < z Initial program 68.3%
*-commutative68.3%
Simplified68.3%
clear-num68.2%
associate-/r/68.1%
sub-neg68.1%
+-commutative68.1%
*-commutative68.1%
distribute-rgt-neg-in68.1%
fma-def68.1%
Applied egg-rr68.1%
Taylor expanded in x around 0 67.4%
+-commutative67.4%
mul-1-neg67.4%
sub-neg67.4%
mul-1-neg67.4%
associate-/l*80.2%
mul-1-neg80.2%
sub-neg80.2%
associate-/l*67.4%
unsub-neg67.4%
*-commutative67.4%
*-commutative67.4%
Simplified67.4%
Taylor expanded in t around 0 75.7%
distribute-lft-out--75.7%
*-commutative75.7%
associate-/r*77.7%
div-sub78.5%
sub-neg78.5%
mul-1-neg78.5%
+-commutative78.5%
associate-*r/78.5%
distribute-lft-in78.5%
neg-mul-178.5%
mul-1-neg78.5%
remove-double-neg78.5%
mul-1-neg78.5%
unsub-neg78.5%
Simplified78.5%
if -5.89999999999999987e23 < z < -7.39999999999999965e-53Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 69.7%
if -1.8e-75 < z < 350Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 77.7%
*-commutative77.7%
Simplified77.7%
Final simplification77.6%
(FPCore (x y z t a) :precision binary64 (if (<= z 1.6e+92) (/ (- x (* z y)) (- t (* z a))) (/ (- y (/ x z)) a)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= 1.6e+92) {
tmp = (x - (z * y)) / (t - (z * a));
} else {
tmp = (y - (x / 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.6d+92) then
tmp = (x - (z * y)) / (t - (z * a))
else
tmp = (y - (x / 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.6e+92) {
tmp = (x - (z * y)) / (t - (z * a));
} else {
tmp = (y - (x / z)) / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= 1.6e+92: tmp = (x - (z * y)) / (t - (z * a)) else: tmp = (y - (x / z)) / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= 1.6e+92) tmp = Float64(Float64(x - Float64(z * y)) / Float64(t - Float64(z * a))); else tmp = Float64(Float64(y - Float64(x / z)) / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= 1.6e+92) tmp = (x - (z * y)) / (t - (z * a)); else tmp = (y - (x / z)) / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, 1.6e+92], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.6 \cdot 10^{+92}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\end{array}
\end{array}
if z < 1.60000000000000013e92Initial program 93.9%
if 1.60000000000000013e92 < z Initial program 53.2%
*-commutative53.2%
Simplified53.2%
clear-num53.2%
associate-/r/53.1%
sub-neg53.1%
+-commutative53.1%
*-commutative53.1%
distribute-rgt-neg-in53.1%
fma-def53.1%
Applied egg-rr53.1%
Taylor expanded in x around 0 51.4%
+-commutative51.4%
mul-1-neg51.4%
sub-neg51.4%
mul-1-neg51.4%
associate-/l*70.3%
mul-1-neg70.3%
sub-neg70.3%
associate-/l*51.4%
unsub-neg51.4%
*-commutative51.4%
*-commutative51.4%
Simplified51.4%
Taylor expanded in t around 0 84.5%
distribute-lft-out--84.5%
*-commutative84.5%
associate-/r*85.5%
div-sub87.3%
sub-neg87.3%
mul-1-neg87.3%
+-commutative87.3%
associate-*r/87.3%
distribute-lft-in87.3%
neg-mul-187.3%
mul-1-neg87.3%
remove-double-neg87.3%
mul-1-neg87.3%
unsub-neg87.3%
Simplified87.3%
Final simplification92.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -4.8e+23)
(/ y a)
(if (<= z -1.75e-51)
(/ (- z) (/ t y))
(if (<= z -3.2e-86)
(/ (- x) (* z a))
(if (<= z 195.0) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.8e+23) {
tmp = y / a;
} else if (z <= -1.75e-51) {
tmp = -z / (t / y);
} else if (z <= -3.2e-86) {
tmp = -x / (z * a);
} else if (z <= 195.0) {
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 <= (-4.8d+23)) then
tmp = y / a
else if (z <= (-1.75d-51)) then
tmp = -z / (t / y)
else if (z <= (-3.2d-86)) then
tmp = -x / (z * a)
else if (z <= 195.0d0) 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 <= -4.8e+23) {
tmp = y / a;
} else if (z <= -1.75e-51) {
tmp = -z / (t / y);
} else if (z <= -3.2e-86) {
tmp = -x / (z * a);
} else if (z <= 195.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.8e+23: tmp = y / a elif z <= -1.75e-51: tmp = -z / (t / y) elif z <= -3.2e-86: tmp = -x / (z * a) elif z <= 195.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.8e+23) tmp = Float64(y / a); elseif (z <= -1.75e-51) tmp = Float64(Float64(-z) / Float64(t / y)); elseif (z <= -3.2e-86) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 195.0) 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 <= -4.8e+23) tmp = y / a; elseif (z <= -1.75e-51) tmp = -z / (t / y); elseif (z <= -3.2e-86) tmp = -x / (z * a); elseif (z <= 195.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.8e+23], N[(y / a), $MachinePrecision], If[LessEqual[z, -1.75e-51], N[((-z) / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -3.2e-86], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 195.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.8 \cdot 10^{+23}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-51}:\\
\;\;\;\;\frac{-z}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq -3.2 \cdot 10^{-86}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 195:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -4.8e23 or 195 < z Initial program 67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in z around inf 64.7%
if -4.8e23 < z < -1.7499999999999999e-51Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 67.8%
Taylor expanded in x around 0 56.0%
mul-1-neg56.0%
associate-/l*56.0%
associate-/r/55.9%
distribute-rgt-neg-in55.9%
Simplified55.9%
distribute-rgt-neg-out55.9%
associate-/r/56.0%
associate-/r/55.9%
clear-num55.8%
associate-*l/56.0%
*-un-lft-identity56.0%
Applied egg-rr56.0%
if -1.7499999999999999e-51 < z < -3.20000000000000006e-86Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
neg-sub083.7%
sub-neg83.7%
distribute-rgt-neg-out83.7%
+-commutative83.7%
associate--r+83.7%
neg-sub083.7%
distribute-rgt-neg-out83.7%
remove-double-neg83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in y around 0 51.5%
neg-mul-151.5%
distribute-neg-frac51.5%
*-commutative51.5%
Simplified51.5%
if -3.20000000000000006e-86 < z < 195Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 59.4%
Final simplification61.4%
(FPCore (x y z t a)
:precision binary64
(if (<= z -6e+21)
(/ y a)
(if (<= z -7e-50)
(/ (- y) (/ t z))
(if (<= z -1.25e-84)
(/ (- x) (* z a))
(if (<= z 122.0) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -6e+21) {
tmp = y / a;
} else if (z <= -7e-50) {
tmp = -y / (t / z);
} else if (z <= -1.25e-84) {
tmp = -x / (z * a);
} else if (z <= 122.0) {
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 <= (-6d+21)) then
tmp = y / a
else if (z <= (-7d-50)) then
tmp = -y / (t / z)
else if (z <= (-1.25d-84)) then
tmp = -x / (z * a)
else if (z <= 122.0d0) 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 <= -6e+21) {
tmp = y / a;
} else if (z <= -7e-50) {
tmp = -y / (t / z);
} else if (z <= -1.25e-84) {
tmp = -x / (z * a);
} else if (z <= 122.0) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -6e+21: tmp = y / a elif z <= -7e-50: tmp = -y / (t / z) elif z <= -1.25e-84: tmp = -x / (z * a) elif z <= 122.0: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -6e+21) tmp = Float64(y / a); elseif (z <= -7e-50) tmp = Float64(Float64(-y) / Float64(t / z)); elseif (z <= -1.25e-84) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 122.0) 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 <= -6e+21) tmp = y / a; elseif (z <= -7e-50) tmp = -y / (t / z); elseif (z <= -1.25e-84) tmp = -x / (z * a); elseif (z <= 122.0) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -6e+21], N[(y / a), $MachinePrecision], If[LessEqual[z, -7e-50], N[((-y) / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -1.25e-84], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 122.0], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6 \cdot 10^{+21}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq -7 \cdot 10^{-50}:\\
\;\;\;\;\frac{-y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{-84}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 122:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -6e21 or 122 < z Initial program 67.2%
*-commutative67.2%
Simplified67.2%
Taylor expanded in z around inf 64.7%
if -6e21 < z < -6.99999999999999993e-50Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in t around inf 67.8%
Taylor expanded in x around 0 56.0%
mul-1-neg56.0%
associate-/l*56.0%
associate-/r/55.9%
distribute-rgt-neg-in55.9%
Simplified55.9%
distribute-rgt-neg-out55.9%
associate-/r/56.0%
distribute-neg-frac56.0%
Applied egg-rr56.0%
if -6.99999999999999993e-50 < z < -1.25e-84Initial program 99.7%
*-commutative99.7%
Simplified99.7%
Taylor expanded in t around 0 83.7%
associate-*r/83.7%
neg-mul-183.7%
neg-sub083.7%
sub-neg83.7%
distribute-rgt-neg-out83.7%
+-commutative83.7%
associate--r+83.7%
neg-sub083.7%
distribute-rgt-neg-out83.7%
remove-double-neg83.7%
*-commutative83.7%
Simplified83.7%
Taylor expanded in y around 0 51.5%
neg-mul-151.5%
distribute-neg-frac51.5%
*-commutative51.5%
Simplified51.5%
if -1.25e-84 < z < 122Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in z around 0 59.4%
Final simplification61.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -6.5e+109) (not (<= z 620.0))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -6.5e+109) || !(z <= 620.0)) {
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 <= (-6.5d+109)) .or. (.not. (z <= 620.0d0))) 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 <= -6.5e+109) || !(z <= 620.0)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -6.5e+109) or not (z <= 620.0): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -6.5e+109) || !(z <= 620.0)) 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 <= -6.5e+109) || ~((z <= 620.0))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -6.5e+109], N[Not[LessEqual[z, 620.0]], $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 -6.5 \cdot 10^{+109} \lor \neg \left(z \leq 620\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -6.5e109 or 620 < z Initial program 65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in z around inf 68.2%
if -6.5e109 < z < 620Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in x around inf 73.6%
*-commutative73.6%
Simplified73.6%
Final simplification71.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.2e+109) (not (<= z 51.0))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.2e+109) || !(z <= 51.0)) {
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 <= (-5.2d+109)) .or. (.not. (z <= 51.0d0))) 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 <= -5.2e+109) || !(z <= 51.0)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.2e+109) or not (z <= 51.0): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.2e+109) || !(z <= 51.0)) 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 <= -5.2e+109) || ~((z <= 51.0))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.2e+109], N[Not[LessEqual[z, 51.0]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{+109} \lor \neg \left(z \leq 51\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -5.1999999999999997e109 or 51 < z Initial program 65.2%
*-commutative65.2%
Simplified65.2%
Taylor expanded in z around inf 68.2%
if -5.1999999999999997e109 < z < 51Initial program 99.6%
*-commutative99.6%
Simplified99.6%
Taylor expanded in z around 0 53.0%
Final simplification59.5%
(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.8%
*-commutative84.8%
Simplified84.8%
Taylor expanded in z around 0 35.6%
Final simplification35.6%
(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 2023306
(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))))