
(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 15 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 -2.5e-10) (not (<= z 4.9e+58))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ (+ (* a (* z b)) (* t a)) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.5e-10) || !(z <= 4.9e+58)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = ((a * (z * b)) + (t * a)) + (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 ((z <= (-2.5d-10)) .or. (.not. (z <= 4.9d+58))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = ((a * (z * b)) + (t * a)) + (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 ((z <= -2.5e-10) || !(z <= 4.9e+58)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = ((a * (z * b)) + (t * a)) + (x + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.5e-10) or not (z <= 4.9e+58): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.5e-10) || !(z <= 4.9e+58)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(Float64(Float64(a * Float64(z * b)) + Float64(t * a)) + Float64(x + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -2.5e-10) || ~((z <= 4.9e+58))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = ((a * (z * b)) + (t * a)) + (x + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.5e-10], N[Not[LessEqual[z, 4.9e+58]], $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[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-10} \lor \neg \left(z \leq 4.9 \cdot 10^{+58}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(a \cdot \left(z \cdot b\right) + t \cdot a\right) + \left(x + y \cdot z\right)\\
\end{array}
\end{array}
if z < -2.50000000000000016e-10 or 4.90000000000000018e58 < z Initial program 81.7%
associate-+l+81.7%
associate-*l*81.8%
Simplified81.8%
Taylor expanded in z around inf 94.0%
+-commutative94.0%
associate-+l+94.0%
+-commutative94.0%
associate-/l*98.1%
distribute-lft-out99.8%
Simplified99.8%
if -2.50000000000000016e-10 < z < 4.90000000000000018e58Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (* t a) (+ x (* y z))) (* (* z a) b)))) (if (<= t_1 5e+300) t_1 (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b);
double tmp;
if (t_1 <= 5e+300) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / 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) :: t_1
real(8) :: tmp
t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b)
if (t_1 <= 5d+300) then
tmp = t_1
else
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
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 = ((t * a) + (x + (y * z))) + ((z * a) * b);
double tmp;
if (t_1 <= 5e+300) {
tmp = t_1;
} else {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b) tmp = 0 if t_1 <= 5e+300: tmp = t_1 else: tmp = z * (y + ((x / z) + (a * (b + (t / z))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(t * a) + Float64(x + Float64(y * z))) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 5e+300) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((t * a) + (x + (y * z))) + ((z * a) * b); tmp = 0.0; if (t_1 <= 5e+300) tmp = t_1; else tmp = z * (y + ((x / z) + (a * (b + (t / z))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(t * a), $MachinePrecision] + N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+300], t$95$1, N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * N[(b + N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t \cdot a + \left(x + y \cdot z\right)\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 5.00000000000000026e300Initial program 98.5%
if 5.00000000000000026e300 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 62.6%
associate-+l+62.6%
associate-*l*72.0%
Simplified72.0%
Taylor expanded in z around inf 78.0%
+-commutative78.0%
associate-+l+78.0%
+-commutative78.0%
associate-/l*88.0%
distribute-lft-out98.0%
Simplified98.0%
Final simplification98.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.05e-41)
(* y z)
(if (<= z 6.1e-288)
x
(if (<= z 2.9e-114)
(* t a)
(if (<= z 2e+110) x (if (<= z 4.5e+210) (* z (* a b)) (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.05e-41) {
tmp = y * z;
} else if (z <= 6.1e-288) {
tmp = x;
} else if (z <= 2.9e-114) {
tmp = t * a;
} else if (z <= 2e+110) {
tmp = x;
} else if (z <= 4.5e+210) {
tmp = z * (a * b);
} else {
tmp = 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 (z <= (-1.05d-41)) then
tmp = y * z
else if (z <= 6.1d-288) then
tmp = x
else if (z <= 2.9d-114) then
tmp = t * a
else if (z <= 2d+110) then
tmp = x
else if (z <= 4.5d+210) then
tmp = z * (a * b)
else
tmp = 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 (z <= -1.05e-41) {
tmp = y * z;
} else if (z <= 6.1e-288) {
tmp = x;
} else if (z <= 2.9e-114) {
tmp = t * a;
} else if (z <= 2e+110) {
tmp = x;
} else if (z <= 4.5e+210) {
tmp = z * (a * b);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.05e-41: tmp = y * z elif z <= 6.1e-288: tmp = x elif z <= 2.9e-114: tmp = t * a elif z <= 2e+110: tmp = x elif z <= 4.5e+210: tmp = z * (a * b) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.05e-41) tmp = Float64(y * z); elseif (z <= 6.1e-288) tmp = x; elseif (z <= 2.9e-114) tmp = Float64(t * a); elseif (z <= 2e+110) tmp = x; elseif (z <= 4.5e+210) tmp = Float64(z * Float64(a * b)); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.05e-41) tmp = y * z; elseif (z <= 6.1e-288) tmp = x; elseif (z <= 2.9e-114) tmp = t * a; elseif (z <= 2e+110) tmp = x; elseif (z <= 4.5e+210) tmp = z * (a * b); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.05e-41], N[(y * z), $MachinePrecision], If[LessEqual[z, 6.1e-288], x, If[LessEqual[z, 2.9e-114], N[(t * a), $MachinePrecision], If[LessEqual[z, 2e+110], x, If[LessEqual[z, 4.5e+210], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{-41}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{-288}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 2.9 \cdot 10^{-114}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+110}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+210}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -1.05000000000000006e-41 or 4.50000000000000004e210 < z Initial program 82.7%
associate-+l+82.7%
associate-*l*83.9%
Simplified83.9%
Taylor expanded in z around inf 94.7%
+-commutative94.7%
associate-+l+94.7%
+-commutative94.7%
associate-/l*97.8%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
if -1.05000000000000006e-41 < z < 6.09999999999999982e-288 or 2.89999999999999997e-114 < z < 2e110Initial program 100.0%
associate-+l+100.0%
associate-*l*99.1%
Simplified99.1%
Taylor expanded in z around 0 76.7%
Taylor expanded in x around inf 46.7%
if 6.09999999999999982e-288 < z < 2.89999999999999997e-114Initial program 99.9%
associate-+l+99.9%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 90.7%
Taylor expanded in x around 0 64.4%
if 2e110 < z < 4.50000000000000004e210Initial program 78.0%
associate-+l+78.0%
associate-*l*77.9%
Simplified77.9%
Taylor expanded in z around inf 90.8%
+-commutative90.8%
associate-+l+90.8%
+-commutative90.8%
associate-/l*99.8%
distribute-lft-out99.8%
Simplified99.8%
Taylor expanded in b around inf 83.0%
Taylor expanded in a around inf 60.7%
Final simplification50.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -7.4e-30)
x
(if (<= x -3.2e-236)
(* t a)
(if (<= x 1.22e-88)
(* y z)
(if (<= x 1.8e-57) x (if (<= x 5.1e+105) (* t a) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7.4e-30) {
tmp = x;
} else if (x <= -3.2e-236) {
tmp = t * a;
} else if (x <= 1.22e-88) {
tmp = y * z;
} else if (x <= 1.8e-57) {
tmp = x;
} else if (x <= 5.1e+105) {
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 (x <= (-7.4d-30)) then
tmp = x
else if (x <= (-3.2d-236)) then
tmp = t * a
else if (x <= 1.22d-88) then
tmp = y * z
else if (x <= 1.8d-57) then
tmp = x
else if (x <= 5.1d+105) 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 (x <= -7.4e-30) {
tmp = x;
} else if (x <= -3.2e-236) {
tmp = t * a;
} else if (x <= 1.22e-88) {
tmp = y * z;
} else if (x <= 1.8e-57) {
tmp = x;
} else if (x <= 5.1e+105) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7.4e-30: tmp = x elif x <= -3.2e-236: tmp = t * a elif x <= 1.22e-88: tmp = y * z elif x <= 1.8e-57: tmp = x elif x <= 5.1e+105: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7.4e-30) tmp = x; elseif (x <= -3.2e-236) tmp = Float64(t * a); elseif (x <= 1.22e-88) tmp = Float64(y * z); elseif (x <= 1.8e-57) tmp = x; elseif (x <= 5.1e+105) 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 (x <= -7.4e-30) tmp = x; elseif (x <= -3.2e-236) tmp = t * a; elseif (x <= 1.22e-88) tmp = y * z; elseif (x <= 1.8e-57) tmp = x; elseif (x <= 5.1e+105) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7.4e-30], x, If[LessEqual[x, -3.2e-236], N[(t * a), $MachinePrecision], If[LessEqual[x, 1.22e-88], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.8e-57], x, If[LessEqual[x, 5.1e+105], N[(t * a), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.4 \cdot 10^{-30}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-236}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.22 \cdot 10^{-88}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-57}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.1 \cdot 10^{+105}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.4000000000000006e-30 or 1.2200000000000001e-88 < x < 1.8000000000000001e-57 or 5.09999999999999991e105 < x Initial program 92.0%
associate-+l+92.0%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in z around 0 66.5%
Taylor expanded in x around inf 50.8%
if -7.4000000000000006e-30 < x < -3.2e-236 or 1.8000000000000001e-57 < x < 5.09999999999999991e105Initial program 91.4%
associate-+l+91.4%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in z around 0 55.1%
Taylor expanded in x around 0 47.4%
if -3.2e-236 < x < 1.2200000000000001e-88Initial program 90.6%
associate-+l+90.6%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in z around inf 94.4%
+-commutative94.4%
associate-+l+94.4%
+-commutative94.4%
associate-/l*88.8%
distribute-lft-out90.7%
Simplified90.7%
Taylor expanded in y around inf 49.5%
*-commutative49.5%
Simplified49.5%
Final simplification49.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.06e-29)
x
(if (<= x -8.8e-243)
(* t a)
(if (<= x 3.3e-88) (* y z) (if (<= x 1.85e+105) (* a (* z b)) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.06e-29) {
tmp = x;
} else if (x <= -8.8e-243) {
tmp = t * a;
} else if (x <= 3.3e-88) {
tmp = y * z;
} else if (x <= 1.85e+105) {
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) :: tmp
if (x <= (-1.06d-29)) then
tmp = x
else if (x <= (-8.8d-243)) then
tmp = t * a
else if (x <= 3.3d-88) then
tmp = y * z
else if (x <= 1.85d+105) 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 tmp;
if (x <= -1.06e-29) {
tmp = x;
} else if (x <= -8.8e-243) {
tmp = t * a;
} else if (x <= 3.3e-88) {
tmp = y * z;
} else if (x <= 1.85e+105) {
tmp = a * (z * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.06e-29: tmp = x elif x <= -8.8e-243: tmp = t * a elif x <= 3.3e-88: tmp = y * z elif x <= 1.85e+105: tmp = a * (z * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.06e-29) tmp = x; elseif (x <= -8.8e-243) tmp = Float64(t * a); elseif (x <= 3.3e-88) tmp = Float64(y * z); elseif (x <= 1.85e+105) tmp = Float64(a * Float64(z * b)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.06e-29) tmp = x; elseif (x <= -8.8e-243) tmp = t * a; elseif (x <= 3.3e-88) tmp = y * z; elseif (x <= 1.85e+105) tmp = a * (z * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.06e-29], x, If[LessEqual[x, -8.8e-243], N[(t * a), $MachinePrecision], If[LessEqual[x, 3.3e-88], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.85e+105], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.06 \cdot 10^{-29}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -8.8 \cdot 10^{-243}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 3.3 \cdot 10^{-88}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.85 \cdot 10^{+105}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.05999999999999995e-29 or 1.84999999999999992e105 < x Initial program 92.2%
associate-+l+92.2%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in z around 0 67.7%
Taylor expanded in x around inf 50.0%
if -1.05999999999999995e-29 < x < -8.7999999999999996e-243Initial program 95.6%
associate-+l+95.6%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in z around 0 58.7%
Taylor expanded in x around 0 53.8%
if -8.7999999999999996e-243 < x < 3.29999999999999994e-88Initial program 90.7%
associate-+l+90.7%
associate-*l*88.7%
Simplified88.7%
Taylor expanded in z around inf 94.5%
+-commutative94.5%
associate-+l+94.5%
+-commutative94.5%
associate-/l*89.0%
distribute-lft-out90.9%
Simplified90.9%
Taylor expanded in y around inf 48.7%
*-commutative48.7%
Simplified48.7%
if 3.29999999999999994e-88 < x < 1.84999999999999992e105Initial program 86.3%
associate-+l+86.3%
+-commutative86.3%
fma-define86.3%
associate-*l*93.0%
*-commutative93.0%
*-commutative93.0%
distribute-rgt-out97.6%
remove-double-neg97.6%
*-commutative97.6%
distribute-lft-neg-out97.6%
sub-neg97.6%
sub-neg97.6%
distribute-lft-neg-out97.6%
*-commutative97.6%
remove-double-neg97.6%
*-commutative97.6%
Simplified97.6%
Taylor expanded in y around 0 81.2%
Taylor expanded in z around inf 37.6%
*-commutative37.6%
Simplified37.6%
Final simplification48.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.9e-42) (not (<= z 9.2e-11))) (* z (+ y (+ (/ x z) (* a (+ b (/ t z)))))) (+ x (+ (* a (* z b)) (* t a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.9e-42) || !(z <= 9.2e-11)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((a * (z * b)) + (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 <= (-1.9d-42)) .or. (.not. (z <= 9.2d-11))) then
tmp = z * (y + ((x / z) + (a * (b + (t / z)))))
else
tmp = x + ((a * (z * b)) + (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 <= -1.9e-42) || !(z <= 9.2e-11)) {
tmp = z * (y + ((x / z) + (a * (b + (t / z)))));
} else {
tmp = x + ((a * (z * b)) + (t * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.9e-42) or not (z <= 9.2e-11): tmp = z * (y + ((x / z) + (a * (b + (t / z))))) else: tmp = x + ((a * (z * b)) + (t * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.9e-42) || !(z <= 9.2e-11)) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * Float64(b + Float64(t / z)))))); else tmp = Float64(x + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.9e-42) || ~((z <= 9.2e-11))) tmp = z * (y + ((x / z) + (a * (b + (t / z))))); else tmp = x + ((a * (z * b)) + (t * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.9e-42], N[Not[LessEqual[z, 9.2e-11]], $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[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{-42} \lor \neg \left(z \leq 9.2 \cdot 10^{-11}\right):\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot \left(b + \frac{t}{z}\right)\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\end{array}
\end{array}
if z < -1.90000000000000009e-42 or 9.20000000000000054e-11 < z Initial program 84.8%
associate-+l+84.8%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in z around inf 95.0%
+-commutative95.0%
associate-+l+95.0%
+-commutative95.0%
associate-/l*98.4%
distribute-lft-out99.8%
Simplified99.8%
if -1.90000000000000009e-42 < z < 9.20000000000000054e-11Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in y around 0 93.7%
Final simplification97.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= z -5.4e-42)
t_1
(if (<= z 2.7e+126)
(+ x (* t a))
(if (<= z 1.1e+206) (* a (* z b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (z <= -5.4e-42) {
tmp = t_1;
} else if (z <= 2.7e+126) {
tmp = x + (t * a);
} else if (z <= 1.1e+206) {
tmp = 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 + (y * z)
if (z <= (-5.4d-42)) then
tmp = t_1
else if (z <= 2.7d+126) then
tmp = x + (t * a)
else if (z <= 1.1d+206) then
tmp = 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 + (y * z);
double tmp;
if (z <= -5.4e-42) {
tmp = t_1;
} else if (z <= 2.7e+126) {
tmp = x + (t * a);
} else if (z <= 1.1e+206) {
tmp = a * (z * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if z <= -5.4e-42: tmp = t_1 elif z <= 2.7e+126: tmp = x + (t * a) elif z <= 1.1e+206: tmp = a * (z * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (z <= -5.4e-42) tmp = t_1; elseif (z <= 2.7e+126) tmp = Float64(x + Float64(t * a)); elseif (z <= 1.1e+206) tmp = 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 + (y * z); tmp = 0.0; if (z <= -5.4e-42) tmp = t_1; elseif (z <= 2.7e+126) tmp = x + (t * a); elseif (z <= 1.1e+206) tmp = 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[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.4e-42], t$95$1, If[LessEqual[z, 2.7e+126], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+206], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;z \leq -5.4 \cdot 10^{-42}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.7 \cdot 10^{+126}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+206}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.39999999999999998e-42 or 1.10000000000000001e206 < z Initial program 82.0%
associate-+l+82.0%
associate-*l*84.0%
Simplified84.0%
Taylor expanded in b around 0 70.4%
Taylor expanded in a around 0 56.7%
+-commutative56.7%
Simplified56.7%
if -5.39999999999999998e-42 < z < 2.70000000000000002e126Initial program 100.0%
associate-+l+100.0%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in z around 0 79.2%
if 2.70000000000000002e126 < z < 1.10000000000000001e206Initial program 78.0%
associate-+l+78.0%
+-commutative78.0%
fma-define78.0%
associate-*l*78.3%
*-commutative78.3%
*-commutative78.3%
distribute-rgt-out89.4%
remove-double-neg89.4%
*-commutative89.4%
distribute-lft-neg-out89.4%
sub-neg89.4%
sub-neg89.4%
distribute-lft-neg-out89.4%
*-commutative89.4%
remove-double-neg89.4%
*-commutative89.4%
Simplified89.4%
Taylor expanded in y around 0 78.6%
Taylor expanded in z around inf 63.0%
*-commutative63.0%
Simplified63.0%
Final simplification69.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -3.1e+129)
(* y z)
(if (<= z 7e+130)
(+ x (* t a))
(if (<= z 1.12e+210) (* a (* z b)) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.1e+129) {
tmp = y * z;
} else if (z <= 7e+130) {
tmp = x + (t * a);
} else if (z <= 1.12e+210) {
tmp = a * (z * b);
} else {
tmp = 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 (z <= (-3.1d+129)) then
tmp = y * z
else if (z <= 7d+130) then
tmp = x + (t * a)
else if (z <= 1.12d+210) then
tmp = a * (z * b)
else
tmp = 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 (z <= -3.1e+129) {
tmp = y * z;
} else if (z <= 7e+130) {
tmp = x + (t * a);
} else if (z <= 1.12e+210) {
tmp = a * (z * b);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -3.1e+129: tmp = y * z elif z <= 7e+130: tmp = x + (t * a) elif z <= 1.12e+210: tmp = a * (z * b) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.1e+129) tmp = Float64(y * z); elseif (z <= 7e+130) tmp = Float64(x + Float64(t * a)); elseif (z <= 1.12e+210) tmp = Float64(a * Float64(z * b)); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -3.1e+129) tmp = y * z; elseif (z <= 7e+130) tmp = x + (t * a); elseif (z <= 1.12e+210) tmp = a * (z * b); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.1e+129], N[(y * z), $MachinePrecision], If[LessEqual[z, 7e+130], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.12e+210], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+129}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 7 \cdot 10^{+130}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{elif}\;z \leq 1.12 \cdot 10^{+210}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -3.1e129 or 1.12000000000000005e210 < z Initial program 75.9%
associate-+l+75.9%
associate-*l*77.8%
Simplified77.8%
Taylor expanded in z around inf 94.7%
+-commutative94.7%
associate-+l+94.7%
+-commutative94.7%
associate-/l*99.9%
distribute-lft-out99.9%
Simplified99.9%
Taylor expanded in y around inf 59.6%
*-commutative59.6%
Simplified59.6%
if -3.1e129 < z < 7.0000000000000002e130Initial program 98.3%
associate-+l+98.3%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in z around 0 71.6%
if 7.0000000000000002e130 < z < 1.12000000000000005e210Initial program 74.5%
associate-+l+74.5%
+-commutative74.5%
fma-define74.5%
associate-*l*79.4%
*-commutative79.4%
*-commutative79.4%
distribute-rgt-out90.0%
remove-double-neg90.0%
*-commutative90.0%
distribute-lft-neg-out90.0%
sub-neg90.0%
sub-neg90.0%
distribute-lft-neg-out90.0%
*-commutative90.0%
remove-double-neg90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in y around 0 79.7%
Taylor expanded in z around inf 59.9%
*-commutative59.9%
Simplified59.9%
Final simplification68.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.6e-188) (not (<= a 3.5e-97))) (+ x (* 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 <= -2.6e-188) || !(a <= 3.5e-97)) {
tmp = x + (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 <= (-2.6d-188)) .or. (.not. (a <= 3.5d-97))) then
tmp = x + (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 <= -2.6e-188) || !(a <= 3.5e-97)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.6e-188) or not (a <= 3.5e-97): tmp = x + (a * (t + (z * b))) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.6e-188) || !(a <= 3.5e-97)) tmp = Float64(x + 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 <= -2.6e-188) || ~((a <= 3.5e-97))) tmp = x + (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, -2.6e-188], N[Not[LessEqual[a, 3.5e-97]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.6 \cdot 10^{-188} \lor \neg \left(a \leq 3.5 \cdot 10^{-97}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -2.6000000000000001e-188 or 3.50000000000000019e-97 < a Initial program 88.9%
associate-+l+88.9%
+-commutative88.9%
fma-define88.9%
associate-*l*93.4%
*-commutative93.4%
*-commutative93.4%
distribute-rgt-out96.4%
remove-double-neg96.4%
*-commutative96.4%
distribute-lft-neg-out96.4%
sub-neg96.4%
sub-neg96.4%
distribute-lft-neg-out96.4%
*-commutative96.4%
remove-double-neg96.4%
*-commutative96.4%
Simplified96.4%
Taylor expanded in y around 0 84.2%
if -2.6000000000000001e-188 < a < 3.50000000000000019e-97Initial program 100.0%
associate-+l+100.0%
associate-*l*85.8%
Simplified85.8%
Taylor expanded in b around 0 92.4%
Taylor expanded in a around 0 88.2%
+-commutative88.2%
Simplified88.2%
Final simplification85.2%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.4e+179) (* z (+ y (+ (/ x z) (* a b)))) (if (<= b 2.1e+38) (+ x (+ (* t a) (* y z))) (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.4e+179) {
tmp = z * (y + ((x / z) + (a * b)));
} else if (b <= 2.1e+38) {
tmp = x + ((t * a) + (y * 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 (b <= (-1.4d+179)) then
tmp = z * (y + ((x / z) + (a * b)))
else if (b <= 2.1d+38) then
tmp = x + ((t * a) + (y * 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 (b <= -1.4e+179) {
tmp = z * (y + ((x / z) + (a * b)));
} else if (b <= 2.1e+38) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.4e+179: tmp = z * (y + ((x / z) + (a * b))) elif b <= 2.1e+38: tmp = x + ((t * a) + (y * z)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.4e+179) tmp = Float64(z * Float64(y + Float64(Float64(x / z) + Float64(a * b)))); elseif (b <= 2.1e+38) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * 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 (b <= -1.4e+179) tmp = z * (y + ((x / z) + (a * b))); elseif (b <= 2.1e+38) tmp = x + ((t * a) + (y * z)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.4e+179], N[(z * N[(y + N[(N[(x / z), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+38], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.4 \cdot 10^{+179}:\\
\;\;\;\;z \cdot \left(y + \left(\frac{x}{z} + a \cdot b\right)\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+38}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if b < -1.4e179Initial program 90.4%
associate-+l+90.4%
associate-*l*73.3%
Simplified73.3%
Taylor expanded in z around inf 90.8%
+-commutative90.8%
associate-+l+90.8%
+-commutative90.8%
associate-/l*90.6%
distribute-lft-out90.6%
Simplified90.6%
Taylor expanded in b around inf 91.1%
if -1.4e179 < b < 2.1e38Initial program 91.8%
associate-+l+91.8%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in b around 0 91.2%
if 2.1e38 < b Initial program 91.2%
associate-+l+91.2%
+-commutative91.2%
fma-define91.2%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
distribute-rgt-out91.6%
remove-double-neg91.6%
*-commutative91.6%
distribute-lft-neg-out91.6%
sub-neg91.6%
sub-neg91.6%
distribute-lft-neg-out91.6%
*-commutative91.6%
remove-double-neg91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in y around 0 93.3%
Final simplification91.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.95e+182) (* z (+ y (* a b))) (if (<= b 2.1e+38) (+ x (+ (* t a) (* y z))) (+ x (* a (+ t (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.95e+182) {
tmp = z * (y + (a * b));
} else if (b <= 2.1e+38) {
tmp = x + ((t * a) + (y * 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 (b <= (-1.95d+182)) then
tmp = z * (y + (a * b))
else if (b <= 2.1d+38) then
tmp = x + ((t * a) + (y * 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 (b <= -1.95e+182) {
tmp = z * (y + (a * b));
} else if (b <= 2.1e+38) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.95e+182: tmp = z * (y + (a * b)) elif b <= 2.1e+38: tmp = x + ((t * a) + (y * z)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.95e+182) tmp = Float64(z * Float64(y + Float64(a * b))); elseif (b <= 2.1e+38) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * 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 (b <= -1.95e+182) tmp = z * (y + (a * b)); elseif (b <= 2.1e+38) tmp = x + ((t * a) + (y * z)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.95e+182], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 2.1e+38], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.95 \cdot 10^{+182}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{elif}\;b \leq 2.1 \cdot 10^{+38}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if b < -1.9499999999999999e182Initial program 90.4%
associate-+l+90.4%
associate-*l*73.3%
Simplified73.3%
Taylor expanded in z around inf 90.9%
if -1.9499999999999999e182 < b < 2.1e38Initial program 91.8%
associate-+l+91.8%
associate-*l*96.0%
Simplified96.0%
Taylor expanded in b around 0 91.2%
if 2.1e38 < b Initial program 91.2%
associate-+l+91.2%
+-commutative91.2%
fma-define91.2%
associate-*l*84.7%
*-commutative84.7%
*-commutative84.7%
distribute-rgt-out91.6%
remove-double-neg91.6%
*-commutative91.6%
distribute-lft-neg-out91.6%
sub-neg91.6%
sub-neg91.6%
distribute-lft-neg-out91.6%
*-commutative91.6%
remove-double-neg91.6%
*-commutative91.6%
Simplified91.6%
Taylor expanded in y around 0 93.3%
Final simplification91.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.2e-35) (not (<= z 6.6e+22))) (* 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 <= -1.2e-35) || !(z <= 6.6e+22)) {
tmp = 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 <= (-1.2d-35)) .or. (.not. (z <= 6.6d+22))) then
tmp = 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 <= -1.2e-35) || !(z <= 6.6e+22)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.2e-35) or not (z <= 6.6e+22): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.2e-35) || !(z <= 6.6e+22)) tmp = 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 <= -1.2e-35) || ~((z <= 6.6e+22))) tmp = 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, -1.2e-35], N[Not[LessEqual[z, 6.6e+22]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.2 \cdot 10^{-35} \lor \neg \left(z \leq 6.6 \cdot 10^{+22}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -1.2000000000000001e-35 or 6.5999999999999996e22 < z Initial program 83.6%
associate-+l+83.6%
associate-*l*83.7%
Simplified83.7%
Taylor expanded in z around inf 72.5%
if -1.2000000000000001e-35 < z < 6.5999999999999996e22Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in z around 0 83.6%
Final simplification77.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1.1e+48) (not (<= a 1.16e-95))) (* 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 <= -1.1e+48) || !(a <= 1.16e-95)) {
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 <= (-1.1d+48)) .or. (.not. (a <= 1.16d-95))) 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 <= -1.1e+48) || !(a <= 1.16e-95)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1.1e+48) or not (a <= 1.16e-95): 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 <= -1.1e+48) || !(a <= 1.16e-95)) 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 <= -1.1e+48) || ~((a <= 1.16e-95))) 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, -1.1e+48], N[Not[LessEqual[a, 1.16e-95]], $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 -1.1 \cdot 10^{+48} \lor \neg \left(a \leq 1.16 \cdot 10^{-95}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.1e48 or 1.15999999999999997e-95 < a Initial program 84.4%
associate-+l+84.4%
+-commutative84.4%
fma-define84.4%
associate-*l*91.3%
*-commutative91.3%
*-commutative91.3%
distribute-rgt-out95.6%
remove-double-neg95.6%
*-commutative95.6%
distribute-lft-neg-out95.6%
sub-neg95.6%
sub-neg95.6%
distribute-lft-neg-out95.6%
*-commutative95.6%
remove-double-neg95.6%
*-commutative95.6%
Simplified95.6%
Taylor expanded in y around 0 88.8%
Taylor expanded in x around 0 73.4%
if -1.1e48 < a < 1.15999999999999997e-95Initial program 99.9%
associate-+l+99.9%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in b around 0 91.1%
Taylor expanded in a around 0 75.6%
+-commutative75.6%
Simplified75.6%
Final simplification74.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.1e-29) x (if (<= x 7.2e+105) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.1e-29) {
tmp = x;
} else if (x <= 7.2e+105) {
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 (x <= (-1.1d-29)) then
tmp = x
else if (x <= 7.2d+105) 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 (x <= -1.1e-29) {
tmp = x;
} else if (x <= 7.2e+105) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.1e-29: tmp = x elif x <= 7.2e+105: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.1e-29) tmp = x; elseif (x <= 7.2e+105) 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 (x <= -1.1e-29) tmp = x; elseif (x <= 7.2e+105) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.1e-29], x, If[LessEqual[x, 7.2e+105], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.1 \cdot 10^{-29}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 7.2 \cdot 10^{+105}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.09999999999999995e-29 or 7.1999999999999998e105 < x Initial program 92.2%
associate-+l+92.2%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in z around 0 67.4%
Taylor expanded in x around inf 50.4%
if -1.09999999999999995e-29 < x < 7.1999999999999998e105Initial program 91.0%
associate-+l+91.0%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in z around 0 47.0%
Taylor expanded in x around 0 38.9%
Final simplification44.0%
(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 91.5%
associate-+l+91.5%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in z around 0 56.1%
Taylor expanded in x around inf 27.8%
(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 2024182
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))