
(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 -1.05e+177) (not (<= z 4.5e+105))) (/ (- y) (- (/ t 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 <= -1.05e+177) || !(z <= 4.5e+105)) {
tmp = -y / ((t / 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 <= -1.05e+177) || !(z <= 4.5e+105)) tmp = Float64(Float64(-y) / Float64(Float64(t / 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, -1.05e+177], N[Not[LessEqual[z, 4.5e+105]], $MachinePrecision]], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $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 -1.05 \cdot 10^{+177} \lor \neg \left(z \leq 4.5 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{\mathsf{fma}\left(-z, a, t\right)}\\
\end{array}
\end{array}
if z < -1.05000000000000006e177 or 4.5000000000000001e105 < z Initial program 45.8%
*-commutative45.8%
Simplified45.8%
clear-num45.9%
associate-/r/45.9%
sub-neg45.9%
+-commutative45.9%
*-commutative45.9%
distribute-rgt-neg-in45.9%
fma-def45.9%
Applied egg-rr45.9%
Taylor expanded in x around 0 39.8%
mul-1-neg39.8%
associate-/l*58.1%
distribute-neg-frac58.1%
mul-1-neg58.1%
sub-neg58.1%
div-sub58.1%
associate-/l*87.7%
*-inverses87.7%
/-rgt-identity87.7%
Simplified87.7%
if -1.05000000000000006e177 < z < 4.5000000000000001e105Initial program 94.3%
*-commutative94.3%
Simplified94.3%
sub-neg94.3%
+-commutative94.3%
distribute-lft-neg-in94.3%
fma-def94.3%
Applied egg-rr94.3%
Final simplification92.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -9e+172) (not (<= z 5e+105))) (/ (- y) (- (/ t z) a)) (/ (- x (* z y)) (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -9e+172) || !(z <= 5e+105)) {
tmp = -y / ((t / 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 <= (-9d+172)) .or. (.not. (z <= 5d+105))) then
tmp = -y / ((t / 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 <= -9e+172) || !(z <= 5e+105)) {
tmp = -y / ((t / z) - a);
} else {
tmp = (x - (z * y)) / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -9e+172) or not (z <= 5e+105): tmp = -y / ((t / z) - a) else: tmp = (x - (z * y)) / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -9e+172) || !(z <= 5e+105)) tmp = Float64(Float64(-y) / Float64(Float64(t / 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 <= -9e+172) || ~((z <= 5e+105))) tmp = -y / ((t / 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, -9e+172], N[Not[LessEqual[z, 5e+105]], $MachinePrecision]], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $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 -9 \cdot 10^{+172} \lor \neg \left(z \leq 5 \cdot 10^{+105}\right):\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - z \cdot y}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -9.0000000000000004e172 or 5.00000000000000046e105 < z Initial program 45.8%
*-commutative45.8%
Simplified45.8%
clear-num45.9%
associate-/r/45.9%
sub-neg45.9%
+-commutative45.9%
*-commutative45.9%
distribute-rgt-neg-in45.9%
fma-def45.9%
Applied egg-rr45.9%
Taylor expanded in x around 0 39.8%
mul-1-neg39.8%
associate-/l*58.1%
distribute-neg-frac58.1%
mul-1-neg58.1%
sub-neg58.1%
div-sub58.1%
associate-/l*87.7%
*-inverses87.7%
/-rgt-identity87.7%
Simplified87.7%
if -9.0000000000000004e172 < z < 5.00000000000000046e105Initial program 94.3%
Final simplification92.7%
(FPCore (x y z t a)
:precision binary64
(if (<= z -1.15e-76)
(/ (- y (/ x z)) a)
(if (<= z 2.75e-251)
(/ (- x (* z y)) t)
(if (<= z 2e+25) (/ x (- t (* z a))) (/ (- y) (- (/ t z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.15e-76) {
tmp = (y - (x / z)) / a;
} else if (z <= 2.75e-251) {
tmp = (x - (z * y)) / t;
} else if (z <= 2e+25) {
tmp = x / (t - (z * a));
} else {
tmp = -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.15d-76)) then
tmp = (y - (x / z)) / a
else if (z <= 2.75d-251) then
tmp = (x - (z * y)) / t
else if (z <= 2d+25) then
tmp = x / (t - (z * a))
else
tmp = -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.15e-76) {
tmp = (y - (x / z)) / a;
} else if (z <= 2.75e-251) {
tmp = (x - (z * y)) / t;
} else if (z <= 2e+25) {
tmp = x / (t - (z * a));
} else {
tmp = -y / ((t / z) - a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.15e-76: tmp = (y - (x / z)) / a elif z <= 2.75e-251: tmp = (x - (z * y)) / t elif z <= 2e+25: tmp = x / (t - (z * a)) else: tmp = -y / ((t / z) - a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.15e-76) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (z <= 2.75e-251) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 2e+25) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(Float64(-y) / Float64(Float64(t / z) - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.15e-76) tmp = (y - (x / z)) / a; elseif (z <= 2.75e-251) tmp = (x - (z * y)) / t; elseif (z <= 2e+25) tmp = x / (t - (z * a)); else tmp = -y / ((t / z) - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.15e-76], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 2.75e-251], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 2e+25], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{-76}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;z \leq 2.75 \cdot 10^{-251}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\end{array}
\end{array}
if z < -1.15000000000000003e-76Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in t around 0 48.1%
associate-*r/48.1%
neg-mul-148.1%
neg-sub048.1%
sub-neg48.1%
distribute-rgt-neg-out48.1%
+-commutative48.1%
associate--r+48.1%
neg-sub048.1%
distribute-rgt-neg-out48.1%
remove-double-neg48.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in y around 0 66.3%
+-commutative66.3%
mul-1-neg66.3%
sub-neg66.3%
*-commutative66.3%
associate-/r*71.8%
div-sub74.7%
Simplified74.7%
if -1.15000000000000003e-76 < z < 2.75e-251Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 82.9%
if 2.75e-251 < z < 2.00000000000000018e25Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 82.2%
*-commutative82.2%
Simplified82.2%
if 2.00000000000000018e25 < z Initial program 57.7%
*-commutative57.7%
Simplified57.7%
clear-num57.7%
associate-/r/57.7%
sub-neg57.7%
+-commutative57.7%
*-commutative57.7%
distribute-rgt-neg-in57.7%
fma-def57.7%
Applied egg-rr57.7%
Taylor expanded in x around 0 42.9%
mul-1-neg42.9%
associate-/l*59.3%
distribute-neg-frac59.3%
mul-1-neg59.3%
sub-neg59.3%
div-sub59.3%
associate-/l*81.5%
*-inverses81.5%
/-rgt-identity81.5%
Simplified81.5%
Final simplification80.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.8e-77)
(/ (- y (/ x z)) a)
(if (<= z 2.8e-251)
(- (/ x t) (/ (* z y) t))
(if (<= z 1.45e+25) (/ x (- t (* z a))) (/ (- y) (- (/ t z) a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.8e-77) {
tmp = (y - (x / z)) / a;
} else if (z <= 2.8e-251) {
tmp = (x / t) - ((z * y) / t);
} else if (z <= 1.45e+25) {
tmp = x / (t - (z * a));
} else {
tmp = -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 <= (-3.8d-77)) then
tmp = (y - (x / z)) / a
else if (z <= 2.8d-251) then
tmp = (x / t) - ((z * y) / t)
else if (z <= 1.45d+25) then
tmp = x / (t - (z * a))
else
tmp = -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 <= -3.8e-77) {
tmp = (y - (x / z)) / a;
} else if (z <= 2.8e-251) {
tmp = (x / t) - ((z * y) / t);
} else if (z <= 1.45e+25) {
tmp = x / (t - (z * a));
} else {
tmp = -y / ((t / z) - a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.8e-77: tmp = (y - (x / z)) / a elif z <= 2.8e-251: tmp = (x / t) - ((z * y) / t) elif z <= 1.45e+25: tmp = x / (t - (z * a)) else: tmp = -y / ((t / z) - a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.8e-77) tmp = Float64(Float64(y - Float64(x / z)) / a); elseif (z <= 2.8e-251) tmp = Float64(Float64(x / t) - Float64(Float64(z * y) / t)); elseif (z <= 1.45e+25) tmp = Float64(x / Float64(t - Float64(z * a))); else tmp = Float64(Float64(-y) / Float64(Float64(t / z) - a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.8e-77) tmp = (y - (x / z)) / a; elseif (z <= 2.8e-251) tmp = (x / t) - ((z * y) / t); elseif (z <= 1.45e+25) tmp = x / (t - (z * a)); else tmp = -y / ((t / z) - a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.8e-77], N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[z, 2.8e-251], N[(N[(x / t), $MachinePrecision] - N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.45e+25], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[((-y) / N[(N[(t / z), $MachinePrecision] - a), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.8 \cdot 10^{-77}:\\
\;\;\;\;\frac{y - \frac{x}{z}}{a}\\
\mathbf{elif}\;z \leq 2.8 \cdot 10^{-251}:\\
\;\;\;\;\frac{x}{t} - \frac{z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.45 \cdot 10^{+25}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{-y}{\frac{t}{z} - a}\\
\end{array}
\end{array}
if z < -3.7999999999999999e-77Initial program 70.5%
*-commutative70.5%
Simplified70.5%
Taylor expanded in t around 0 48.1%
associate-*r/48.1%
neg-mul-148.1%
neg-sub048.1%
sub-neg48.1%
distribute-rgt-neg-out48.1%
+-commutative48.1%
associate--r+48.1%
neg-sub048.1%
distribute-rgt-neg-out48.1%
remove-double-neg48.1%
*-commutative48.1%
Simplified48.1%
Taylor expanded in y around 0 66.3%
+-commutative66.3%
mul-1-neg66.3%
sub-neg66.3%
*-commutative66.3%
associate-/r*71.8%
div-sub74.7%
Simplified74.7%
if -3.7999999999999999e-77 < z < 2.79999999999999989e-251Initial program 99.8%
*-commutative99.8%
Simplified99.8%
sub-neg99.8%
+-commutative99.8%
distribute-lft-neg-in99.8%
add-cube-cbrt99.3%
associate-*r*99.3%
fma-def99.3%
pow299.3%
Applied egg-rr99.3%
fma-udef99.3%
+-commutative99.3%
associate-*l*99.3%
pow-plus99.3%
metadata-eval99.3%
Simplified99.3%
Taylor expanded in t around inf 82.5%
rem-cube-cbrt82.9%
cancel-sign-sub-inv82.9%
div-sub82.9%
*-commutative82.9%
Applied egg-rr82.9%
if 2.79999999999999989e-251 < z < 1.44999999999999995e25Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in x around inf 82.2%
*-commutative82.2%
Simplified82.2%
if 1.44999999999999995e25 < z Initial program 57.7%
*-commutative57.7%
Simplified57.7%
clear-num57.7%
associate-/r/57.7%
sub-neg57.7%
+-commutative57.7%
*-commutative57.7%
distribute-rgt-neg-in57.7%
fma-def57.7%
Applied egg-rr57.7%
Taylor expanded in x around 0 42.9%
mul-1-neg42.9%
associate-/l*59.3%
distribute-neg-frac59.3%
mul-1-neg59.3%
sub-neg59.3%
div-sub59.3%
associate-/l*81.5%
*-inverses81.5%
/-rgt-identity81.5%
Simplified81.5%
Final simplification80.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.6e+49)
(/ y a)
(if (<= z 4e-251)
(/ (- x (* z y)) t)
(if (<= z 1.05e+101) (/ x (- t (* z a))) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.6e+49) {
tmp = y / a;
} else if (z <= 4e-251) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.05e+101) {
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 <= (-2.6d+49)) then
tmp = y / a
else if (z <= 4d-251) then
tmp = (x - (z * y)) / t
else if (z <= 1.05d+101) 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 <= -2.6e+49) {
tmp = y / a;
} else if (z <= 4e-251) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.05e+101) {
tmp = x / (t - (z * a));
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.6e+49: tmp = y / a elif z <= 4e-251: tmp = (x - (z * y)) / t elif z <= 1.05e+101: tmp = x / (t - (z * a)) else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.6e+49) tmp = Float64(y / a); elseif (z <= 4e-251) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 1.05e+101) 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 <= -2.6e+49) tmp = y / a; elseif (z <= 4e-251) tmp = (x - (z * y)) / t; elseif (z <= 1.05e+101) tmp = x / (t - (z * a)); else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.6e+49], N[(y / a), $MachinePrecision], If[LessEqual[z, 4e-251], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.05e+101], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y / a), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.6 \cdot 10^{+49}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 4 \cdot 10^{-251}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{+101}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.59999999999999989e49 or 1.05e101 < z Initial program 55.7%
*-commutative55.7%
Simplified55.7%
Taylor expanded in z around inf 67.6%
if -2.59999999999999989e49 < z < 4.00000000000000006e-251Initial program 96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in t around inf 73.7%
if 4.00000000000000006e-251 < z < 1.05e101Initial program 96.1%
*-commutative96.1%
Simplified96.1%
Taylor expanded in x around inf 74.4%
*-commutative74.4%
Simplified74.4%
Final simplification71.8%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- y (/ x z)) a)))
(if (<= z -2.65e-76)
t_1
(if (<= z 3e-251)
(/ (- x (* z y)) t)
(if (<= z 1.5e+30) (/ x (- t (* z a))) 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 <= -2.65e-76) {
tmp = t_1;
} else if (z <= 3e-251) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.5e+30) {
tmp = x / (t - (z * a));
} 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 <= (-2.65d-76)) then
tmp = t_1
else if (z <= 3d-251) then
tmp = (x - (z * y)) / t
else if (z <= 1.5d+30) then
tmp = x / (t - (z * a))
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 <= -2.65e-76) {
tmp = t_1;
} else if (z <= 3e-251) {
tmp = (x - (z * y)) / t;
} else if (z <= 1.5e+30) {
tmp = x / (t - (z * a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y - (x / z)) / a tmp = 0 if z <= -2.65e-76: tmp = t_1 elif z <= 3e-251: tmp = (x - (z * y)) / t elif z <= 1.5e+30: tmp = x / (t - (z * a)) 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 <= -2.65e-76) tmp = t_1; elseif (z <= 3e-251) tmp = Float64(Float64(x - Float64(z * y)) / t); elseif (z <= 1.5e+30) tmp = Float64(x / Float64(t - Float64(z * a))); 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 <= -2.65e-76) tmp = t_1; elseif (z <= 3e-251) tmp = (x - (z * y)) / t; elseif (z <= 1.5e+30) tmp = x / (t - (z * a)); 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, -2.65e-76], t$95$1, If[LessEqual[z, 3e-251], N[(N[(x - N[(z * y), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[z, 1.5e+30], N[(x / N[(t - N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y - \frac{x}{z}}{a}\\
\mathbf{if}\;z \leq -2.65 \cdot 10^{-76}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-251}:\\
\;\;\;\;\frac{x - z \cdot y}{t}\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{+30}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -2.65e-76 or 1.49999999999999989e30 < z Initial program 65.1%
*-commutative65.1%
Simplified65.1%
Taylor expanded in t around 0 44.8%
associate-*r/44.8%
neg-mul-144.8%
neg-sub044.8%
sub-neg44.8%
distribute-rgt-neg-out44.8%
+-commutative44.8%
associate--r+44.8%
neg-sub044.8%
distribute-rgt-neg-out44.8%
remove-double-neg44.8%
*-commutative44.8%
Simplified44.8%
Taylor expanded in y around 0 68.8%
+-commutative68.8%
mul-1-neg68.8%
sub-neg68.8%
*-commutative68.8%
associate-/r*73.4%
div-sub75.8%
Simplified75.8%
if -2.65e-76 < z < 2.9999999999999999e-251Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in t around inf 82.9%
if 2.9999999999999999e-251 < z < 1.49999999999999989e30Initial program 98.4%
*-commutative98.4%
Simplified98.4%
Taylor expanded in x around inf 81.0%
*-commutative81.0%
Simplified81.0%
Final simplification78.9%
(FPCore (x y z t a)
:precision binary64
(if (<= z -3.2e-74)
(/ y a)
(if (<= z 3.6e-19)
(/ x t)
(if (<= z 1.7e+63)
(/ (- x) (* z a))
(if (<= z 8.5e+67) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-74) {
tmp = y / a;
} else if (z <= 3.6e-19) {
tmp = x / t;
} else if (z <= 1.7e+63) {
tmp = -x / (z * a);
} else if (z <= 8.5e+67) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-3.2d-74)) then
tmp = y / a
else if (z <= 3.6d-19) then
tmp = x / t
else if (z <= 1.7d+63) then
tmp = -x / (z * a)
else if (z <= 8.5d+67) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.2e-74) {
tmp = y / a;
} else if (z <= 3.6e-19) {
tmp = x / t;
} else if (z <= 1.7e+63) {
tmp = -x / (z * a);
} else if (z <= 8.5e+67) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.2e-74: tmp = y / a elif z <= 3.6e-19: tmp = x / t elif z <= 1.7e+63: tmp = -x / (z * a) elif z <= 8.5e+67: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.2e-74) tmp = Float64(y / a); elseif (z <= 3.6e-19) tmp = Float64(x / t); elseif (z <= 1.7e+63) tmp = Float64(Float64(-x) / Float64(z * a)); elseif (z <= 8.5e+67) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.2e-74) tmp = y / a; elseif (z <= 3.6e-19) tmp = x / t; elseif (z <= 1.7e+63) tmp = -x / (z * a); elseif (z <= 8.5e+67) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.2e-74], N[(y / a), $MachinePrecision], If[LessEqual[z, 3.6e-19], N[(x / t), $MachinePrecision], If[LessEqual[z, 1.7e+63], N[((-x) / N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+67], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{-74}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-19}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+63}:\\
\;\;\;\;\frac{-x}{z \cdot a}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+67}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -3.1999999999999999e-74 or 8.50000000000000038e67 < z Initial program 63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in z around inf 61.3%
if -3.1999999999999999e-74 < z < 3.6000000000000001e-19 or 1.6999999999999999e63 < z < 8.50000000000000038e67Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.0%
if 3.6000000000000001e-19 < z < 1.6999999999999999e63Initial program 88.7%
*-commutative88.7%
Simplified88.7%
Taylor expanded in t around 0 54.1%
associate-*r/54.1%
neg-mul-154.1%
neg-sub054.1%
sub-neg54.1%
distribute-rgt-neg-out54.1%
+-commutative54.1%
associate--r+54.1%
neg-sub054.1%
distribute-rgt-neg-out54.1%
remove-double-neg54.1%
*-commutative54.1%
Simplified54.1%
Taylor expanded in y around 0 48.3%
associate-*r/48.3%
neg-mul-148.3%
*-commutative48.3%
Simplified48.3%
Final simplification61.2%
(FPCore (x y z t a)
:precision binary64
(if (<= z -5.2e-75)
(/ y a)
(if (<= z 8.5e-14)
(/ x t)
(if (<= z 8.2e+67)
(/ (- y) (/ t z))
(if (<= z 3.2e+68) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -5.2e-75) {
tmp = y / a;
} else if (z <= 8.5e-14) {
tmp = x / t;
} else if (z <= 8.2e+67) {
tmp = -y / (t / z);
} else if (z <= 3.2e+68) {
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.2d-75)) then
tmp = y / a
else if (z <= 8.5d-14) then
tmp = x / t
else if (z <= 8.2d+67) then
tmp = -y / (t / z)
else if (z <= 3.2d+68) 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.2e-75) {
tmp = y / a;
} else if (z <= 8.5e-14) {
tmp = x / t;
} else if (z <= 8.2e+67) {
tmp = -y / (t / z);
} else if (z <= 3.2e+68) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -5.2e-75: tmp = y / a elif z <= 8.5e-14: tmp = x / t elif z <= 8.2e+67: tmp = -y / (t / z) elif z <= 3.2e+68: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -5.2e-75) tmp = Float64(y / a); elseif (z <= 8.5e-14) tmp = Float64(x / t); elseif (z <= 8.2e+67) tmp = Float64(Float64(-y) / Float64(t / z)); elseif (z <= 3.2e+68) 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.2e-75) tmp = y / a; elseif (z <= 8.5e-14) tmp = x / t; elseif (z <= 8.2e+67) tmp = -y / (t / z); elseif (z <= 3.2e+68) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -5.2e-75], N[(y / a), $MachinePrecision], If[LessEqual[z, 8.5e-14], N[(x / t), $MachinePrecision], If[LessEqual[z, 8.2e+67], N[((-y) / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e+68], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.2 \cdot 10^{-75}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-14}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{+67}:\\
\;\;\;\;\frac{-y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{+68}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -5.2e-75 or 3.19999999999999994e68 < z Initial program 63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in z around inf 61.3%
if -5.2e-75 < z < 8.50000000000000038e-14 or 8.19999999999999959e67 < z < 3.19999999999999994e68Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.5%
if 8.50000000000000038e-14 < z < 8.19999999999999959e67Initial program 89.2%
*-commutative89.2%
Simplified89.2%
clear-num89.2%
associate-/r/89.0%
sub-neg89.0%
+-commutative89.0%
*-commutative89.0%
distribute-rgt-neg-in89.0%
fma-def88.9%
Applied egg-rr88.9%
Taylor expanded in x around 0 47.0%
mul-1-neg47.0%
associate-/l*57.2%
distribute-neg-frac57.2%
mul-1-neg57.2%
sub-neg57.2%
div-sub57.2%
associate-/l*57.2%
*-inverses57.2%
/-rgt-identity57.2%
Simplified57.2%
Taylor expanded in t around inf 46.3%
Final simplification61.3%
(FPCore (x y z t a)
:precision binary64
(if (<= z -2.1e-74)
(/ y a)
(if (<= z 2.4e-12)
(/ x t)
(if (<= z 4.6e+66)
(/ (- z) (/ t y))
(if (<= z 8.5e+67) (/ x t) (/ y a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e-74) {
tmp = y / a;
} else if (z <= 2.4e-12) {
tmp = x / t;
} else if (z <= 4.6e+66) {
tmp = -z / (t / y);
} else if (z <= 8.5e+67) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-2.1d-74)) then
tmp = y / a
else if (z <= 2.4d-12) then
tmp = x / t
else if (z <= 4.6d+66) then
tmp = -z / (t / y)
else if (z <= 8.5d+67) then
tmp = x / t
else
tmp = y / a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -2.1e-74) {
tmp = y / a;
} else if (z <= 2.4e-12) {
tmp = x / t;
} else if (z <= 4.6e+66) {
tmp = -z / (t / y);
} else if (z <= 8.5e+67) {
tmp = x / t;
} else {
tmp = y / a;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -2.1e-74: tmp = y / a elif z <= 2.4e-12: tmp = x / t elif z <= 4.6e+66: tmp = -z / (t / y) elif z <= 8.5e+67: tmp = x / t else: tmp = y / a return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -2.1e-74) tmp = Float64(y / a); elseif (z <= 2.4e-12) tmp = Float64(x / t); elseif (z <= 4.6e+66) tmp = Float64(Float64(-z) / Float64(t / y)); elseif (z <= 8.5e+67) tmp = Float64(x / t); else tmp = Float64(y / a); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -2.1e-74) tmp = y / a; elseif (z <= 2.4e-12) tmp = x / t; elseif (z <= 4.6e+66) tmp = -z / (t / y); elseif (z <= 8.5e+67) tmp = x / t; else tmp = y / a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -2.1e-74], N[(y / a), $MachinePrecision], If[LessEqual[z, 2.4e-12], N[(x / t), $MachinePrecision], If[LessEqual[z, 4.6e+66], N[((-z) / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 8.5e+67], N[(x / t), $MachinePrecision], N[(y / a), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-74}:\\
\;\;\;\;\frac{y}{a}\\
\mathbf{elif}\;z \leq 2.4 \cdot 10^{-12}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{elif}\;z \leq 4.6 \cdot 10^{+66}:\\
\;\;\;\;\frac{-z}{\frac{t}{y}}\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{+67}:\\
\;\;\;\;\frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{a}\\
\end{array}
\end{array}
if z < -2.1e-74 or 8.50000000000000038e67 < z Initial program 63.0%
*-commutative63.0%
Simplified63.0%
Taylor expanded in z around inf 61.3%
if -2.1e-74 < z < 2.39999999999999987e-12 or 4.6e66 < z < 8.50000000000000038e67Initial program 99.8%
*-commutative99.8%
Simplified99.8%
Taylor expanded in z around 0 63.5%
if 2.39999999999999987e-12 < z < 4.6e66Initial program 89.2%
*-commutative89.2%
Simplified89.2%
sub-neg89.2%
+-commutative89.2%
distribute-lft-neg-in89.2%
add-cube-cbrt88.6%
associate-*r*88.7%
fma-def88.7%
pow288.7%
Applied egg-rr88.7%
fma-udef88.7%
+-commutative88.7%
associate-*l*88.6%
pow-plus88.8%
metadata-eval88.8%
Simplified88.8%
Taylor expanded in t around inf 46.4%
Taylor expanded in x around 0 36.0%
mul-1-neg36.0%
*-commutative36.0%
associate-/l*46.4%
distribute-neg-frac46.4%
Simplified46.4%
Final simplification61.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e+34) (not (<= z 1.05e+101))) (/ y a) (/ x (- t (* z a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e+34) || !(z <= 1.05e+101)) {
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 <= (-2.1d+34)) .or. (.not. (z <= 1.05d+101))) 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 <= -2.1e+34) || !(z <= 1.05e+101)) {
tmp = y / a;
} else {
tmp = x / (t - (z * a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e+34) or not (z <= 1.05e+101): tmp = y / a else: tmp = x / (t - (z * a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e+34) || !(z <= 1.05e+101)) 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 <= -2.1e+34) || ~((z <= 1.05e+101))) tmp = y / a; else tmp = x / (t - (z * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e+34], N[Not[LessEqual[z, 1.05e+101]], $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 -2.1 \cdot 10^{+34} \lor \neg \left(z \leq 1.05 \cdot 10^{+101}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t - z \cdot a}\\
\end{array}
\end{array}
if z < -2.10000000000000017e34 or 1.05e101 < z Initial program 57.4%
*-commutative57.4%
Simplified57.4%
Taylor expanded in z around inf 66.3%
if -2.10000000000000017e34 < z < 1.05e101Initial program 97.4%
*-commutative97.4%
Simplified97.4%
Taylor expanded in x around inf 72.2%
*-commutative72.2%
Simplified72.2%
Final simplification69.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.3e-74) (not (<= z 1.2e+30))) (/ y a) (/ x t)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.3e-74) || !(z <= 1.2e+30)) {
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 <= (-3.3d-74)) .or. (.not. (z <= 1.2d+30))) 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 <= -3.3e-74) || !(z <= 1.2e+30)) {
tmp = y / a;
} else {
tmp = x / t;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.3e-74) or not (z <= 1.2e+30): tmp = y / a else: tmp = x / t return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.3e-74) || !(z <= 1.2e+30)) 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 <= -3.3e-74) || ~((z <= 1.2e+30))) tmp = y / a; else tmp = x / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.3e-74], N[Not[LessEqual[z, 1.2e+30]], $MachinePrecision]], N[(y / a), $MachinePrecision], N[(x / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{-74} \lor \neg \left(z \leq 1.2 \cdot 10^{+30}\right):\\
\;\;\;\;\frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{t}\\
\end{array}
\end{array}
if z < -3.29999999999999996e-74 or 1.2e30 < z Initial program 64.8%
*-commutative64.8%
Simplified64.8%
Taylor expanded in z around inf 58.7%
if -3.29999999999999996e-74 < z < 1.2e30Initial program 99.1%
*-commutative99.1%
Simplified99.1%
Taylor expanded in z around 0 60.1%
Final simplification59.4%
(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 82.4%
*-commutative82.4%
Simplified82.4%
Taylor expanded in z around 0 35.2%
Final simplification35.2%
(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 2023305
(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))))