
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -5e+59) (not (<= z 8.2e+35))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ x (* z y)) (+ (* a t) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5e+59) || !(z <= 8.2e+35)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((z <= (-5d+59)) .or. (.not. (z <= 8.2d+35))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -5e+59) || !(z <= 8.2e+35)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = (x + (z * y)) + ((a * t) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -5e+59) or not (z <= 8.2e+35): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = (x + (z * y)) + ((a * t) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -5e+59) || !(z <= 8.2e+35)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(x + Float64(z * y)) + Float64(Float64(a * t) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -5e+59) || ~((z <= 8.2e+35))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = (x + (z * y)) + ((a * t) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -5e+59], N[Not[LessEqual[z, 8.2e+35]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(N[(a * t), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+59} \lor \neg \left(z \leq 8.2 \cdot 10^{+35}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z \cdot y\right) + \left(a \cdot t + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -4.9999999999999997e59 or 8.1999999999999997e35 < z Initial program 82.5%
associate-+l+82.5%
associate-*l*73.6%
Simplified73.6%
Taylor expanded in z around inf 93.8%
+-commutative93.8%
associate-+l+93.8%
+-commutative93.8%
associate-/l*98.1%
distribute-lft-out99.9%
Simplified99.9%
if -4.9999999999999997e59 < z < 8.1999999999999997e35Initial program 99.7%
associate-+l+99.7%
associate-*l*99.9%
Simplified99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* z a))))
(if (<= z -1.05e+23)
t_1
(if (<= z -1.1e-173)
x
(if (<= z -2.9e-293)
(* a t)
(if (<= z 1.82e-115)
x
(if (<= z 4.3e+36) (* a t) (if (<= z 1.2e+275) t_1 (* z y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (z * a);
double tmp;
if (z <= -1.05e+23) {
tmp = t_1;
} else if (z <= -1.1e-173) {
tmp = x;
} else if (z <= -2.9e-293) {
tmp = a * t;
} else if (z <= 1.82e-115) {
tmp = x;
} else if (z <= 4.3e+36) {
tmp = a * t;
} else if (z <= 1.2e+275) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (z * a)
if (z <= (-1.05d+23)) then
tmp = t_1
else if (z <= (-1.1d-173)) then
tmp = x
else if (z <= (-2.9d-293)) then
tmp = a * t
else if (z <= 1.82d-115) then
tmp = x
else if (z <= 4.3d+36) then
tmp = a * t
else if (z <= 1.2d+275) then
tmp = t_1
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (z * a);
double tmp;
if (z <= -1.05e+23) {
tmp = t_1;
} else if (z <= -1.1e-173) {
tmp = x;
} else if (z <= -2.9e-293) {
tmp = a * t;
} else if (z <= 1.82e-115) {
tmp = x;
} else if (z <= 4.3e+36) {
tmp = a * t;
} else if (z <= 1.2e+275) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (z * a) tmp = 0 if z <= -1.05e+23: tmp = t_1 elif z <= -1.1e-173: tmp = x elif z <= -2.9e-293: tmp = a * t elif z <= 1.82e-115: tmp = x elif z <= 4.3e+36: tmp = a * t elif z <= 1.2e+275: tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(z * a)) tmp = 0.0 if (z <= -1.05e+23) tmp = t_1; elseif (z <= -1.1e-173) tmp = x; elseif (z <= -2.9e-293) tmp = Float64(a * t); elseif (z <= 1.82e-115) tmp = x; elseif (z <= 4.3e+36) tmp = Float64(a * t); elseif (z <= 1.2e+275) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (z * a); tmp = 0.0; if (z <= -1.05e+23) tmp = t_1; elseif (z <= -1.1e-173) tmp = x; elseif (z <= -2.9e-293) tmp = a * t; elseif (z <= 1.82e-115) tmp = x; elseif (z <= 4.3e+36) tmp = a * t; elseif (z <= 1.2e+275) tmp = t_1; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+23], t$95$1, If[LessEqual[z, -1.1e-173], x, If[LessEqual[z, -2.9e-293], N[(a * t), $MachinePrecision], If[LessEqual[z, 1.82e-115], x, If[LessEqual[z, 4.3e+36], N[(a * t), $MachinePrecision], If[LessEqual[z, 1.2e+275], t$95$1, N[(z * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+23}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.1 \cdot 10^{-173}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-293}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{-115}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.3 \cdot 10^{+36}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{+275}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -1.0500000000000001e23 or 4.30000000000000005e36 < z < 1.19999999999999998e275Initial program 83.0%
associate-+l+83.0%
associate-*l*74.7%
Simplified74.7%
add-cube-cbrt74.5%
pow374.6%
Applied egg-rr74.6%
Taylor expanded in b around inf 44.0%
*-commutative44.0%
associate-*r*53.1%
Simplified53.1%
if -1.0500000000000001e23 < z < -1.1e-173 or -2.8999999999999999e-293 < z < 1.82000000000000003e-115Initial program 99.6%
associate-+l+99.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 49.4%
if -1.1e-173 < z < -2.8999999999999999e-293 or 1.82000000000000003e-115 < z < 4.30000000000000005e36Initial program 98.2%
associate-+l+98.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 53.2%
if 1.19999999999999998e275 < z Initial program 100.0%
associate-+l+100.0%
associate-*l*71.4%
Simplified71.4%
Taylor expanded in y around inf 86.3%
*-commutative86.3%
Simplified86.3%
Final simplification52.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= z -1.8e+22)
t_1
(if (<= z -4.2e-182)
x
(if (<= z -3.5e-297)
(* a t)
(if (<= z 3.1e-118)
x
(if (<= z 3.3e+39) (* a t) (if (<= z 5.5e+275) t_1 (* z y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -1.8e+22) {
tmp = t_1;
} else if (z <= -4.2e-182) {
tmp = x;
} else if (z <= -3.5e-297) {
tmp = a * t;
} else if (z <= 3.1e-118) {
tmp = x;
} else if (z <= 3.3e+39) {
tmp = a * t;
} else if (z <= 5.5e+275) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = z * (a * b)
if (z <= (-1.8d+22)) then
tmp = t_1
else if (z <= (-4.2d-182)) then
tmp = x
else if (z <= (-3.5d-297)) then
tmp = a * t
else if (z <= 3.1d-118) then
tmp = x
else if (z <= 3.3d+39) then
tmp = a * t
else if (z <= 5.5d+275) then
tmp = t_1
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (z <= -1.8e+22) {
tmp = t_1;
} else if (z <= -4.2e-182) {
tmp = x;
} else if (z <= -3.5e-297) {
tmp = a * t;
} else if (z <= 3.1e-118) {
tmp = x;
} else if (z <= 3.3e+39) {
tmp = a * t;
} else if (z <= 5.5e+275) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if z <= -1.8e+22: tmp = t_1 elif z <= -4.2e-182: tmp = x elif z <= -3.5e-297: tmp = a * t elif z <= 3.1e-118: tmp = x elif z <= 3.3e+39: tmp = a * t elif z <= 5.5e+275: tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (z <= -1.8e+22) tmp = t_1; elseif (z <= -4.2e-182) tmp = x; elseif (z <= -3.5e-297) tmp = Float64(a * t); elseif (z <= 3.1e-118) tmp = x; elseif (z <= 3.3e+39) tmp = Float64(a * t); elseif (z <= 5.5e+275) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (z <= -1.8e+22) tmp = t_1; elseif (z <= -4.2e-182) tmp = x; elseif (z <= -3.5e-297) tmp = a * t; elseif (z <= 3.1e-118) tmp = x; elseif (z <= 3.3e+39) tmp = a * t; elseif (z <= 5.5e+275) tmp = t_1; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.8e+22], t$95$1, If[LessEqual[z, -4.2e-182], x, If[LessEqual[z, -3.5e-297], N[(a * t), $MachinePrecision], If[LessEqual[z, 3.1e-118], x, If[LessEqual[z, 3.3e+39], N[(a * t), $MachinePrecision], If[LessEqual[z, 5.5e+275], t$95$1, N[(z * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;z \leq -1.8 \cdot 10^{+22}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -4.2 \cdot 10^{-182}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -3.5 \cdot 10^{-297}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-118}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{+39}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{+275}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -1.8e22 or 3.30000000000000021e39 < z < 5.5000000000000002e275Initial program 83.0%
associate-+l+83.0%
associate-*l*74.7%
Simplified74.7%
Taylor expanded in z around inf 84.4%
Taylor expanded in y around 0 52.2%
if -1.8e22 < z < -4.2000000000000001e-182 or -3.4999999999999999e-297 < z < 3.1000000000000001e-118Initial program 99.6%
associate-+l+99.6%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 49.4%
if -4.2000000000000001e-182 < z < -3.4999999999999999e-297 or 3.1000000000000001e-118 < z < 3.30000000000000021e39Initial program 98.2%
associate-+l+98.2%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 53.2%
if 5.5000000000000002e275 < z Initial program 100.0%
associate-+l+100.0%
associate-*l*71.4%
Simplified71.4%
Taylor expanded in y around inf 86.3%
*-commutative86.3%
Simplified86.3%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -2.2e+158)
(and (not (<= z -1.9e+71))
(or (<= z -3400000000.0) (not (<= z 2e+61)))))
(* z (+ y (* a b)))
(+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.2e+158) || (!(z <= -1.9e+71) && ((z <= -3400000000.0) || !(z <= 2e+61)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((z <= (-2.2d+158)) .or. (.not. (z <= (-1.9d+71))) .and. (z <= (-3400000000.0d0)) .or. (.not. (z <= 2d+61))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.2e+158) || (!(z <= -1.9e+71) && ((z <= -3400000000.0) || !(z <= 2e+61)))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.2e+158) or (not (z <= -1.9e+71) and ((z <= -3400000000.0) or not (z <= 2e+61))): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.2e+158) || (!(z <= -1.9e+71) && ((z <= -3400000000.0) || !(z <= 2e+61)))) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.2e+158) || (~((z <= -1.9e+71)) && ((z <= -3400000000.0) || ~((z <= 2e+61))))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.2e+158], And[N[Not[LessEqual[z, -1.9e+71]], $MachinePrecision], Or[LessEqual[z, -3400000000.0], N[Not[LessEqual[z, 2e+61]], $MachinePrecision]]]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+158} \lor \neg \left(z \leq -1.9 \cdot 10^{+71}\right) \land \left(z \leq -3400000000 \lor \neg \left(z \leq 2 \cdot 10^{+61}\right)\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -2.2000000000000001e158 or -1.9e71 < z < -3.4e9 or 1.9999999999999999e61 < z Initial program 84.4%
associate-+l+84.4%
associate-*l*73.4%
Simplified73.4%
Taylor expanded in z around inf 90.8%
if -2.2000000000000001e158 < z < -1.9e71 or -3.4e9 < z < 1.9999999999999999e61Initial program 97.1%
associate-+l+97.1%
+-commutative97.1%
fma-define97.2%
associate-*l*98.0%
*-commutative98.0%
*-commutative98.0%
distribute-rgt-out98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in y around 0 93.2%
Final simplification92.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= t -6.1e+81)
(* a t)
(if (<= t -1.15e-46)
t_1
(if (<= t -2.5e-217)
x
(if (<= t 1.65e-70) t_1 (if (<= t 6.8e+81) x (* a t))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (t <= -6.1e+81) {
tmp = a * t;
} else if (t <= -1.15e-46) {
tmp = t_1;
} else if (t <= -2.5e-217) {
tmp = x;
} else if (t <= 1.65e-70) {
tmp = t_1;
} else if (t <= 6.8e+81) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (t <= (-6.1d+81)) then
tmp = a * t
else if (t <= (-1.15d-46)) then
tmp = t_1
else if (t <= (-2.5d-217)) then
tmp = x
else if (t <= 1.65d-70) then
tmp = t_1
else if (t <= 6.8d+81) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (t <= -6.1e+81) {
tmp = a * t;
} else if (t <= -1.15e-46) {
tmp = t_1;
} else if (t <= -2.5e-217) {
tmp = x;
} else if (t <= 1.65e-70) {
tmp = t_1;
} else if (t <= 6.8e+81) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if t <= -6.1e+81: tmp = a * t elif t <= -1.15e-46: tmp = t_1 elif t <= -2.5e-217: tmp = x elif t <= 1.65e-70: tmp = t_1 elif t <= 6.8e+81: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (t <= -6.1e+81) tmp = Float64(a * t); elseif (t <= -1.15e-46) tmp = t_1; elseif (t <= -2.5e-217) tmp = x; elseif (t <= 1.65e-70) tmp = t_1; elseif (t <= 6.8e+81) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (t <= -6.1e+81) tmp = a * t; elseif (t <= -1.15e-46) tmp = t_1; elseif (t <= -2.5e-217) tmp = x; elseif (t <= 1.65e-70) tmp = t_1; elseif (t <= 6.8e+81) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -6.1e+81], N[(a * t), $MachinePrecision], If[LessEqual[t, -1.15e-46], t$95$1, If[LessEqual[t, -2.5e-217], x, If[LessEqual[t, 1.65e-70], t$95$1, If[LessEqual[t, 6.8e+81], x, N[(a * t), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;t \leq -6.1 \cdot 10^{+81}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq -1.15 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq -2.5 \cdot 10^{-217}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-70}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6.8 \cdot 10^{+81}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -6.10000000000000038e81 or 6.80000000000000005e81 < t Initial program 92.8%
associate-+l+92.8%
associate-*l*86.0%
Simplified86.0%
Taylor expanded in t around inf 56.4%
if -6.10000000000000038e81 < t < -1.15e-46 or -2.5000000000000001e-217 < t < 1.65000000000000008e-70Initial program 92.2%
associate-+l+92.2%
associate-*l*89.5%
Simplified89.5%
add-cube-cbrt89.0%
pow389.1%
Applied egg-rr89.1%
Taylor expanded in b around inf 43.3%
if -1.15e-46 < t < -2.5000000000000001e-217 or 1.65000000000000008e-70 < t < 6.80000000000000005e81Initial program 91.0%
associate-+l+91.0%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in x around inf 47.3%
Final simplification48.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.7)
(* z y)
(if (<= z -3e-183)
x
(if (<= z -2.9e-292)
(* a t)
(if (<= z 8.5e-117) x (if (<= z 2.3e+60) (* a t) (* z y)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.7) {
tmp = z * y;
} else if (z <= -3e-183) {
tmp = x;
} else if (z <= -2.9e-292) {
tmp = a * t;
} else if (z <= 8.5e-117) {
tmp = x;
} else if (z <= 2.3e+60) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if (z <= (-1.7d0)) then
tmp = z * y
else if (z <= (-3d-183)) then
tmp = x
else if (z <= (-2.9d-292)) then
tmp = a * t
else if (z <= 8.5d-117) then
tmp = x
else if (z <= 2.3d+60) then
tmp = a * t
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.7) {
tmp = z * y;
} else if (z <= -3e-183) {
tmp = x;
} else if (z <= -2.9e-292) {
tmp = a * t;
} else if (z <= 8.5e-117) {
tmp = x;
} else if (z <= 2.3e+60) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.7: tmp = z * y elif z <= -3e-183: tmp = x elif z <= -2.9e-292: tmp = a * t elif z <= 8.5e-117: tmp = x elif z <= 2.3e+60: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.7) tmp = Float64(z * y); elseif (z <= -3e-183) tmp = x; elseif (z <= -2.9e-292) tmp = Float64(a * t); elseif (z <= 8.5e-117) tmp = x; elseif (z <= 2.3e+60) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.7) tmp = z * y; elseif (z <= -3e-183) tmp = x; elseif (z <= -2.9e-292) tmp = a * t; elseif (z <= 8.5e-117) tmp = x; elseif (z <= 2.3e+60) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.7], N[(z * y), $MachinePrecision], If[LessEqual[z, -3e-183], x, If[LessEqual[z, -2.9e-292], N[(a * t), $MachinePrecision], If[LessEqual[z, 8.5e-117], x, If[LessEqual[z, 2.3e+60], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.7:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -3 \cdot 10^{-183}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq -2.9 \cdot 10^{-292}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 8.5 \cdot 10^{-117}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+60}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -1.69999999999999996 or 2.30000000000000017e60 < z Initial program 84.4%
associate-+l+84.4%
associate-*l*75.2%
Simplified75.2%
Taylor expanded in y around inf 44.0%
*-commutative44.0%
Simplified44.0%
if -1.69999999999999996 < z < -2.9999999999999998e-183 or -2.89999999999999993e-292 < z < 8.49999999999999981e-117Initial program 99.5%
associate-+l+99.5%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 51.8%
if -2.9999999999999998e-183 < z < -2.89999999999999993e-292 or 8.49999999999999981e-117 < z < 2.30000000000000017e60Initial program 98.3%
associate-+l+98.3%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 52.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))) (t_2 (* a (+ t (* z b)))))
(if (<= a -4.6e-34)
t_2
(if (<= a 1e-17)
t_1
(if (<= a 8.6e+95) (+ x (* a t)) (if (<= a 1.6e+131) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -4.6e-34) {
tmp = t_2;
} else if (a <= 1e-17) {
tmp = t_1;
} else if (a <= 8.6e+95) {
tmp = x + (a * t);
} else if (a <= 1.6e+131) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (z * y)
t_2 = a * (t + (z * b))
if (a <= (-4.6d-34)) then
tmp = t_2
else if (a <= 1d-17) then
tmp = t_1
else if (a <= 8.6d+95) then
tmp = x + (a * t)
else if (a <= 1.6d+131) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double t_2 = a * (t + (z * b));
double tmp;
if (a <= -4.6e-34) {
tmp = t_2;
} else if (a <= 1e-17) {
tmp = t_1;
} else if (a <= 8.6e+95) {
tmp = x + (a * t);
} else if (a <= 1.6e+131) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) t_2 = a * (t + (z * b)) tmp = 0 if a <= -4.6e-34: tmp = t_2 elif a <= 1e-17: tmp = t_1 elif a <= 8.6e+95: tmp = x + (a * t) elif a <= 1.6e+131: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) t_2 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -4.6e-34) tmp = t_2; elseif (a <= 1e-17) tmp = t_1; elseif (a <= 8.6e+95) tmp = Float64(x + Float64(a * t)); elseif (a <= 1.6e+131) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); t_2 = a * (t + (z * b)); tmp = 0.0; if (a <= -4.6e-34) tmp = t_2; elseif (a <= 1e-17) tmp = t_1; elseif (a <= 8.6e+95) tmp = x + (a * t); elseif (a <= 1.6e+131) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -4.6e-34], t$95$2, If[LessEqual[a, 1e-17], t$95$1, If[LessEqual[a, 8.6e+95], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.6e+131], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
t_2 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -4.6 \cdot 10^{-34}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;a \leq 10^{-17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 8.6 \cdot 10^{+95}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+131}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if a < -4.60000000000000022e-34 or 1.6000000000000001e131 < a Initial program 83.7%
associate-+l+83.7%
associate-*l*89.9%
Simplified89.9%
Taylor expanded in a around inf 80.7%
if -4.60000000000000022e-34 < a < 1.00000000000000007e-17 or 8.6e95 < a < 1.6000000000000001e131Initial program 98.1%
associate-+l+98.1%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in a around 0 71.1%
if 1.00000000000000007e-17 < a < 8.6e95Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 74.9%
+-commutative74.9%
Simplified74.9%
Final simplification75.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))))
(if (<= z -2.7e+226)
t_1
(if (<= z -1e+121)
(* z (* a b))
(if (or (<= z -3400000000.0) (not (<= z 1.55e+60)))
t_1
(+ x (* a t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double tmp;
if (z <= -2.7e+226) {
tmp = t_1;
} else if (z <= -1e+121) {
tmp = z * (a * b);
} else if ((z <= -3400000000.0) || !(z <= 1.55e+60)) {
tmp = t_1;
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (z * y)
if (z <= (-2.7d+226)) then
tmp = t_1
else if (z <= (-1d+121)) then
tmp = z * (a * b)
else if ((z <= (-3400000000.0d0)) .or. (.not. (z <= 1.55d+60))) then
tmp = t_1
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double tmp;
if (z <= -2.7e+226) {
tmp = t_1;
} else if (z <= -1e+121) {
tmp = z * (a * b);
} else if ((z <= -3400000000.0) || !(z <= 1.55e+60)) {
tmp = t_1;
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) tmp = 0 if z <= -2.7e+226: tmp = t_1 elif z <= -1e+121: tmp = z * (a * b) elif (z <= -3400000000.0) or not (z <= 1.55e+60): tmp = t_1 else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) tmp = 0.0 if (z <= -2.7e+226) tmp = t_1; elseif (z <= -1e+121) tmp = Float64(z * Float64(a * b)); elseif ((z <= -3400000000.0) || !(z <= 1.55e+60)) tmp = t_1; else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); tmp = 0.0; if (z <= -2.7e+226) tmp = t_1; elseif (z <= -1e+121) tmp = z * (a * b); elseif ((z <= -3400000000.0) || ~((z <= 1.55e+60))) tmp = t_1; else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.7e+226], t$95$1, If[LessEqual[z, -1e+121], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[z, -3400000000.0], N[Not[LessEqual[z, 1.55e+60]], $MachinePrecision]], t$95$1, N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;z \leq -2.7 \cdot 10^{+226}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1 \cdot 10^{+121}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -3400000000 \lor \neg \left(z \leq 1.55 \cdot 10^{+60}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -2.7000000000000003e226 or -1.00000000000000004e121 < z < -3.4e9 or 1.55e60 < z Initial program 84.3%
associate-+l+84.3%
associate-*l*77.5%
Simplified77.5%
Taylor expanded in a around 0 59.1%
if -2.7000000000000003e226 < z < -1.00000000000000004e121Initial program 83.4%
associate-+l+83.4%
associate-*l*64.0%
Simplified64.0%
Taylor expanded in z around inf 87.2%
Taylor expanded in y around 0 70.8%
if -3.4e9 < z < 1.55e60Initial program 99.0%
associate-+l+99.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 75.9%
+-commutative75.9%
Simplified75.9%
Final simplification69.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.8e-74) (not (<= z 2.8))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e-74) || !(z <= 2.8)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.8d-74)) .or. (.not. (z <= 2.8d0))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.8e-74) || !(z <= 2.8)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.8e-74) or not (z <= 2.8): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.8e-74) || !(z <= 2.8)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.8e-74) || ~((z <= 2.8))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.8e-74], N[Not[LessEqual[z, 2.8]], $MachinePrecision]], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.8 \cdot 10^{-74} \lor \neg \left(z \leq 2.8\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -1.8000000000000001e-74 or 2.7999999999999998 < z Initial program 86.5%
associate-+l+86.5%
associate-*l*79.6%
Simplified79.6%
Taylor expanded in z around inf 94.5%
+-commutative94.5%
associate-+l+94.5%
+-commutative94.5%
associate-/l*97.2%
distribute-lft-out98.6%
Simplified98.6%
if -1.8000000000000001e-74 < z < 2.7999999999999998Initial program 99.7%
associate-+l+99.7%
+-commutative99.7%
fma-define99.7%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 97.1%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4200.0) (not (<= z 6.6e+44))) (* z (+ y (* a b))) (+ x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4200.0) || !(z <= 6.6e+44)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((z <= (-4200.0d0)) .or. (.not. (z <= 6.6d+44))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4200.0) || !(z <= 6.6e+44)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4200.0) or not (z <= 6.6e+44): tmp = z * (y + (a * b)) else: tmp = x + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4200.0) || !(z <= 6.6e+44)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4200.0) || ~((z <= 6.6e+44))) tmp = z * (y + (a * b)); else tmp = x + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4200.0], N[Not[LessEqual[z, 6.6e+44]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4200 \lor \neg \left(z \leq 6.6 \cdot 10^{+44}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot t\\
\end{array}
\end{array}
if z < -4200 or 6.60000000000000027e44 < z Initial program 84.6%
associate-+l+84.6%
associate-*l*75.6%
Simplified75.6%
Taylor expanded in z around inf 85.1%
if -4200 < z < 6.60000000000000027e44Initial program 99.0%
associate-+l+99.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 77.3%
+-commutative77.3%
Simplified77.3%
Final simplification81.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -5e+16) (not (<= a 1.65e+131))) (* b (* z a)) (+ x (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5e+16) || !(a <= 1.65e+131)) {
tmp = b * (z * a);
} else {
tmp = x + (z * y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((a <= (-5d+16)) .or. (.not. (a <= 1.65d+131))) then
tmp = b * (z * a)
else
tmp = x + (z * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -5e+16) || !(a <= 1.65e+131)) {
tmp = b * (z * a);
} else {
tmp = x + (z * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -5e+16) or not (a <= 1.65e+131): tmp = b * (z * a) else: tmp = x + (z * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -5e+16) || !(a <= 1.65e+131)) tmp = Float64(b * Float64(z * a)); else tmp = Float64(x + Float64(z * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -5e+16) || ~((a <= 1.65e+131))) tmp = b * (z * a); else tmp = x + (z * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -5e+16], N[Not[LessEqual[a, 1.65e+131]], $MachinePrecision]], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5 \cdot 10^{+16} \lor \neg \left(a \leq 1.65 \cdot 10^{+131}\right):\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot y\\
\end{array}
\end{array}
if a < -5e16 or 1.6499999999999999e131 < a Initial program 81.9%
associate-+l+81.9%
associate-*l*88.8%
Simplified88.8%
add-cube-cbrt88.4%
pow388.5%
Applied egg-rr88.5%
Taylor expanded in b around inf 53.9%
*-commutative53.9%
associate-*r*54.9%
Simplified54.9%
if -5e16 < a < 1.6499999999999999e131Initial program 98.5%
associate-+l+98.5%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in a around 0 66.7%
Final simplification62.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -2.55e+56) (not (<= t 6e+81))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.55e+56) || !(t <= 6e+81)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: tmp
if ((t <= (-2.55d+56)) .or. (.not. (t <= 6d+81))) then
tmp = a * t
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -2.55e+56) || !(t <= 6e+81)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -2.55e+56) or not (t <= 6e+81): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -2.55e+56) || !(t <= 6e+81)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -2.55e+56) || ~((t <= 6e+81))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -2.55e+56], N[Not[LessEqual[t, 6e+81]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.55 \cdot 10^{+56} \lor \neg \left(t \leq 6 \cdot 10^{+81}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.5500000000000001e56 or 5.99999999999999995e81 < t Initial program 92.3%
associate-+l+92.3%
associate-*l*87.1%
Simplified87.1%
Taylor expanded in t around inf 54.3%
if -2.5500000000000001e56 < t < 5.99999999999999995e81Initial program 92.0%
associate-+l+92.0%
associate-*l*88.8%
Simplified88.8%
Taylor expanded in x around inf 33.2%
Final simplification40.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 92.1%
associate-+l+92.1%
associate-*l*88.2%
Simplified88.2%
Taylor expanded in x around inf 27.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
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), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
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 b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024087
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(if (< z -11820553527347888000.0) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 4.7589743188364287e-122) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))