
(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 97.6%
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*22.2%
Simplified22.2%
Taylor expanded in z around inf 83.4%
Final simplification96.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= t -1e+78)
(* t a)
(if (<= t -3.4e-184)
(* y z)
(if (<= t 1.85e-286)
x
(if (<= t 2.05e-123)
(* y z)
(if (<= t 8e+44) x (if (<= t 1.15e+58) (* y z) (* t a))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -1e+78) {
tmp = t * a;
} else if (t <= -3.4e-184) {
tmp = y * z;
} else if (t <= 1.85e-286) {
tmp = x;
} else if (t <= 2.05e-123) {
tmp = y * z;
} else if (t <= 8e+44) {
tmp = x;
} else if (t <= 1.15e+58) {
tmp = y * z;
} 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 (t <= (-1d+78)) then
tmp = t * a
else if (t <= (-3.4d-184)) then
tmp = y * z
else if (t <= 1.85d-286) then
tmp = x
else if (t <= 2.05d-123) then
tmp = y * z
else if (t <= 8d+44) then
tmp = x
else if (t <= 1.15d+58) then
tmp = y * z
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 (t <= -1e+78) {
tmp = t * a;
} else if (t <= -3.4e-184) {
tmp = y * z;
} else if (t <= 1.85e-286) {
tmp = x;
} else if (t <= 2.05e-123) {
tmp = y * z;
} else if (t <= 8e+44) {
tmp = x;
} else if (t <= 1.15e+58) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -1e+78: tmp = t * a elif t <= -3.4e-184: tmp = y * z elif t <= 1.85e-286: tmp = x elif t <= 2.05e-123: tmp = y * z elif t <= 8e+44: tmp = x elif t <= 1.15e+58: tmp = y * z else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -1e+78) tmp = Float64(t * a); elseif (t <= -3.4e-184) tmp = Float64(y * z); elseif (t <= 1.85e-286) tmp = x; elseif (t <= 2.05e-123) tmp = Float64(y * z); elseif (t <= 8e+44) tmp = x; elseif (t <= 1.15e+58) tmp = Float64(y * z); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -1e+78) tmp = t * a; elseif (t <= -3.4e-184) tmp = y * z; elseif (t <= 1.85e-286) tmp = x; elseif (t <= 2.05e-123) tmp = y * z; elseif (t <= 8e+44) tmp = x; elseif (t <= 1.15e+58) tmp = y * z; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -1e+78], N[(t * a), $MachinePrecision], If[LessEqual[t, -3.4e-184], N[(y * z), $MachinePrecision], If[LessEqual[t, 1.85e-286], x, If[LessEqual[t, 2.05e-123], N[(y * z), $MachinePrecision], If[LessEqual[t, 8e+44], x, If[LessEqual[t, 1.15e+58], N[(y * z), $MachinePrecision], N[(t * a), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1 \cdot 10^{+78}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq -3.4 \cdot 10^{-184}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 1.85 \cdot 10^{-286}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.05 \cdot 10^{-123}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;t \leq 8 \cdot 10^{+44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.15 \cdot 10^{+58}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -1.00000000000000001e78 or 1.15000000000000001e58 < t Initial program 89.5%
associate-+l+89.5%
associate-*l*87.7%
Simplified87.7%
Taylor expanded in t around inf 60.7%
if -1.00000000000000001e78 < t < -3.40000000000000004e-184 or 1.85e-286 < t < 2.05e-123 or 8.0000000000000007e44 < t < 1.15000000000000001e58Initial program 89.7%
associate-+l+89.7%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in y around inf 43.8%
*-commutative43.8%
Simplified43.8%
if -3.40000000000000004e-184 < t < 1.85e-286 or 2.05e-123 < t < 8.0000000000000007e44Initial program 95.7%
associate-+l+95.7%
associate-*l*91.7%
Simplified91.7%
Taylor expanded in x around inf 44.8%
Final simplification50.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (* z a) b)))
(if (<= y -6e+86)
(* y z)
(if (<= y -1.7e-123)
(* t a)
(if (<= y -1.25e-301)
t_1
(if (<= y 1e-230)
(* t a)
(if (<= y 4.2e-112) t_1 (if (<= y 1.8e+24) x (* y z)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * a) * b;
double tmp;
if (y <= -6e+86) {
tmp = y * z;
} else if (y <= -1.7e-123) {
tmp = t * a;
} else if (y <= -1.25e-301) {
tmp = t_1;
} else if (y <= 1e-230) {
tmp = t * a;
} else if (y <= 4.2e-112) {
tmp = t_1;
} else if (y <= 1.8e+24) {
tmp = x;
} 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) :: t_1
real(8) :: tmp
t_1 = (z * a) * b
if (y <= (-6d+86)) then
tmp = y * z
else if (y <= (-1.7d-123)) then
tmp = t * a
else if (y <= (-1.25d-301)) then
tmp = t_1
else if (y <= 1d-230) then
tmp = t * a
else if (y <= 4.2d-112) then
tmp = t_1
else if (y <= 1.8d+24) then
tmp = x
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 t_1 = (z * a) * b;
double tmp;
if (y <= -6e+86) {
tmp = y * z;
} else if (y <= -1.7e-123) {
tmp = t * a;
} else if (y <= -1.25e-301) {
tmp = t_1;
} else if (y <= 1e-230) {
tmp = t * a;
} else if (y <= 4.2e-112) {
tmp = t_1;
} else if (y <= 1.8e+24) {
tmp = x;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * a) * b tmp = 0 if y <= -6e+86: tmp = y * z elif y <= -1.7e-123: tmp = t * a elif y <= -1.25e-301: tmp = t_1 elif y <= 1e-230: tmp = t * a elif y <= 4.2e-112: tmp = t_1 elif y <= 1.8e+24: tmp = x else: tmp = y * z return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * a) * b) tmp = 0.0 if (y <= -6e+86) tmp = Float64(y * z); elseif (y <= -1.7e-123) tmp = Float64(t * a); elseif (y <= -1.25e-301) tmp = t_1; elseif (y <= 1e-230) tmp = Float64(t * a); elseif (y <= 4.2e-112) tmp = t_1; elseif (y <= 1.8e+24) tmp = x; else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * a) * b; tmp = 0.0; if (y <= -6e+86) tmp = y * z; elseif (y <= -1.7e-123) tmp = t * a; elseif (y <= -1.25e-301) tmp = t_1; elseif (y <= 1e-230) tmp = t * a; elseif (y <= 4.2e-112) tmp = t_1; elseif (y <= 1.8e+24) tmp = x; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[y, -6e+86], N[(y * z), $MachinePrecision], If[LessEqual[y, -1.7e-123], N[(t * a), $MachinePrecision], If[LessEqual[y, -1.25e-301], t$95$1, If[LessEqual[y, 1e-230], N[(t * a), $MachinePrecision], If[LessEqual[y, 4.2e-112], t$95$1, If[LessEqual[y, 1.8e+24], x, N[(y * z), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;y \leq -6 \cdot 10^{+86}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq -1.7 \cdot 10^{-123}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq -1.25 \cdot 10^{-301}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 10^{-230}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-112}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{+24}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -5.99999999999999954e86 or 1.79999999999999992e24 < y Initial program 84.1%
associate-+l+84.1%
associate-*l*84.2%
Simplified84.2%
Taylor expanded in y around inf 57.7%
*-commutative57.7%
Simplified57.7%
if -5.99999999999999954e86 < y < -1.7e-123 or -1.25000000000000003e-301 < y < 1.00000000000000005e-230Initial program 96.5%
associate-+l+96.5%
associate-*l*90.4%
Simplified90.4%
Taylor expanded in t around inf 55.4%
if -1.7e-123 < y < -1.25000000000000003e-301 or 1.00000000000000005e-230 < y < 4.2000000000000001e-112Initial program 96.6%
associate-+l+96.6%
associate-*l*96.5%
Simplified96.5%
Taylor expanded in z around inf 53.5%
Taylor expanded in y around 0 48.4%
associate-*r*46.6%
*-commutative46.6%
associate-*r*51.7%
Simplified51.7%
if 4.2000000000000001e-112 < y < 1.79999999999999992e24Initial program 91.9%
associate-+l+91.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 37.7%
Final simplification53.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (* a b))))
(if (<= b -6.6e+28)
t_1
(if (<= b -13500.0)
x
(if (<= b -7.4e-289)
(* t a)
(if (<= b 4.7e-126) (* y z) (if (<= b 1.8e+170) (* t a) t_1)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (b <= -6.6e+28) {
tmp = t_1;
} else if (b <= -13500.0) {
tmp = x;
} else if (b <= -7.4e-289) {
tmp = t * a;
} else if (b <= 4.7e-126) {
tmp = y * z;
} else if (b <= 1.8e+170) {
tmp = t * a;
} 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 * (a * b)
if (b <= (-6.6d+28)) then
tmp = t_1
else if (b <= (-13500.0d0)) then
tmp = x
else if (b <= (-7.4d-289)) then
tmp = t * a
else if (b <= 4.7d-126) then
tmp = y * z
else if (b <= 1.8d+170) then
tmp = t * a
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (a * b);
double tmp;
if (b <= -6.6e+28) {
tmp = t_1;
} else if (b <= -13500.0) {
tmp = x;
} else if (b <= -7.4e-289) {
tmp = t * a;
} else if (b <= 4.7e-126) {
tmp = y * z;
} else if (b <= 1.8e+170) {
tmp = t * a;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (a * b) tmp = 0 if b <= -6.6e+28: tmp = t_1 elif b <= -13500.0: tmp = x elif b <= -7.4e-289: tmp = t * a elif b <= 4.7e-126: tmp = y * z elif b <= 1.8e+170: tmp = t * a else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(a * b)) tmp = 0.0 if (b <= -6.6e+28) tmp = t_1; elseif (b <= -13500.0) tmp = x; elseif (b <= -7.4e-289) tmp = Float64(t * a); elseif (b <= 4.7e-126) tmp = Float64(y * z); elseif (b <= 1.8e+170) tmp = Float64(t * a); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (a * b); tmp = 0.0; if (b <= -6.6e+28) tmp = t_1; elseif (b <= -13500.0) tmp = x; elseif (b <= -7.4e-289) tmp = t * a; elseif (b <= 4.7e-126) tmp = y * z; elseif (b <= 1.8e+170) tmp = t * a; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -6.6e+28], t$95$1, If[LessEqual[b, -13500.0], x, If[LessEqual[b, -7.4e-289], N[(t * a), $MachinePrecision], If[LessEqual[b, 4.7e-126], N[(y * z), $MachinePrecision], If[LessEqual[b, 1.8e+170], N[(t * a), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(a \cdot b\right)\\
\mathbf{if}\;b \leq -6.6 \cdot 10^{+28}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq -13500:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq -7.4 \cdot 10^{-289}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;b \leq 4.7 \cdot 10^{-126}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;b \leq 1.8 \cdot 10^{+170}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -6.6e28 or 1.8e170 < b Initial program 89.6%
associate-+l+89.6%
associate-*l*81.9%
Simplified81.9%
Taylor expanded in z around inf 73.7%
Taylor expanded in y around 0 56.2%
if -6.6e28 < b < -13500Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in x around inf 75.8%
if -13500 < b < -7.39999999999999977e-289 or 4.70000000000000017e-126 < b < 1.8e170Initial program 92.4%
associate-+l+92.4%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in t around inf 40.3%
if -7.39999999999999977e-289 < b < 4.70000000000000017e-126Initial program 86.4%
associate-+l+86.4%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in y around inf 59.3%
*-commutative59.3%
Simplified59.3%
Final simplification50.1%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= a -1e+52)
(and (not (<= a -11500.0)) (or (<= a -5e-103) (not (<= a 4e-48)))))
(* 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 <= -1e+52) || (!(a <= -11500.0) && ((a <= -5e-103) || !(a <= 4e-48)))) {
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 <= (-1d+52)) .or. (.not. (a <= (-11500.0d0))) .and. (a <= (-5d-103)) .or. (.not. (a <= 4d-48))) 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 <= -1e+52) || (!(a <= -11500.0) && ((a <= -5e-103) || !(a <= 4e-48)))) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1e+52) or (not (a <= -11500.0) and ((a <= -5e-103) or not (a <= 4e-48))): 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 <= -1e+52) || (!(a <= -11500.0) && ((a <= -5e-103) || !(a <= 4e-48)))) 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 <= -1e+52) || (~((a <= -11500.0)) && ((a <= -5e-103) || ~((a <= 4e-48))))) 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, -1e+52], And[N[Not[LessEqual[a, -11500.0]], $MachinePrecision], Or[LessEqual[a, -5e-103], N[Not[LessEqual[a, 4e-48]], $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 \cdot 10^{+52} \lor \neg \left(a \leq -11500\right) \land \left(a \leq -5 \cdot 10^{-103} \lor \neg \left(a \leq 4 \cdot 10^{-48}\right)\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -9.9999999999999999e51 or -11500 < a < -4.99999999999999966e-103 or 3.9999999999999999e-48 < a Initial program 83.5%
associate-+l+83.5%
associate-*l*89.0%
Simplified89.0%
Taylor expanded in a around inf 77.5%
if -9.9999999999999999e51 < a < -11500 or -4.99999999999999966e-103 < a < 3.9999999999999999e-48Initial program 100.0%
associate-+l+100.0%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in a around 0 80.8%
Final simplification79.0%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -2.7e+35)
(not (or (<= z -4.5e-55) (and (not (<= z -6.5e-99)) (<= z 2.3e+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 <= -2.7e+35) || !((z <= -4.5e-55) || (!(z <= -6.5e-99) && (z <= 2.3e+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 <= (-2.7d+35)) .or. (.not. (z <= (-4.5d-55)) .or. (.not. (z <= (-6.5d-99))) .and. (z <= 2.3d+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 <= -2.7e+35) || !((z <= -4.5e-55) || (!(z <= -6.5e-99) && (z <= 2.3e+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 <= -2.7e+35) or not ((z <= -4.5e-55) or (not (z <= -6.5e-99) and (z <= 2.3e+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 <= -2.7e+35) || !((z <= -4.5e-55) || (!(z <= -6.5e-99) && (z <= 2.3e+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 <= -2.7e+35) || ~(((z <= -4.5e-55) || (~((z <= -6.5e-99)) && (z <= 2.3e+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, -2.7e+35], N[Not[Or[LessEqual[z, -4.5e-55], And[N[Not[LessEqual[z, -6.5e-99]], $MachinePrecision], LessEqual[z, 2.3e+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 -2.7 \cdot 10^{+35} \lor \neg \left(z \leq -4.5 \cdot 10^{-55} \lor \neg \left(z \leq -6.5 \cdot 10^{-99}\right) \land z \leq 2.3 \cdot 10^{+22}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -2.70000000000000003e35 or -4.4999999999999997e-55 < z < -6.50000000000000033e-99 or 2.3000000000000002e22 < z Initial program 82.9%
associate-+l+82.9%
associate-*l*82.5%
Simplified82.5%
Taylor expanded in z around inf 84.0%
if -2.70000000000000003e35 < z < -4.4999999999999997e-55 or -6.50000000000000033e-99 < z < 2.3000000000000002e22Initial program 99.2%
associate-+l+99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in z around 0 81.0%
+-commutative81.0%
Simplified81.0%
Final simplification82.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -5.5e+102)
(* z (* a b))
(if (<= a 1.05e+65)
(+ x (* y z))
(if (or (<= a 2.65e+107) (not (<= a 1.7e+253))) (* t a) (* (* z a) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -5.5e+102) {
tmp = z * (a * b);
} else if (a <= 1.05e+65) {
tmp = x + (y * z);
} else if ((a <= 2.65e+107) || !(a <= 1.7e+253)) {
tmp = t * a;
} else {
tmp = (z * a) * 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 (a <= (-5.5d+102)) then
tmp = z * (a * b)
else if (a <= 1.05d+65) then
tmp = x + (y * z)
else if ((a <= 2.65d+107) .or. (.not. (a <= 1.7d+253))) then
tmp = t * a
else
tmp = (z * a) * 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 (a <= -5.5e+102) {
tmp = z * (a * b);
} else if (a <= 1.05e+65) {
tmp = x + (y * z);
} else if ((a <= 2.65e+107) || !(a <= 1.7e+253)) {
tmp = t * a;
} else {
tmp = (z * a) * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -5.5e+102: tmp = z * (a * b) elif a <= 1.05e+65: tmp = x + (y * z) elif (a <= 2.65e+107) or not (a <= 1.7e+253): tmp = t * a else: tmp = (z * a) * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -5.5e+102) tmp = Float64(z * Float64(a * b)); elseif (a <= 1.05e+65) tmp = Float64(x + Float64(y * z)); elseif ((a <= 2.65e+107) || !(a <= 1.7e+253)) tmp = Float64(t * a); else tmp = Float64(Float64(z * a) * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -5.5e+102) tmp = z * (a * b); elseif (a <= 1.05e+65) tmp = x + (y * z); elseif ((a <= 2.65e+107) || ~((a <= 1.7e+253))) tmp = t * a; else tmp = (z * a) * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -5.5e+102], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.05e+65], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[Or[LessEqual[a, 2.65e+107], N[Not[LessEqual[a, 1.7e+253]], $MachinePrecision]], N[(t * a), $MachinePrecision], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -5.5 \cdot 10^{+102}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq 1.05 \cdot 10^{+65}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 2.65 \cdot 10^{+107} \lor \neg \left(a \leq 1.7 \cdot 10^{+253}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\end{array}
\end{array}
if a < -5.49999999999999981e102Initial program 79.5%
associate-+l+79.5%
associate-*l*84.6%
Simplified84.6%
Taylor expanded in z around inf 65.4%
Taylor expanded in y around 0 57.7%
if -5.49999999999999981e102 < a < 1.04999999999999996e65Initial program 98.1%
associate-+l+98.1%
associate-*l*92.3%
Simplified92.3%
Taylor expanded in a around 0 67.7%
if 1.04999999999999996e65 < a < 2.65e107 or 1.70000000000000009e253 < a Initial program 87.5%
associate-+l+87.5%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in t around inf 66.3%
if 2.65e107 < a < 1.70000000000000009e253Initial program 73.3%
associate-+l+73.3%
associate-*l*87.5%
Simplified87.5%
Taylor expanded in z around inf 59.1%
Taylor expanded in y around 0 56.5%
associate-*r*49.3%
*-commutative49.3%
associate-*r*56.7%
Simplified56.7%
Final simplification64.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (+ x (* y z))))
(if (<= y -7.5e+90)
t_2
(if (<= y -1.4e-159)
t_1
(if (<= y -3.6e-200) (* z (* a b)) (if (<= y 2.55e-11) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = x + (y * z);
double tmp;
if (y <= -7.5e+90) {
tmp = t_2;
} else if (y <= -1.4e-159) {
tmp = t_1;
} else if (y <= -3.6e-200) {
tmp = z * (a * b);
} else if (y <= 2.55e-11) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = x + (y * z)
if (y <= (-7.5d+90)) then
tmp = t_2
else if (y <= (-1.4d-159)) then
tmp = t_1
else if (y <= (-3.6d-200)) then
tmp = z * (a * b)
else if (y <= 2.55d-11) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = x + (y * z);
double tmp;
if (y <= -7.5e+90) {
tmp = t_2;
} else if (y <= -1.4e-159) {
tmp = t_1;
} else if (y <= -3.6e-200) {
tmp = z * (a * b);
} else if (y <= 2.55e-11) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = x + (y * z) tmp = 0 if y <= -7.5e+90: tmp = t_2 elif y <= -1.4e-159: tmp = t_1 elif y <= -3.6e-200: tmp = z * (a * b) elif y <= 2.55e-11: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(x + Float64(y * z)) tmp = 0.0 if (y <= -7.5e+90) tmp = t_2; elseif (y <= -1.4e-159) tmp = t_1; elseif (y <= -3.6e-200) tmp = Float64(z * Float64(a * b)); elseif (y <= 2.55e-11) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = x + (y * z); tmp = 0.0; if (y <= -7.5e+90) tmp = t_2; elseif (y <= -1.4e-159) tmp = t_1; elseif (y <= -3.6e-200) tmp = z * (a * b); elseif (y <= 2.55e-11) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7.5e+90], t$95$2, If[LessEqual[y, -1.4e-159], t$95$1, If[LessEqual[y, -3.6e-200], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.55e-11], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := x + y \cdot z\\
\mathbf{if}\;y \leq -7.5 \cdot 10^{+90}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -1.4 \cdot 10^{-159}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -3.6 \cdot 10^{-200}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;y \leq 2.55 \cdot 10^{-11}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -7.50000000000000014e90 or 2.54999999999999992e-11 < y Initial program 84.6%
associate-+l+84.6%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in a around 0 70.9%
if -7.50000000000000014e90 < y < -1.4000000000000001e-159 or -3.6000000000000002e-200 < y < 2.54999999999999992e-11Initial program 95.6%
associate-+l+95.6%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in z around 0 65.6%
+-commutative65.6%
Simplified65.6%
if -1.4000000000000001e-159 < y < -3.6000000000000002e-200Initial program 90.8%
associate-+l+90.8%
associate-*l*90.2%
Simplified90.2%
Taylor expanded in z around inf 80.3%
Taylor expanded in y around 0 80.3%
Final simplification68.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (+ y (* a b)))))
(if (<= z -1.9e+161)
t_1
(if (<= z 5.2e+95)
(+ (+ x (* y z)) (+ (* a (* z b)) (* t a)))
(+ x t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (y + (a * b));
double tmp;
if (z <= -1.9e+161) {
tmp = t_1;
} else if (z <= 5.2e+95) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = x + 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 * (y + (a * b))
if (z <= (-1.9d+161)) then
tmp = t_1
else if (z <= 5.2d+95) then
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a))
else
tmp = x + 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 * (y + (a * b));
double tmp;
if (z <= -1.9e+161) {
tmp = t_1;
} else if (z <= 5.2e+95) {
tmp = (x + (y * z)) + ((a * (z * b)) + (t * a));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (y + (a * b)) tmp = 0 if z <= -1.9e+161: tmp = t_1 elif z <= 5.2e+95: tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -1.9e+161) tmp = t_1; elseif (z <= 5.2e+95) tmp = Float64(Float64(x + Float64(y * z)) + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (y + (a * b)); tmp = 0.0; if (z <= -1.9e+161) tmp = t_1; elseif (z <= 5.2e+95) tmp = (x + (y * z)) + ((a * (z * b)) + (t * a)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+161], t$95$1, If[LessEqual[z, 5.2e+95], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+161}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{+95}:\\
\;\;\;\;\left(x + y \cdot z\right) + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if z < -1.9000000000000001e161Initial program 68.6%
associate-+l+68.6%
associate-*l*63.5%
Simplified63.5%
Taylor expanded in z around inf 91.5%
if -1.9000000000000001e161 < z < 5.19999999999999981e95Initial program 97.2%
associate-+l+97.2%
associate-*l*98.3%
Simplified98.3%
if 5.19999999999999981e95 < z Initial program 81.4%
associate-+l+81.4%
associate-*l*79.7%
Simplified79.7%
Taylor expanded in t around 0 71.3%
+-commutative71.3%
+-commutative71.3%
associate-*r*82.0%
distribute-rgt-in91.5%
Simplified91.5%
Final simplification96.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.4e+100) (not (<= z 1.35e+25))) (* z (+ y (* a b))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.4e+100) || !(z <= 1.35e+25)) {
tmp = z * (y + (a * 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 ((z <= (-1.4d+100)) .or. (.not. (z <= 1.35d+25))) then
tmp = z * (y + (a * 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 ((z <= -1.4e+100) || !(z <= 1.35e+25)) {
tmp = z * (y + (a * b));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.4e+100) or not (z <= 1.35e+25): tmp = z * (y + (a * b)) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.4e+100) || !(z <= 1.35e+25)) tmp = Float64(z * Float64(y + Float64(a * 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 ((z <= -1.4e+100) || ~((z <= 1.35e+25))) tmp = z * (y + (a * b)); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.4e+100], N[Not[LessEqual[z, 1.35e+25]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.4 \cdot 10^{+100} \lor \neg \left(z \leq 1.35 \cdot 10^{+25}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if z < -1.3999999999999999e100 or 1.35e25 < z Initial program 80.1%
associate-+l+80.1%
associate-*l*80.4%
Simplified80.4%
Taylor expanded in z around inf 85.6%
if -1.3999999999999999e100 < z < 1.35e25Initial program 99.3%
associate-+l+99.3%
associate-*l*98.6%
Simplified98.6%
Taylor expanded in b around 0 90.3%
Final simplification88.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.1e+35) (not (<= z 9.2e+21))) (+ x (* z (+ y (* a b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.1e+35) || !(z <= 9.2e+21)) {
tmp = x + (z * (y + (a * 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 ((z <= (-3.1d+35)) .or. (.not. (z <= 9.2d+21))) then
tmp = x + (z * (y + (a * 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 ((z <= -3.1e+35) || !(z <= 9.2e+21)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.1e+35) or not (z <= 9.2e+21): tmp = x + (z * (y + (a * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.1e+35) || !(z <= 9.2e+21)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * 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 ((z <= -3.1e+35) || ~((z <= 9.2e+21))) tmp = x + (z * (y + (a * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.1e+35], N[Not[LessEqual[z, 9.2e+21]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * 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}\;z \leq -3.1 \cdot 10^{+35} \lor \neg \left(z \leq 9.2 \cdot 10^{+21}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if z < -3.09999999999999987e35 or 9.2e21 < z Initial program 82.3%
associate-+l+82.3%
associate-*l*81.8%
Simplified81.8%
Taylor expanded in t around 0 73.8%
+-commutative73.8%
+-commutative73.8%
associate-*r*81.7%
distribute-rgt-in89.5%
Simplified89.5%
if -3.09999999999999987e35 < z < 9.2e21Initial program 99.2%
associate-+l+99.2%
associate-*l*99.2%
Simplified99.2%
Taylor expanded in b around 0 93.0%
Final simplification91.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -7.5e+104) (not (<= a 2.6e-129))) (* t a) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -7.5e+104) || !(a <= 2.6e-129)) {
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 <= (-7.5d+104)) .or. (.not. (a <= 2.6d-129))) 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 <= -7.5e+104) || !(a <= 2.6e-129)) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -7.5e+104) or not (a <= 2.6e-129): tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -7.5e+104) || !(a <= 2.6e-129)) 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 <= -7.5e+104) || ~((a <= 2.6e-129))) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -7.5e+104], N[Not[LessEqual[a, 2.6e-129]], $MachinePrecision]], N[(t * a), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -7.5 \cdot 10^{+104} \lor \neg \left(a \leq 2.6 \cdot 10^{-129}\right):\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -7.5000000000000002e104 or 2.6000000000000001e-129 < a Initial program 82.6%
associate-+l+82.6%
associate-*l*89.7%
Simplified89.7%
Taylor expanded in t around inf 43.6%
if -7.5000000000000002e104 < a < 2.6000000000000001e-129Initial program 100.0%
associate-+l+100.0%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in x around inf 38.5%
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.7%
associate-+l+90.7%
associate-*l*90.5%
Simplified90.5%
Taylor expanded in x around inf 22.9%
Final simplification22.9%
(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 2024039
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:herbie-target
(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)))