
(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 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 98.9%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*19.0%
Simplified19.0%
Taylor expanded in a around inf 85.7%
Final simplification97.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= x -5.2e+45)
x
(if (<= x -1.2e-13)
t_1
(if (<= x -1.8e-296)
(* t a)
(if (<= x 2.15e-262)
(* y z)
(if (<= x 1.4e-251)
(* t a)
(if (<= x 2.2e-156)
t_1
(if (<= x 5.5e-91) (* y z) (if (<= x 1.45e+56) t_1 x))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (x <= -5.2e+45) {
tmp = x;
} else if (x <= -1.2e-13) {
tmp = t_1;
} else if (x <= -1.8e-296) {
tmp = t * a;
} else if (x <= 2.15e-262) {
tmp = y * z;
} else if (x <= 1.4e-251) {
tmp = t * a;
} else if (x <= 2.2e-156) {
tmp = t_1;
} else if (x <= 5.5e-91) {
tmp = y * z;
} else if (x <= 1.45e+56) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (x <= (-5.2d+45)) then
tmp = x
else if (x <= (-1.2d-13)) then
tmp = t_1
else if (x <= (-1.8d-296)) then
tmp = t * a
else if (x <= 2.15d-262) then
tmp = y * z
else if (x <= 1.4d-251) then
tmp = t * a
else if (x <= 2.2d-156) then
tmp = t_1
else if (x <= 5.5d-91) then
tmp = y * z
else if (x <= 1.45d+56) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (x <= -5.2e+45) {
tmp = x;
} else if (x <= -1.2e-13) {
tmp = t_1;
} else if (x <= -1.8e-296) {
tmp = t * a;
} else if (x <= 2.15e-262) {
tmp = y * z;
} else if (x <= 1.4e-251) {
tmp = t * a;
} else if (x <= 2.2e-156) {
tmp = t_1;
} else if (x <= 5.5e-91) {
tmp = y * z;
} else if (x <= 1.45e+56) {
tmp = t_1;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if x <= -5.2e+45: tmp = x elif x <= -1.2e-13: tmp = t_1 elif x <= -1.8e-296: tmp = t * a elif x <= 2.15e-262: tmp = y * z elif x <= 1.4e-251: tmp = t * a elif x <= 2.2e-156: tmp = t_1 elif x <= 5.5e-91: tmp = y * z elif x <= 1.45e+56: tmp = t_1 else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (x <= -5.2e+45) tmp = x; elseif (x <= -1.2e-13) tmp = t_1; elseif (x <= -1.8e-296) tmp = Float64(t * a); elseif (x <= 2.15e-262) tmp = Float64(y * z); elseif (x <= 1.4e-251) tmp = Float64(t * a); elseif (x <= 2.2e-156) tmp = t_1; elseif (x <= 5.5e-91) tmp = Float64(y * z); elseif (x <= 1.45e+56) tmp = t_1; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (x <= -5.2e+45) tmp = x; elseif (x <= -1.2e-13) tmp = t_1; elseif (x <= -1.8e-296) tmp = t * a; elseif (x <= 2.15e-262) tmp = y * z; elseif (x <= 1.4e-251) tmp = t * a; elseif (x <= 2.2e-156) tmp = t_1; elseif (x <= 5.5e-91) tmp = y * z; elseif (x <= 1.45e+56) tmp = t_1; else tmp = x; 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[x, -5.2e+45], x, If[LessEqual[x, -1.2e-13], t$95$1, If[LessEqual[x, -1.8e-296], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.15e-262], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.4e-251], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.2e-156], t$95$1, If[LessEqual[x, 5.5e-91], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.45e+56], t$95$1, x]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;x \leq -5.2 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.8 \cdot 10^{-296}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2.15 \cdot 10^{-262}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.4 \cdot 10^{-251}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2.2 \cdot 10^{-156}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 5.5 \cdot 10^{-91}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.45 \cdot 10^{+56}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.20000000000000014e45 or 1.45000000000000004e56 < x Initial program 92.5%
associate-+l+92.5%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around inf 51.5%
if -5.20000000000000014e45 < x < -1.1999999999999999e-13 or 1.39999999999999994e-251 < x < 2.1999999999999999e-156 or 5.49999999999999965e-91 < x < 1.45000000000000004e56Initial program 88.0%
associate-+l+88.0%
+-commutative88.0%
fma-define88.0%
associate-*l*88.0%
*-commutative88.0%
*-commutative88.0%
distribute-rgt-out89.7%
remove-double-neg89.7%
*-commutative89.7%
distribute-lft-neg-out89.7%
sub-neg89.7%
sub-neg89.7%
distribute-lft-neg-out89.7%
*-commutative89.7%
remove-double-neg89.7%
*-commutative89.7%
Simplified89.7%
Taylor expanded in t around inf 79.9%
associate-/l*73.4%
Simplified73.4%
Taylor expanded in b around inf 60.5%
if -1.1999999999999999e-13 < x < -1.7999999999999999e-296 or 2.1500000000000001e-262 < x < 1.39999999999999994e-251Initial program 87.1%
associate-+l+87.1%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in t around inf 51.5%
if -1.7999999999999999e-296 < x < 2.1500000000000001e-262 or 2.1999999999999999e-156 < x < 5.49999999999999965e-91Initial program 96.8%
associate-+l+96.8%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in y around inf 58.8%
*-commutative58.8%
Simplified58.8%
Final simplification54.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (* z a))))
(if (<= x -4.4e+45)
x
(if (<= x -1.55e-11)
t_1
(if (<= x -1.15e-262)
(* t a)
(if (<= x 6.8e-157)
t_1
(if (<= x 4.3e-91)
(* y z)
(if (<= x 3.15e+63) (* a (* z b)) x))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (z * a);
double tmp;
if (x <= -4.4e+45) {
tmp = x;
} else if (x <= -1.55e-11) {
tmp = t_1;
} else if (x <= -1.15e-262) {
tmp = t * a;
} else if (x <= 6.8e-157) {
tmp = t_1;
} else if (x <= 4.3e-91) {
tmp = y * z;
} else if (x <= 3.15e+63) {
tmp = a * (z * b);
} 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) :: t_1
real(8) :: tmp
t_1 = b * (z * a)
if (x <= (-4.4d+45)) then
tmp = x
else if (x <= (-1.55d-11)) then
tmp = t_1
else if (x <= (-1.15d-262)) then
tmp = t * a
else if (x <= 6.8d-157) then
tmp = t_1
else if (x <= 4.3d-91) then
tmp = y * z
else if (x <= 3.15d+63) then
tmp = a * (z * b)
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 t_1 = b * (z * a);
double tmp;
if (x <= -4.4e+45) {
tmp = x;
} else if (x <= -1.55e-11) {
tmp = t_1;
} else if (x <= -1.15e-262) {
tmp = t * a;
} else if (x <= 6.8e-157) {
tmp = t_1;
} else if (x <= 4.3e-91) {
tmp = y * z;
} else if (x <= 3.15e+63) {
tmp = a * (z * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (z * a) tmp = 0 if x <= -4.4e+45: tmp = x elif x <= -1.55e-11: tmp = t_1 elif x <= -1.15e-262: tmp = t * a elif x <= 6.8e-157: tmp = t_1 elif x <= 4.3e-91: tmp = y * z elif x <= 3.15e+63: tmp = a * (z * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(z * a)) tmp = 0.0 if (x <= -4.4e+45) tmp = x; elseif (x <= -1.55e-11) tmp = t_1; elseif (x <= -1.15e-262) tmp = Float64(t * a); elseif (x <= 6.8e-157) tmp = t_1; elseif (x <= 4.3e-91) tmp = Float64(y * z); elseif (x <= 3.15e+63) tmp = Float64(a * Float64(z * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (z * a); tmp = 0.0; if (x <= -4.4e+45) tmp = x; elseif (x <= -1.55e-11) tmp = t_1; elseif (x <= -1.15e-262) tmp = t * a; elseif (x <= 6.8e-157) tmp = t_1; elseif (x <= 4.3e-91) tmp = y * z; elseif (x <= 3.15e+63) tmp = a * (z * b); else tmp = x; 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[x, -4.4e+45], x, If[LessEqual[x, -1.55e-11], t$95$1, If[LessEqual[x, -1.15e-262], N[(t * a), $MachinePrecision], If[LessEqual[x, 6.8e-157], t$95$1, If[LessEqual[x, 4.3e-91], N[(y * z), $MachinePrecision], If[LessEqual[x, 3.15e+63], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;x \leq -4.4 \cdot 10^{+45}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.55 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq -1.15 \cdot 10^{-262}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 6.8 \cdot 10^{-157}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 4.3 \cdot 10^{-91}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 3.15 \cdot 10^{+63}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.4000000000000001e45 or 3.1499999999999999e63 < x Initial program 92.5%
associate-+l+92.5%
associate-*l*92.6%
Simplified92.6%
Taylor expanded in x around inf 51.5%
if -4.4000000000000001e45 < x < -1.55000000000000014e-11 or -1.15000000000000005e-262 < x < 6.79999999999999955e-157Initial program 92.1%
associate-+l+92.1%
+-commutative92.1%
fma-define92.1%
associate-*l*86.6%
*-commutative86.6%
*-commutative86.6%
distribute-rgt-out86.6%
remove-double-neg86.6%
*-commutative86.6%
distribute-lft-neg-out86.6%
sub-neg86.6%
sub-neg86.6%
distribute-lft-neg-out86.6%
*-commutative86.6%
remove-double-neg86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in t around inf 77.3%
associate-/l*73.5%
Simplified73.5%
Taylor expanded in b around inf 47.1%
*-commutative47.1%
associate-*r*54.5%
Simplified54.5%
if -1.55000000000000014e-11 < x < -1.15000000000000005e-262Initial program 86.8%
associate-+l+86.8%
associate-*l*90.0%
Simplified90.0%
Taylor expanded in t around inf 50.6%
if 6.79999999999999955e-157 < x < 4.3e-91Initial program 93.8%
associate-+l+93.8%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around inf 63.2%
*-commutative63.2%
Simplified63.2%
if 4.3e-91 < x < 3.1499999999999999e63Initial program 87.3%
associate-+l+87.3%
+-commutative87.3%
fma-define87.3%
associate-*l*87.4%
*-commutative87.4%
*-commutative87.4%
distribute-rgt-out90.5%
remove-double-neg90.5%
*-commutative90.5%
distribute-lft-neg-out90.5%
sub-neg90.5%
sub-neg90.5%
distribute-lft-neg-out90.5%
*-commutative90.5%
remove-double-neg90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in t around inf 81.3%
associate-/l*72.4%
Simplified72.4%
Taylor expanded in b around inf 60.4%
Final simplification53.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z (+ y (* a b))))))
(if (<= z -2.35e+64)
t_1
(if (<= z -1.8e-150)
(+ (+ x (* y z)) (* b (* a (+ z (/ t b)))))
(if (<= z 1.8e-104) (+ x (+ (* t a) (* a (* z b)))) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * (y + (a * b)));
double tmp;
if (z <= -2.35e+64) {
tmp = t_1;
} else if (z <= -1.8e-150) {
tmp = (x + (y * z)) + (b * (a * (z + (t / b))));
} else if (z <= 1.8e-104) {
tmp = x + ((t * a) + (a * (z * b)));
} 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 = x + (z * (y + (a * b)))
if (z <= (-2.35d+64)) then
tmp = t_1
else if (z <= (-1.8d-150)) then
tmp = (x + (y * z)) + (b * (a * (z + (t / b))))
else if (z <= 1.8d-104) then
tmp = x + ((t * a) + (a * (z * b)))
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 = x + (z * (y + (a * b)));
double tmp;
if (z <= -2.35e+64) {
tmp = t_1;
} else if (z <= -1.8e-150) {
tmp = (x + (y * z)) + (b * (a * (z + (t / b))));
} else if (z <= 1.8e-104) {
tmp = x + ((t * a) + (a * (z * b)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * (y + (a * b))) tmp = 0 if z <= -2.35e+64: tmp = t_1 elif z <= -1.8e-150: tmp = (x + (y * z)) + (b * (a * (z + (t / b)))) elif z <= 1.8e-104: tmp = x + ((t * a) + (a * (z * b))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * Float64(y + Float64(a * b)))) tmp = 0.0 if (z <= -2.35e+64) tmp = t_1; elseif (z <= -1.8e-150) tmp = Float64(Float64(x + Float64(y * z)) + Float64(b * Float64(a * Float64(z + Float64(t / b))))); elseif (z <= 1.8e-104) tmp = Float64(x + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * (y + (a * b))); tmp = 0.0; if (z <= -2.35e+64) tmp = t_1; elseif (z <= -1.8e-150) tmp = (x + (y * z)) + (b * (a * (z + (t / b)))); elseif (z <= 1.8e-104) tmp = x + ((t * a) + (a * (z * b))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.35e+64], t$95$1, If[LessEqual[z, -1.8e-150], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a * N[(z + N[(t / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.8e-104], N[(x + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -2.35 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.8 \cdot 10^{-150}:\\
\;\;\;\;\left(x + y \cdot z\right) + b \cdot \left(a \cdot \left(z + \frac{t}{b}\right)\right)\\
\mathbf{elif}\;z \leq 1.8 \cdot 10^{-104}:\\
\;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.35000000000000015e64 or 1.7999999999999999e-104 < z Initial program 85.8%
associate-+l+85.8%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in t around 0 78.2%
+-commutative78.2%
+-commutative78.2%
associate-*r*82.6%
distribute-rgt-in88.5%
Simplified88.5%
if -2.35000000000000015e64 < z < -1.8000000000000001e-150Initial program 95.0%
associate-+l+95.0%
associate-*l*97.5%
Simplified97.5%
Taylor expanded in b around inf 92.8%
associate-/l*90.3%
distribute-lft-out92.8%
Simplified92.8%
if -1.8000000000000001e-150 < z < 1.7999999999999999e-104Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around 0 94.0%
Final simplification90.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.5e+93) (not (<= z 2.35e+169))) (+ x (* z (+ y (* a b)))) (+ (+ x (* y z)) (+ (* t a) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.5e+93) || !(z <= 2.35e+169)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((t * a) + (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 <= (-3.5d+93)) .or. (.not. (z <= 2.35d+169))) then
tmp = x + (z * (y + (a * b)))
else
tmp = (x + (y * z)) + ((t * a) + (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 <= -3.5e+93) || !(z <= 2.35e+169)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = (x + (y * z)) + ((t * a) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.5e+93) or not (z <= 2.35e+169): tmp = x + (z * (y + (a * b))) else: tmp = (x + (y * z)) + ((t * a) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.5e+93) || !(z <= 2.35e+169)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -3.5e+93) || ~((z <= 2.35e+169))) tmp = x + (z * (y + (a * b))); else tmp = (x + (y * z)) + ((t * a) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.5e+93], N[Not[LessEqual[z, 2.35e+169]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.5 \cdot 10^{+93} \lor \neg \left(z \leq 2.35 \cdot 10^{+169}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -3.49999999999999998e93 or 2.3499999999999999e169 < z Initial program 76.6%
associate-+l+76.6%
associate-*l*74.4%
Simplified74.4%
Taylor expanded in t around 0 74.7%
+-commutative74.7%
+-commutative74.7%
associate-*r*82.1%
distribute-rgt-in92.5%
Simplified92.5%
if -3.49999999999999998e93 < z < 2.3499999999999999e169Initial program 96.8%
associate-+l+96.8%
associate-*l*97.7%
Simplified97.7%
Final simplification96.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.5e-163) (not (<= z 2.4e-102))) (+ x (* z (+ y (* a b)))) (+ x (+ (* t a) (* a (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.5e-163) || !(z <= 2.4e-102)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((t * a) + (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 <= (-4.5d-163)) .or. (.not. (z <= 2.4d-102))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + ((t * a) + (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 <= -4.5e-163) || !(z <= 2.4e-102)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((t * a) + (a * (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.5e-163) or not (z <= 2.4e-102): tmp = x + (z * (y + (a * b))) else: tmp = x + ((t * a) + (a * (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.5e-163) || !(z <= 2.4e-102)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.5e-163) || ~((z <= 2.4e-102))) tmp = x + (z * (y + (a * b))); else tmp = x + ((t * a) + (a * (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.5e-163], N[Not[LessEqual[z, 2.4e-102]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{-163} \lor \neg \left(z \leq 2.4 \cdot 10^{-102}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -4.4999999999999997e-163 or 2.4e-102 < z Initial program 87.9%
associate-+l+87.9%
associate-*l*87.9%
Simplified87.9%
Taylor expanded in t around 0 78.3%
+-commutative78.3%
+-commutative78.3%
associate-*r*82.1%
distribute-rgt-in86.7%
Simplified86.7%
if -4.4999999999999997e-163 < z < 2.4e-102Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around 0 95.1%
Final simplification88.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.8e-177) (not (<= z 3.4e-140))) (+ x (* z (+ y (* a b)))) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.8e-177) || !(z <= 3.4e-140)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (t * a);
}
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.8d-177)) .or. (.not. (z <= 3.4d-140))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + (t * a)
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.8e-177) || !(z <= 3.4e-140)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.8e-177) or not (z <= 3.4e-140): tmp = x + (z * (y + (a * b))) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.8e-177) || !(z <= 3.4e-140)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.8e-177) || ~((z <= 3.4e-140))) tmp = x + (z * (y + (a * b))); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.8e-177], N[Not[LessEqual[z, 3.4e-140]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{-177} \lor \neg \left(z \leq 3.4 \cdot 10^{-140}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -2.79999999999999987e-177 or 3.40000000000000008e-140 < z Initial program 88.4%
associate-+l+88.4%
associate-*l*88.3%
Simplified88.3%
Taylor expanded in t around 0 78.6%
+-commutative78.6%
+-commutative78.6%
associate-*r*81.8%
distribute-rgt-in86.2%
Simplified86.2%
if -2.79999999999999987e-177 < z < 3.40000000000000008e-140Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 90.8%
+-commutative90.8%
Simplified90.8%
Final simplification87.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -5.2e+14) x (if (<= x -1.5e-296) (* t a) (if (<= x 2.4e+69) (* y z) x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -5.2e+14) {
tmp = x;
} else if (x <= -1.5e-296) {
tmp = t * a;
} else if (x <= 2.4e+69) {
tmp = y * z;
} 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 (x <= (-5.2d+14)) then
tmp = x
else if (x <= (-1.5d-296)) then
tmp = t * a
else if (x <= 2.4d+69) then
tmp = y * z
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 (x <= -5.2e+14) {
tmp = x;
} else if (x <= -1.5e-296) {
tmp = t * a;
} else if (x <= 2.4e+69) {
tmp = y * z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -5.2e+14: tmp = x elif x <= -1.5e-296: tmp = t * a elif x <= 2.4e+69: tmp = y * z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -5.2e+14) tmp = x; elseif (x <= -1.5e-296) tmp = Float64(t * a); elseif (x <= 2.4e+69) tmp = Float64(y * z); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -5.2e+14) tmp = x; elseif (x <= -1.5e-296) tmp = t * a; elseif (x <= 2.4e+69) tmp = y * z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -5.2e+14], x, If[LessEqual[x, -1.5e-296], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.4e+69], N[(y * z), $MachinePrecision], x]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.2 \cdot 10^{+14}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -1.5 \cdot 10^{-296}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+69}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5.2e14 or 2.4000000000000002e69 < x Initial program 93.0%
associate-+l+93.0%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 50.6%
if -5.2e14 < x < -1.4999999999999999e-296Initial program 85.7%
associate-+l+85.7%
associate-*l*86.8%
Simplified86.8%
Taylor expanded in t around inf 47.5%
if -1.4999999999999999e-296 < x < 2.4000000000000002e69Initial program 91.3%
associate-+l+91.3%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in y around inf 41.1%
*-commutative41.1%
Simplified41.1%
Final simplification46.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.9e+96) (not (<= a 4.2e+47))) (* a (+ t (* z b))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.9e+96) || !(a <= 4.2e+47)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
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 <= (-3.9d+96)) .or. (.not. (a <= 4.2d+47))) then
tmp = a * (t + (z * b))
else
tmp = x + (y * z)
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 <= -3.9e+96) || !(a <= 4.2e+47)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.9e+96) or not (a <= 4.2e+47): tmp = a * (t + (z * b)) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.9e+96) || !(a <= 4.2e+47)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.9e+96) || ~((a <= 4.2e+47))) tmp = a * (t + (z * b)); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.9e+96], N[Not[LessEqual[a, 4.2e+47]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{+96} \lor \neg \left(a \leq 4.2 \cdot 10^{+47}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -3.9e96 or 4.2e47 < a Initial program 80.6%
associate-+l+80.6%
associate-*l*85.4%
Simplified85.4%
Taylor expanded in a around inf 84.3%
if -3.9e96 < a < 4.2e47Initial program 97.6%
associate-+l+97.6%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in a around 0 72.0%
Final simplification77.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -3.9e+97) (not (<= a 8e+47))) (* b (* z a)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -3.9e+97) || !(a <= 8e+47)) {
tmp = b * (z * a);
} else {
tmp = x + (y * z);
}
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 <= (-3.9d+97)) .or. (.not. (a <= 8d+47))) then
tmp = b * (z * a)
else
tmp = x + (y * z)
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 <= -3.9e+97) || !(a <= 8e+47)) {
tmp = b * (z * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -3.9e+97) or not (a <= 8e+47): tmp = b * (z * a) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -3.9e+97) || !(a <= 8e+47)) tmp = Float64(b * Float64(z * a)); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -3.9e+97) || ~((a <= 8e+47))) tmp = b * (z * a); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -3.9e+97], N[Not[LessEqual[a, 8e+47]], $MachinePrecision]], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -3.9 \cdot 10^{+97} \lor \neg \left(a \leq 8 \cdot 10^{+47}\right):\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -3.8999999999999999e97 or 8.0000000000000004e47 < a Initial program 80.6%
associate-+l+80.6%
+-commutative80.6%
fma-define80.6%
associate-*l*85.4%
*-commutative85.4%
*-commutative85.4%
distribute-rgt-out92.2%
remove-double-neg92.2%
*-commutative92.2%
distribute-lft-neg-out92.2%
sub-neg92.2%
sub-neg92.2%
distribute-lft-neg-out92.2%
*-commutative92.2%
remove-double-neg92.2%
*-commutative92.2%
Simplified92.2%
Taylor expanded in t around inf 90.3%
associate-/l*88.4%
Simplified88.4%
Taylor expanded in b around inf 49.9%
*-commutative49.9%
associate-*r*54.3%
Simplified54.3%
if -3.8999999999999999e97 < a < 8.0000000000000004e47Initial program 97.6%
associate-+l+97.6%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in a around 0 72.0%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -0.41) (not (<= y 8.3e-50))) (+ x (* y z)) (+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -0.41) || !(y <= 8.3e-50)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
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 ((y <= (-0.41d0)) .or. (.not. (y <= 8.3d-50))) then
tmp = x + (y * z)
else
tmp = x + (t * a)
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 ((y <= -0.41) || !(y <= 8.3e-50)) {
tmp = x + (y * z);
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -0.41) or not (y <= 8.3e-50): tmp = x + (y * z) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -0.41) || !(y <= 8.3e-50)) tmp = Float64(x + Float64(y * z)); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -0.41) || ~((y <= 8.3e-50))) tmp = x + (y * z); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -0.41], N[Not[LessEqual[y, 8.3e-50]], $MachinePrecision]], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.41 \lor \neg \left(y \leq 8.3 \cdot 10^{-50}\right):\\
\;\;\;\;x + y \cdot z\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if y < -0.409999999999999976 or 8.2999999999999995e-50 < y Initial program 88.0%
associate-+l+88.0%
associate-*l*88.9%
Simplified88.9%
Taylor expanded in a around 0 67.1%
if -0.409999999999999976 < y < 8.2999999999999995e-50Initial program 94.2%
associate-+l+94.2%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in z around 0 64.3%
+-commutative64.3%
Simplified64.3%
Final simplification65.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.95e+154) (not (<= a 6.8e-79))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1.95e+154) || !(a <= 6.8e-79)) {
tmp = t * a;
} 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 ((a <= (-1.95d+154)) .or. (.not. (a <= 6.8d-79))) then
tmp = t * a
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 ((a <= -1.95e+154) || !(a <= 6.8e-79)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.95e+154) or not (a <= 6.8e-79): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1.95e+154) || !(a <= 6.8e-79)) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1.95e+154) || ~((a <= 6.8e-79))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1.95e+154], N[Not[LessEqual[a, 6.8e-79]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.95 \cdot 10^{+154} \lor \neg \left(a \leq 6.8 \cdot 10^{-79}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.9500000000000001e154 or 6.79999999999999951e-79 < a Initial program 82.4%
associate-+l+82.4%
associate-*l*86.6%
Simplified86.6%
Taylor expanded in t around inf 42.8%
if -1.9500000000000001e154 < a < 6.79999999999999951e-79Initial program 98.1%
associate-+l+98.1%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in x around inf 39.8%
Final simplification41.2%
(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 90.8%
associate-+l+90.8%
associate-*l*90.7%
Simplified90.7%
Taylor expanded in x around inf 26.4%
Final simplification26.4%
(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 2024076
(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)))