
(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)) (* (* z a) b)))) (if (<= t_1 INFINITY) t_1 (* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = z * (y + (a * 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)) + ((z * a) * b);
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = z * (y + (a * 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[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \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 96.7%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
Taylor expanded in z around inf 84.2%
Final simplification95.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -3.6e+59)
x
(if (<= x -5.8e-109)
(* t a)
(if (<= x -6.5e-248)
(* z (* a b))
(if (<= x 2.5e-196)
(* y z)
(if (<= x 1.8e-33) (* t a) (if (<= x 1.35e+105) (* a (* z b)) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.6e+59) {
tmp = x;
} else if (x <= -5.8e-109) {
tmp = t * a;
} else if (x <= -6.5e-248) {
tmp = z * (a * b);
} else if (x <= 2.5e-196) {
tmp = y * z;
} else if (x <= 1.8e-33) {
tmp = t * a;
} else if (x <= 1.35e+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 <= (-3.6d+59)) then
tmp = x
else if (x <= (-5.8d-109)) then
tmp = t * a
else if (x <= (-6.5d-248)) then
tmp = z * (a * b)
else if (x <= 2.5d-196) then
tmp = y * z
else if (x <= 1.8d-33) then
tmp = t * a
else if (x <= 1.35d+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 <= -3.6e+59) {
tmp = x;
} else if (x <= -5.8e-109) {
tmp = t * a;
} else if (x <= -6.5e-248) {
tmp = z * (a * b);
} else if (x <= 2.5e-196) {
tmp = y * z;
} else if (x <= 1.8e-33) {
tmp = t * a;
} else if (x <= 1.35e+105) {
tmp = a * (z * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.6e+59: tmp = x elif x <= -5.8e-109: tmp = t * a elif x <= -6.5e-248: tmp = z * (a * b) elif x <= 2.5e-196: tmp = y * z elif x <= 1.8e-33: tmp = t * a elif x <= 1.35e+105: tmp = a * (z * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.6e+59) tmp = x; elseif (x <= -5.8e-109) tmp = Float64(t * a); elseif (x <= -6.5e-248) tmp = Float64(z * Float64(a * b)); elseif (x <= 2.5e-196) tmp = Float64(y * z); elseif (x <= 1.8e-33) tmp = Float64(t * a); elseif (x <= 1.35e+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 <= -3.6e+59) tmp = x; elseif (x <= -5.8e-109) tmp = t * a; elseif (x <= -6.5e-248) tmp = z * (a * b); elseif (x <= 2.5e-196) tmp = y * z; elseif (x <= 1.8e-33) tmp = t * a; elseif (x <= 1.35e+105) tmp = a * (z * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.6e+59], x, If[LessEqual[x, -5.8e-109], N[(t * a), $MachinePrecision], If[LessEqual[x, -6.5e-248], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2.5e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.8e-33], N[(t * a), $MachinePrecision], If[LessEqual[x, 1.35e+105], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.6 \cdot 10^{+59}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -5.8 \cdot 10^{-109}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -6.5 \cdot 10^{-248}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.8 \cdot 10^{-33}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 1.35 \cdot 10^{+105}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.5999999999999999e59 or 1.35000000000000008e105 < x Initial program 89.4%
Taylor expanded in x around inf 66.1%
if -3.5999999999999999e59 < x < -5.8e-109 or 2.5000000000000002e-196 < x < 1.80000000000000017e-33Initial program 92.0%
Taylor expanded in t around inf 49.9%
if -5.8e-109 < x < -6.5e-248Initial program 92.6%
Taylor expanded in z around inf 75.6%
Taylor expanded in y around 0 57.7%
if -6.5e-248 < x < 2.5000000000000002e-196Initial program 87.2%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
if 1.80000000000000017e-33 < x < 1.35000000000000008e105Initial program 85.3%
add-cube-cbrt85.1%
associate-*r*85.0%
pow285.0%
Applied egg-rr85.0%
Taylor expanded in b around inf 44.5%
*-commutative44.5%
Simplified44.5%
Final simplification55.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= x -6.8e+56)
x
(if (<= x -4.3e-109)
(* t a)
(if (<= x -3.5e-244)
t_1
(if (<= x 1.2e-196)
(* y z)
(if (<= x 2e-33) (* t a) (if (<= x 2.6e+103) 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 <= -6.8e+56) {
tmp = x;
} else if (x <= -4.3e-109) {
tmp = t * a;
} else if (x <= -3.5e-244) {
tmp = t_1;
} else if (x <= 1.2e-196) {
tmp = y * z;
} else if (x <= 2e-33) {
tmp = t * a;
} else if (x <= 2.6e+103) {
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 <= (-6.8d+56)) then
tmp = x
else if (x <= (-4.3d-109)) then
tmp = t * a
else if (x <= (-3.5d-244)) then
tmp = t_1
else if (x <= 1.2d-196) then
tmp = y * z
else if (x <= 2d-33) then
tmp = t * a
else if (x <= 2.6d+103) 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 <= -6.8e+56) {
tmp = x;
} else if (x <= -4.3e-109) {
tmp = t * a;
} else if (x <= -3.5e-244) {
tmp = t_1;
} else if (x <= 1.2e-196) {
tmp = y * z;
} else if (x <= 2e-33) {
tmp = t * a;
} else if (x <= 2.6e+103) {
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 <= -6.8e+56: tmp = x elif x <= -4.3e-109: tmp = t * a elif x <= -3.5e-244: tmp = t_1 elif x <= 1.2e-196: tmp = y * z elif x <= 2e-33: tmp = t * a elif x <= 2.6e+103: 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 <= -6.8e+56) tmp = x; elseif (x <= -4.3e-109) tmp = Float64(t * a); elseif (x <= -3.5e-244) tmp = t_1; elseif (x <= 1.2e-196) tmp = Float64(y * z); elseif (x <= 2e-33) tmp = Float64(t * a); elseif (x <= 2.6e+103) 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 <= -6.8e+56) tmp = x; elseif (x <= -4.3e-109) tmp = t * a; elseif (x <= -3.5e-244) tmp = t_1; elseif (x <= 1.2e-196) tmp = y * z; elseif (x <= 2e-33) tmp = t * a; elseif (x <= 2.6e+103) 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, -6.8e+56], x, If[LessEqual[x, -4.3e-109], N[(t * a), $MachinePrecision], If[LessEqual[x, -3.5e-244], t$95$1, If[LessEqual[x, 1.2e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 2e-33], N[(t * a), $MachinePrecision], If[LessEqual[x, 2.6e+103], t$95$1, x]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;x \leq -6.8 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.3 \cdot 10^{-109}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq -3.5 \cdot 10^{-244}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 1.2 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-33}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+103}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -6.80000000000000002e56 or 2.6000000000000002e103 < x Initial program 89.4%
Taylor expanded in x around inf 66.1%
if -6.80000000000000002e56 < x < -4.2999999999999997e-109 or 1.2000000000000001e-196 < x < 2.0000000000000001e-33Initial program 92.0%
Taylor expanded in t around inf 49.9%
if -4.2999999999999997e-109 < x < -3.49999999999999992e-244 or 2.0000000000000001e-33 < x < 2.6000000000000002e103Initial program 88.6%
add-cube-cbrt88.3%
associate-*r*88.4%
pow288.4%
Applied egg-rr88.4%
Taylor expanded in b around inf 47.1%
*-commutative47.1%
Simplified47.1%
if -3.49999999999999992e-244 < x < 1.2000000000000001e-196Initial program 87.2%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
Final simplification54.9%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -4.5e+56)
x
(if (<= x -7.4e-78)
(* t a)
(if (<= x 9.5e-196)
(* y z)
(if (<= x 4.9e-20)
(* t a)
(if (<= x 620000.0) (* y z) (if (<= x 1.5e+108) (* t a) x)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -4.5e+56) {
tmp = x;
} else if (x <= -7.4e-78) {
tmp = t * a;
} else if (x <= 9.5e-196) {
tmp = y * z;
} else if (x <= 4.9e-20) {
tmp = t * a;
} else if (x <= 620000.0) {
tmp = y * z;
} else if (x <= 1.5e+108) {
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 <= (-4.5d+56)) then
tmp = x
else if (x <= (-7.4d-78)) then
tmp = t * a
else if (x <= 9.5d-196) then
tmp = y * z
else if (x <= 4.9d-20) then
tmp = t * a
else if (x <= 620000.0d0) then
tmp = y * z
else if (x <= 1.5d+108) 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 <= -4.5e+56) {
tmp = x;
} else if (x <= -7.4e-78) {
tmp = t * a;
} else if (x <= 9.5e-196) {
tmp = y * z;
} else if (x <= 4.9e-20) {
tmp = t * a;
} else if (x <= 620000.0) {
tmp = y * z;
} else if (x <= 1.5e+108) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -4.5e+56: tmp = x elif x <= -7.4e-78: tmp = t * a elif x <= 9.5e-196: tmp = y * z elif x <= 4.9e-20: tmp = t * a elif x <= 620000.0: tmp = y * z elif x <= 1.5e+108: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -4.5e+56) tmp = x; elseif (x <= -7.4e-78) tmp = Float64(t * a); elseif (x <= 9.5e-196) tmp = Float64(y * z); elseif (x <= 4.9e-20) tmp = Float64(t * a); elseif (x <= 620000.0) tmp = Float64(y * z); elseif (x <= 1.5e+108) 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 <= -4.5e+56) tmp = x; elseif (x <= -7.4e-78) tmp = t * a; elseif (x <= 9.5e-196) tmp = y * z; elseif (x <= 4.9e-20) tmp = t * a; elseif (x <= 620000.0) tmp = y * z; elseif (x <= 1.5e+108) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -4.5e+56], x, If[LessEqual[x, -7.4e-78], N[(t * a), $MachinePrecision], If[LessEqual[x, 9.5e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 4.9e-20], N[(t * a), $MachinePrecision], If[LessEqual[x, 620000.0], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.5e+108], N[(t * a), $MachinePrecision], x]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{+56}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -7.4 \cdot 10^{-78}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 9.5 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 4.9 \cdot 10^{-20}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 620000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.5 \cdot 10^{+108}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -4.5000000000000003e56 or 1.49999999999999992e108 < x Initial program 89.4%
Taylor expanded in x around inf 66.1%
if -4.5000000000000003e56 < x < -7.40000000000000011e-78 or 9.50000000000000032e-196 < x < 4.9000000000000002e-20 or 6.2e5 < x < 1.49999999999999992e108Initial program 90.6%
Taylor expanded in t around inf 46.5%
if -7.40000000000000011e-78 < x < 9.50000000000000032e-196 or 4.9000000000000002e-20 < x < 6.2e5Initial program 88.5%
Taylor expanded in y around inf 43.6%
*-commutative43.6%
Simplified43.6%
Final simplification52.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= x -1.5e+53)
x
(if (<= x -3.2e-246)
(* (* z a) b)
(if (<= x 7.6e-196)
(* y z)
(if (<= x 1.55e-32) (* t a) (if (<= x 4.2e+104) (* a (* z b)) x))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.5e+53) {
tmp = x;
} else if (x <= -3.2e-246) {
tmp = (z * a) * b;
} else if (x <= 7.6e-196) {
tmp = y * z;
} else if (x <= 1.55e-32) {
tmp = t * a;
} else if (x <= 4.2e+104) {
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.5d+53)) then
tmp = x
else if (x <= (-3.2d-246)) then
tmp = (z * a) * b
else if (x <= 7.6d-196) then
tmp = y * z
else if (x <= 1.55d-32) then
tmp = t * a
else if (x <= 4.2d+104) 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.5e+53) {
tmp = x;
} else if (x <= -3.2e-246) {
tmp = (z * a) * b;
} else if (x <= 7.6e-196) {
tmp = y * z;
} else if (x <= 1.55e-32) {
tmp = t * a;
} else if (x <= 4.2e+104) {
tmp = a * (z * b);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.5e+53: tmp = x elif x <= -3.2e-246: tmp = (z * a) * b elif x <= 7.6e-196: tmp = y * z elif x <= 1.55e-32: tmp = t * a elif x <= 4.2e+104: tmp = a * (z * b) else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.5e+53) tmp = x; elseif (x <= -3.2e-246) tmp = Float64(Float64(z * a) * b); elseif (x <= 7.6e-196) tmp = Float64(y * z); elseif (x <= 1.55e-32) tmp = Float64(t * a); elseif (x <= 4.2e+104) 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.5e+53) tmp = x; elseif (x <= -3.2e-246) tmp = (z * a) * b; elseif (x <= 7.6e-196) tmp = y * z; elseif (x <= 1.55e-32) tmp = t * a; elseif (x <= 4.2e+104) tmp = a * (z * b); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.5e+53], x, If[LessEqual[x, -3.2e-246], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[x, 7.6e-196], N[(y * z), $MachinePrecision], If[LessEqual[x, 1.55e-32], N[(t * a), $MachinePrecision], If[LessEqual[x, 4.2e+104], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], x]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.5 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -3.2 \cdot 10^{-246}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;x \leq 7.6 \cdot 10^{-196}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;x \leq 1.55 \cdot 10^{-32}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{+104}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.49999999999999999e53 or 4.1999999999999997e104 < x Initial program 89.6%
Taylor expanded in x around inf 65.8%
if -1.49999999999999999e53 < x < -3.2000000000000001e-246Initial program 92.6%
add-cube-cbrt92.3%
associate-*r*92.4%
pow292.4%
Applied egg-rr92.4%
Taylor expanded in b around inf 37.5%
*-commutative37.5%
Simplified37.5%
associate-*r*46.1%
Applied egg-rr46.1%
if -3.2000000000000001e-246 < x < 7.6000000000000003e-196Initial program 87.2%
Taylor expanded in y around inf 47.5%
*-commutative47.5%
Simplified47.5%
if 7.6000000000000003e-196 < x < 1.55000000000000005e-32Initial program 91.2%
Taylor expanded in t around inf 52.8%
if 1.55000000000000005e-32 < x < 4.1999999999999997e104Initial program 85.3%
add-cube-cbrt85.1%
associate-*r*85.0%
pow285.0%
Applied egg-rr85.0%
Taylor expanded in b around inf 44.5%
*-commutative44.5%
Simplified44.5%
Final simplification54.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -1.5e+64)
t_1
(if (<= a 4.1e+33)
(+ x (* y z))
(if (or (<= a 1.05e+95) (not (<= a 3.1e+160))) t_1 (+ x (* t a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.5e+64) {
tmp = t_1;
} else if (a <= 4.1e+33) {
tmp = x + (y * z);
} else if ((a <= 1.05e+95) || !(a <= 3.1e+160)) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (t + (z * b))
if (a <= (-1.5d+64)) then
tmp = t_1
else if (a <= 4.1d+33) then
tmp = x + (y * z)
else if ((a <= 1.05d+95) .or. (.not. (a <= 3.1d+160))) then
tmp = t_1
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 t_1 = a * (t + (z * b));
double tmp;
if (a <= -1.5e+64) {
tmp = t_1;
} else if (a <= 4.1e+33) {
tmp = x + (y * z);
} else if ((a <= 1.05e+95) || !(a <= 3.1e+160)) {
tmp = t_1;
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -1.5e+64: tmp = t_1 elif a <= 4.1e+33: tmp = x + (y * z) elif (a <= 1.05e+95) or not (a <= 3.1e+160): tmp = t_1 else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -1.5e+64) tmp = t_1; elseif (a <= 4.1e+33) tmp = Float64(x + Float64(y * z)); elseif ((a <= 1.05e+95) || !(a <= 3.1e+160)) tmp = t_1; else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (t + (z * b)); tmp = 0.0; if (a <= -1.5e+64) tmp = t_1; elseif (a <= 4.1e+33) tmp = x + (y * z); elseif ((a <= 1.05e+95) || ~((a <= 3.1e+160))) tmp = t_1; else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -1.5e+64], t$95$1, If[LessEqual[a, 4.1e+33], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 1.05e+95], N[Not[LessEqual[a, 3.1e+160]], $MachinePrecision]], t$95$1, N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -1.5 \cdot 10^{+64}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 4.1 \cdot 10^{+33}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+95} \lor \neg \left(a \leq 3.1 \cdot 10^{+160}\right):\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if a < -1.5000000000000001e64 or 4.09999999999999995e33 < a < 1.05e95 or 3.0999999999999998e160 < a Initial program 79.3%
Taylor expanded in a around inf 84.4%
if -1.5000000000000001e64 < a < 4.09999999999999995e33Initial program 98.4%
Taylor expanded in a around 0 75.8%
if 1.05e95 < a < 3.0999999999999998e160Initial program 84.2%
Taylor expanded in z around 0 79.5%
Final simplification79.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.6e+20) (not (<= b 3.2e+72))) (+ x (+ (* t a) (* a (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.6e+20) || !(b <= 3.2e+72)) {
tmp = x + ((t * a) + (a * (z * b)));
} else {
tmp = x + ((t * a) + (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 ((b <= (-3.6d+20)) .or. (.not. (b <= 3.2d+72))) then
tmp = x + ((t * a) + (a * (z * b)))
else
tmp = x + ((t * a) + (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 ((b <= -3.6e+20) || !(b <= 3.2e+72)) {
tmp = x + ((t * a) + (a * (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.6e+20) or not (b <= 3.2e+72): tmp = x + ((t * a) + (a * (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.6e+20) || !(b <= 3.2e+72)) tmp = Float64(x + Float64(Float64(t * a) + Float64(a * Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.6e+20) || ~((b <= 3.2e+72))) tmp = x + ((t * a) + (a * (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.6e+20], N[Not[LessEqual[b, 3.2e+72]], $MachinePrecision]], N[(x + N[(N[(t * a), $MachinePrecision] + N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.6 \cdot 10^{+20} \lor \neg \left(b \leq 3.2 \cdot 10^{+72}\right):\\
\;\;\;\;x + \left(t \cdot a + a \cdot \left(z \cdot b\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if b < -3.6e20 or 3.2000000000000001e72 < b Initial program 89.2%
Taylor expanded in y around 0 80.0%
if -3.6e20 < b < 3.2000000000000001e72Initial program 89.8%
Taylor expanded in b around 0 92.8%
Final simplification87.7%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.2e+232) (* (* z a) b) (if (<= b 7.5e+82) (+ x (+ (* t a) (* y z))) (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.2e+232) {
tmp = (z * a) * b;
} else if (b <= 7.5e+82) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = 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 <= (-2.2d+232)) then
tmp = (z * a) * b
else if (b <= 7.5d+82) then
tmp = x + ((t * a) + (y * z))
else
tmp = 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 <= -2.2e+232) {
tmp = (z * a) * b;
} else if (b <= 7.5e+82) {
tmp = x + ((t * a) + (y * z));
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -2.2e+232: tmp = (z * a) * b elif b <= 7.5e+82: tmp = x + ((t * a) + (y * z)) else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.2e+232) tmp = Float64(Float64(z * a) * b); elseif (b <= 7.5e+82) tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); else tmp = 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 <= -2.2e+232) tmp = (z * a) * b; elseif (b <= 7.5e+82) tmp = x + ((t * a) + (y * z)); else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.2e+232], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision], If[LessEqual[b, 7.5e+82], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.2 \cdot 10^{+232}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;b \leq 7.5 \cdot 10^{+82}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if b < -2.2e232Initial program 81.1%
add-cube-cbrt80.6%
associate-*r*80.8%
pow280.8%
Applied egg-rr80.8%
Taylor expanded in b around inf 58.5%
*-commutative58.5%
Simplified58.5%
associate-*r*76.1%
Applied egg-rr76.1%
if -2.2e232 < b < 7.4999999999999999e82Initial program 90.4%
Taylor expanded in b around 0 87.3%
if 7.4999999999999999e82 < b Initial program 88.6%
Taylor expanded in a around inf 78.1%
Final simplification85.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7e+66) (not (<= z 1.3e-27))) (* 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 <= -7e+66) || !(z <= 1.3e-27)) {
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 <= (-7d+66)) .or. (.not. (z <= 1.3d-27))) 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 <= -7e+66) || !(z <= 1.3e-27)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7e+66) or not (z <= 1.3e-27): 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 <= -7e+66) || !(z <= 1.3e-27)) 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 <= -7e+66) || ~((z <= 1.3e-27))) 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, -7e+66], N[Not[LessEqual[z, 1.3e-27]], $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 -7 \cdot 10^{+66} \lor \neg \left(z \leq 1.3 \cdot 10^{-27}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -6.9999999999999994e66 or 1.30000000000000009e-27 < z Initial program 79.3%
Taylor expanded in z around inf 77.5%
if -6.9999999999999994e66 < z < 1.30000000000000009e-27Initial program 97.9%
Taylor expanded in z around 0 79.1%
Final simplification78.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -1.75e+68) (* z (* a b)) (if (<= z 1.35e+62) (+ x (* t a)) (+ x (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.75e+68) {
tmp = z * (a * b);
} else if (z <= 1.35e+62) {
tmp = x + (t * 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 (z <= (-1.75d+68)) then
tmp = z * (a * b)
else if (z <= 1.35d+62) then
tmp = x + (t * 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 (z <= -1.75e+68) {
tmp = z * (a * b);
} else if (z <= 1.35e+62) {
tmp = x + (t * a);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.75e+68: tmp = z * (a * b) elif z <= 1.35e+62: tmp = x + (t * a) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.75e+68) tmp = Float64(z * Float64(a * b)); elseif (z <= 1.35e+62) tmp = Float64(x + Float64(t * 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 (z <= -1.75e+68) tmp = z * (a * b); elseif (z <= 1.35e+62) tmp = x + (t * a); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.75e+68], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.35e+62], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+68}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.35 \cdot 10^{+62}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if z < -1.74999999999999989e68Initial program 73.4%
Taylor expanded in z around inf 82.3%
Taylor expanded in y around 0 54.3%
if -1.74999999999999989e68 < z < 1.35e62Initial program 96.9%
Taylor expanded in z around 0 74.9%
if 1.35e62 < z Initial program 80.8%
Taylor expanded in a around 0 65.9%
Final simplification69.5%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.5e+68) (* z (* a b)) (if (<= z 1.1e+132) (+ x (* t a)) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e+68) {
tmp = z * (a * b);
} else if (z <= 1.1e+132) {
tmp = x + (t * a);
} 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 <= (-4.5d+68)) then
tmp = z * (a * b)
else if (z <= 1.1d+132) then
tmp = x + (t * a)
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 <= -4.5e+68) {
tmp = z * (a * b);
} else if (z <= 1.1e+132) {
tmp = x + (t * a);
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.5e+68: tmp = z * (a * b) elif z <= 1.1e+132: tmp = x + (t * a) else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.5e+68) tmp = Float64(z * Float64(a * b)); elseif (z <= 1.1e+132) tmp = Float64(x + Float64(t * a)); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.5e+68) tmp = z * (a * b); elseif (z <= 1.1e+132) tmp = x + (t * a); else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.5e+68], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.1e+132], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(y * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+68}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 1.1 \cdot 10^{+132}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -4.5000000000000003e68Initial program 73.4%
Taylor expanded in z around inf 82.3%
Taylor expanded in y around 0 54.3%
if -4.5000000000000003e68 < z < 1.09999999999999994e132Initial program 97.1%
Taylor expanded in z around 0 72.6%
if 1.09999999999999994e132 < z Initial program 72.7%
Taylor expanded in y around inf 59.8%
*-commutative59.8%
Simplified59.8%
Final simplification67.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= x -5.8e+56) (not (<= x 4.6e+103))) x (* t a)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x <= -5.8e+56) || !(x <= 4.6e+103)) {
tmp = x;
} else {
tmp = 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 ((x <= (-5.8d+56)) .or. (.not. (x <= 4.6d+103))) then
tmp = x
else
tmp = 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 ((x <= -5.8e+56) || !(x <= 4.6e+103)) {
tmp = x;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x <= -5.8e+56) or not (x <= 4.6e+103): tmp = x else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((x <= -5.8e+56) || !(x <= 4.6e+103)) tmp = x; else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x <= -5.8e+56) || ~((x <= 4.6e+103))) tmp = x; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[x, -5.8e+56], N[Not[LessEqual[x, 4.6e+103]], $MachinePrecision]], x, N[(t * a), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5.8 \cdot 10^{+56} \lor \neg \left(x \leq 4.6 \cdot 10^{+103}\right):\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if x < -5.80000000000000014e56 or 4.60000000000000017e103 < x Initial program 89.4%
Taylor expanded in x around inf 66.1%
if -5.80000000000000014e56 < x < 4.60000000000000017e103Initial program 89.6%
Taylor expanded in t around inf 35.4%
Final simplification46.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 89.5%
Taylor expanded in x around inf 30.0%
(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 2024096
(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)))