
(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 (<= z -3.3e+128) (+ (* z (+ y (* a b))) x) (fma a (+ t (* z b)) (fma y z x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -3.3e+128) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = fma(a, (t + (z * b)), fma(y, z, x));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -3.3e+128) tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); else tmp = fma(a, Float64(t + Float64(z * b)), fma(y, z, x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -3.3e+128], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(y * z + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.3 \cdot 10^{+128}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t + z \cdot b, \mathsf{fma}\left(y, z, x\right)\right)\\
\end{array}
\end{array}
if z < -3.3000000000000001e128Initial program 90.9%
*-commutative90.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in t around 0 79.8%
+-commutative79.8%
associate-*r*93.9%
distribute-rgt-in100.0%
+-commutative100.0%
Simplified100.0%
if -3.3000000000000001e128 < z Initial program 93.8%
associate-+l+93.8%
+-commutative93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*96.4%
distribute-rgt-out97.7%
fma-def98.2%
*-commutative98.2%
+-commutative98.2%
fma-def98.2%
Simplified98.2%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.6e+128) (+ (* z (+ y (* a b))) x) (+ (+ x (* a (fma z b t))) (* z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.6e+128) {
tmp = (z * (y + (a * b))) + x;
} else {
tmp = (x + (a * fma(z, b, t))) + (z * y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.6e+128) tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); else tmp = Float64(Float64(x + Float64(a * fma(z, b, t))) + Float64(z * y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.6e+128], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(N[(x + N[(a * N[(z * b + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(z * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.6 \cdot 10^{+128}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\mathbf{else}:\\
\;\;\;\;\left(x + a \cdot \mathsf{fma}\left(z, b, t\right)\right) + z \cdot y\\
\end{array}
\end{array}
if z < -4.59999999999999996e128Initial program 90.9%
*-commutative90.9%
associate-*l*93.9%
Simplified93.9%
Taylor expanded in t around 0 79.8%
+-commutative79.8%
associate-*r*93.9%
distribute-rgt-in100.0%
+-commutative100.0%
Simplified100.0%
if -4.59999999999999996e128 < z Initial program 93.8%
associate-+l+93.8%
+-commutative93.8%
*-commutative93.8%
*-commutative93.8%
associate-*l*96.4%
distribute-rgt-out97.7%
fma-def98.2%
*-commutative98.2%
+-commutative98.2%
fma-def98.2%
Simplified98.2%
fma-udef97.7%
distribute-rgt-in96.4%
associate-*r*93.0%
*-commutative93.0%
fma-udef93.0%
+-commutative93.0%
associate-+r+93.0%
*-commutative93.0%
associate-*r*96.4%
distribute-rgt-in97.7%
+-commutative97.7%
fma-def97.7%
*-commutative97.7%
Applied egg-rr97.7%
Final simplification98.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* z y)) (* a t)) (* b (* z a))))) (if (<= t_1 INFINITY) t_1 (+ (* z (+ y (* a b))) x))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = (z * (y + (a * b))) + x;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a));
double tmp;
if (t_1 <= Double.POSITIVE_INFINITY) {
tmp = t_1;
} else {
tmp = (z * (y + (a * b))) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)) tmp = 0 if t_1 <= math.inf: tmp = t_1 else: tmp = (z * (y + (a * b))) + x return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(b * Float64(z * a))) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((x + (z * y)) + (a * t)) + (b * (z * a)); tmp = 0.0; if (t_1 <= Inf) tmp = t_1; else tmp = (z * (y + (a * b))) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot y\right) + a \cdot t\right) + b \cdot \left(z \cdot a\right)\\
\mathbf{if}\;t_1 \leq \infty:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 97.7%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
*-commutative0.0%
associate-*l*27.3%
Simplified27.3%
Taylor expanded in t around 0 45.5%
+-commutative45.5%
associate-*r*45.5%
distribute-rgt-in81.8%
+-commutative81.8%
Simplified81.8%
Final simplification97.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= z -2.25e+117)
(* z y)
(if (<= z -1.6e+31)
t_1
(if (<= z -7.1e-155)
(* a t)
(if (<= z -2.1e-277)
x
(if (<= z 4.9e-287)
(* a t)
(if (<= z 3.5e-70) x (if (<= z 3.5e+119) t_1 (* z y))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -2.25e+117) {
tmp = z * y;
} else if (z <= -1.6e+31) {
tmp = t_1;
} else if (z <= -7.1e-155) {
tmp = a * t;
} else if (z <= -2.1e-277) {
tmp = x;
} else if (z <= 4.9e-287) {
tmp = a * t;
} else if (z <= 3.5e-70) {
tmp = x;
} else if (z <= 3.5e+119) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (z <= (-2.25d+117)) then
tmp = z * y
else if (z <= (-1.6d+31)) then
tmp = t_1
else if (z <= (-7.1d-155)) then
tmp = a * t
else if (z <= (-2.1d-277)) then
tmp = x
else if (z <= 4.9d-287) then
tmp = a * t
else if (z <= 3.5d-70) then
tmp = x
else if (z <= 3.5d+119) then
tmp = t_1
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (z <= -2.25e+117) {
tmp = z * y;
} else if (z <= -1.6e+31) {
tmp = t_1;
} else if (z <= -7.1e-155) {
tmp = a * t;
} else if (z <= -2.1e-277) {
tmp = x;
} else if (z <= 4.9e-287) {
tmp = a * t;
} else if (z <= 3.5e-70) {
tmp = x;
} else if (z <= 3.5e+119) {
tmp = t_1;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if z <= -2.25e+117: tmp = z * y elif z <= -1.6e+31: tmp = t_1 elif z <= -7.1e-155: tmp = a * t elif z <= -2.1e-277: tmp = x elif z <= 4.9e-287: tmp = a * t elif z <= 3.5e-70: tmp = x elif z <= 3.5e+119: tmp = t_1 else: tmp = z * y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (z <= -2.25e+117) tmp = Float64(z * y); elseif (z <= -1.6e+31) tmp = t_1; elseif (z <= -7.1e-155) tmp = Float64(a * t); elseif (z <= -2.1e-277) tmp = x; elseif (z <= 4.9e-287) tmp = Float64(a * t); elseif (z <= 3.5e-70) tmp = x; elseif (z <= 3.5e+119) tmp = t_1; else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (z <= -2.25e+117) tmp = z * y; elseif (z <= -1.6e+31) tmp = t_1; elseif (z <= -7.1e-155) tmp = a * t; elseif (z <= -2.1e-277) tmp = x; elseif (z <= 4.9e-287) tmp = a * t; elseif (z <= 3.5e-70) tmp = x; elseif (z <= 3.5e+119) tmp = t_1; else tmp = z * y; 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[z, -2.25e+117], N[(z * y), $MachinePrecision], If[LessEqual[z, -1.6e+31], t$95$1, If[LessEqual[z, -7.1e-155], N[(a * t), $MachinePrecision], If[LessEqual[z, -2.1e-277], x, If[LessEqual[z, 4.9e-287], N[(a * t), $MachinePrecision], If[LessEqual[z, 3.5e-70], x, If[LessEqual[z, 3.5e+119], t$95$1, N[(z * y), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;z \leq -2.25 \cdot 10^{+117}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -1.6 \cdot 10^{+31}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.1 \cdot 10^{-155}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq -2.1 \cdot 10^{-277}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-287}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+119}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -2.25e117 or 3.5000000000000001e119 < z Initial program 84.4%
*-commutative84.4%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in y around inf 59.9%
*-commutative59.9%
Simplified59.9%
if -2.25e117 < z < -1.6e31 or 3.49999999999999974e-70 < z < 3.5000000000000001e119Initial program 94.9%
*-commutative94.9%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in a around inf 73.5%
Taylor expanded in t around 0 51.4%
*-commutative51.4%
Simplified51.4%
if -1.6e31 < z < -7.1e-155 or -2.09999999999999995e-277 < z < 4.9000000000000001e-287Initial program 96.0%
*-commutative96.0%
associate-*l*94.1%
Simplified94.1%
Taylor expanded in t around inf 44.5%
if -7.1e-155 < z < -2.09999999999999995e-277 or 4.9000000000000001e-287 < z < 3.49999999999999974e-70Initial program 98.8%
*-commutative98.8%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in x around inf 61.2%
Final simplification55.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.75e+117)
(* z y)
(if (<= z -1.25e+47)
(* z (* a b))
(if (<= z -4.8e-157)
(* a t)
(if (<= z -8.5e-277)
x
(if (<= z 1.82e-286)
(* a t)
(if (<= z 3.1e-70)
x
(if (<= z 3.65e+124) (* a (* z b)) (* z y)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.75e+117) {
tmp = z * y;
} else if (z <= -1.25e+47) {
tmp = z * (a * b);
} else if (z <= -4.8e-157) {
tmp = a * t;
} else if (z <= -8.5e-277) {
tmp = x;
} else if (z <= 1.82e-286) {
tmp = a * t;
} else if (z <= 3.1e-70) {
tmp = x;
} else if (z <= 3.65e+124) {
tmp = a * (z * b);
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.75d+117)) then
tmp = z * y
else if (z <= (-1.25d+47)) then
tmp = z * (a * b)
else if (z <= (-4.8d-157)) then
tmp = a * t
else if (z <= (-8.5d-277)) then
tmp = x
else if (z <= 1.82d-286) then
tmp = a * t
else if (z <= 3.1d-70) then
tmp = x
else if (z <= 3.65d+124) then
tmp = a * (z * b)
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.75e+117) {
tmp = z * y;
} else if (z <= -1.25e+47) {
tmp = z * (a * b);
} else if (z <= -4.8e-157) {
tmp = a * t;
} else if (z <= -8.5e-277) {
tmp = x;
} else if (z <= 1.82e-286) {
tmp = a * t;
} else if (z <= 3.1e-70) {
tmp = x;
} else if (z <= 3.65e+124) {
tmp = a * (z * b);
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.75e+117: tmp = z * y elif z <= -1.25e+47: tmp = z * (a * b) elif z <= -4.8e-157: tmp = a * t elif z <= -8.5e-277: tmp = x elif z <= 1.82e-286: tmp = a * t elif z <= 3.1e-70: tmp = x elif z <= 3.65e+124: tmp = a * (z * b) else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.75e+117) tmp = Float64(z * y); elseif (z <= -1.25e+47) tmp = Float64(z * Float64(a * b)); elseif (z <= -4.8e-157) tmp = Float64(a * t); elseif (z <= -8.5e-277) tmp = x; elseif (z <= 1.82e-286) tmp = Float64(a * t); elseif (z <= 3.1e-70) tmp = x; elseif (z <= 3.65e+124) tmp = Float64(a * Float64(z * b)); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.75e+117) tmp = z * y; elseif (z <= -1.25e+47) tmp = z * (a * b); elseif (z <= -4.8e-157) tmp = a * t; elseif (z <= -8.5e-277) tmp = x; elseif (z <= 1.82e-286) tmp = a * t; elseif (z <= 3.1e-70) tmp = x; elseif (z <= 3.65e+124) tmp = a * (z * b); else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.75e+117], N[(z * y), $MachinePrecision], If[LessEqual[z, -1.25e+47], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, -4.8e-157], N[(a * t), $MachinePrecision], If[LessEqual[z, -8.5e-277], x, If[LessEqual[z, 1.82e-286], N[(a * t), $MachinePrecision], If[LessEqual[z, 3.1e-70], x, If[LessEqual[z, 3.65e+124], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+117}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -1.25 \cdot 10^{+47}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq -4.8 \cdot 10^{-157}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{-277}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.82 \cdot 10^{-286}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 3.1 \cdot 10^{-70}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.65 \cdot 10^{+124}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -1.74999999999999991e117 or 3.64999999999999997e124 < z Initial program 84.4%
*-commutative84.4%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in y around inf 59.9%
*-commutative59.9%
Simplified59.9%
if -1.74999999999999991e117 < z < -1.25000000000000005e47Initial program 93.1%
*-commutative93.1%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 82.0%
Taylor expanded in y around 0 81.5%
if -1.25000000000000005e47 < z < -4.8e-157 or -8.4999999999999998e-277 < z < 1.82e-286Initial program 96.2%
*-commutative96.2%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in t around inf 44.7%
if -4.8e-157 < z < -8.4999999999999998e-277 or 1.82e-286 < z < 3.1e-70Initial program 98.8%
*-commutative98.8%
associate-*l*91.6%
Simplified91.6%
Taylor expanded in x around inf 61.2%
if 3.1e-70 < z < 3.64999999999999997e124Initial program 95.2%
*-commutative95.2%
associate-*l*95.2%
Simplified95.2%
Taylor expanded in a around inf 67.1%
Taylor expanded in t around 0 43.4%
*-commutative43.4%
Simplified43.4%
Final simplification55.8%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.55e-31)
(* z y)
(if (<= z -1.15e-154)
(* a t)
(if (<= z -5.5e-277)
x
(if (<= z 3.6e-286)
(* a t)
(if (<= z 3.2e-35) x (if (<= z 4e+86) (* a t) (* z y))))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.55e-31) {
tmp = z * y;
} else if (z <= -1.15e-154) {
tmp = a * t;
} else if (z <= -5.5e-277) {
tmp = x;
} else if (z <= 3.6e-286) {
tmp = a * t;
} else if (z <= 3.2e-35) {
tmp = x;
} else if (z <= 4e+86) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.55d-31)) then
tmp = z * y
else if (z <= (-1.15d-154)) then
tmp = a * t
else if (z <= (-5.5d-277)) then
tmp = x
else if (z <= 3.6d-286) then
tmp = a * t
else if (z <= 3.2d-35) then
tmp = x
else if (z <= 4d+86) then
tmp = a * t
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.55e-31) {
tmp = z * y;
} else if (z <= -1.15e-154) {
tmp = a * t;
} else if (z <= -5.5e-277) {
tmp = x;
} else if (z <= 3.6e-286) {
tmp = a * t;
} else if (z <= 3.2e-35) {
tmp = x;
} else if (z <= 4e+86) {
tmp = a * t;
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.55e-31: tmp = z * y elif z <= -1.15e-154: tmp = a * t elif z <= -5.5e-277: tmp = x elif z <= 3.6e-286: tmp = a * t elif z <= 3.2e-35: tmp = x elif z <= 4e+86: tmp = a * t else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.55e-31) tmp = Float64(z * y); elseif (z <= -1.15e-154) tmp = Float64(a * t); elseif (z <= -5.5e-277) tmp = x; elseif (z <= 3.6e-286) tmp = Float64(a * t); elseif (z <= 3.2e-35) tmp = x; elseif (z <= 4e+86) tmp = Float64(a * t); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.55e-31) tmp = z * y; elseif (z <= -1.15e-154) tmp = a * t; elseif (z <= -5.5e-277) tmp = x; elseif (z <= 3.6e-286) tmp = a * t; elseif (z <= 3.2e-35) tmp = x; elseif (z <= 4e+86) tmp = a * t; else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.55e-31], N[(z * y), $MachinePrecision], If[LessEqual[z, -1.15e-154], N[(a * t), $MachinePrecision], If[LessEqual[z, -5.5e-277], x, If[LessEqual[z, 3.6e-286], N[(a * t), $MachinePrecision], If[LessEqual[z, 3.2e-35], x, If[LessEqual[z, 4e+86], N[(a * t), $MachinePrecision], N[(z * y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-31}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -1.15 \cdot 10^{-154}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq -5.5 \cdot 10^{-277}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 3.6 \cdot 10^{-286}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-35}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4 \cdot 10^{+86}:\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -1.55e-31 or 4.0000000000000001e86 < z Initial program 87.8%
*-commutative87.8%
associate-*l*93.2%
Simplified93.2%
Taylor expanded in y around inf 48.7%
*-commutative48.7%
Simplified48.7%
if -1.55e-31 < z < -1.15e-154 or -5.49999999999999952e-277 < z < 3.60000000000000013e-286 or 3.1999999999999998e-35 < z < 4.0000000000000001e86Initial program 96.8%
*-commutative96.8%
associate-*l*95.3%
Simplified95.3%
Taylor expanded in t around inf 47.1%
if -1.15e-154 < z < -5.49999999999999952e-277 or 3.60000000000000013e-286 < z < 3.1999999999999998e-35Initial program 97.8%
*-commutative97.8%
associate-*l*91.4%
Simplified91.4%
Taylor expanded in x around inf 58.6%
Final simplification51.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))) (t_2 (* z (+ y (* a b)))))
(if (<= z -3.4e-7)
t_2
(if (<= z 8.2e-71)
t_1
(if (<= z 0.68) (* a (+ t (* z b))) (if (<= z 6.8e+18) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -3.4e-7) {
tmp = t_2;
} else if (z <= 8.2e-71) {
tmp = t_1;
} else if (z <= 0.68) {
tmp = a * (t + (z * b));
} else if (z <= 6.8e+18) {
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 + (a * t)
t_2 = z * (y + (a * b))
if (z <= (-3.4d-7)) then
tmp = t_2
else if (z <= 8.2d-71) then
tmp = t_1
else if (z <= 0.68d0) then
tmp = a * (t + (z * b))
else if (z <= 6.8d+18) 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 + (a * t);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -3.4e-7) {
tmp = t_2;
} else if (z <= 8.2e-71) {
tmp = t_1;
} else if (z <= 0.68) {
tmp = a * (t + (z * b));
} else if (z <= 6.8e+18) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) t_2 = z * (y + (a * b)) tmp = 0 if z <= -3.4e-7: tmp = t_2 elif z <= 8.2e-71: tmp = t_1 elif z <= 0.68: tmp = a * (t + (z * b)) elif z <= 6.8e+18: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -3.4e-7) tmp = t_2; elseif (z <= 8.2e-71) tmp = t_1; elseif (z <= 0.68) tmp = Float64(a * Float64(t + Float64(z * b))); elseif (z <= 6.8e+18) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -3.4e-7) tmp = t_2; elseif (z <= 8.2e-71) tmp = t_1; elseif (z <= 0.68) tmp = a * (t + (z * b)); elseif (z <= 6.8e+18) 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[(a * t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.4e-7], t$95$2, If[LessEqual[z, 8.2e-71], t$95$1, If[LessEqual[z, 0.68], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 6.8e+18], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -3.4 \cdot 10^{-7}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 8.2 \cdot 10^{-71}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 0.68:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+18}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.39999999999999974e-7 or 6.8e18 < z Initial program 88.6%
*-commutative88.6%
associate-*l*93.7%
Simplified93.7%
Taylor expanded in z around inf 81.4%
if -3.39999999999999974e-7 < z < 8.19999999999999987e-71 or 0.680000000000000049 < z < 6.8e18Initial program 97.7%
*-commutative97.7%
associate-*l*92.4%
Simplified92.4%
Taylor expanded in z around 0 80.1%
if 8.19999999999999987e-71 < z < 0.680000000000000049Initial program 94.4%
*-commutative94.4%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in a around inf 77.0%
Final simplification80.5%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* z y)) (* a t)) (* z (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (z * y)) + (a * t)) + (z * (a * 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 + (z * y)) + (a * t)) + (z * (a * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (z * y)) + (a * t)) + (z * (a * b));
}
def code(x, y, z, t, a, b): return ((x + (z * y)) + (a * t)) + (z * (a * b))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(z * y)) + Float64(a * t)) + Float64(z * Float64(a * b))) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (z * y)) + (a * t)) + (z * (a * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision] + N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + z \cdot y\right) + a \cdot t\right) + z \cdot \left(a \cdot b\right)
\end{array}
Initial program 93.5%
*-commutative93.5%
associate-*l*93.1%
Simplified93.1%
Final simplification93.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -2.2e+78)
t_1
(if (<= a 2.75e-93)
(+ x (* z y))
(if (<= a 2.6e+66) (+ x (* a t)) t_1)))))
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 <= -2.2e+78) {
tmp = t_1;
} else if (a <= 2.75e-93) {
tmp = x + (z * y);
} else if (a <= 2.6e+66) {
tmp = x + (a * t);
} 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 = a * (t + (z * b))
if (a <= (-2.2d+78)) then
tmp = t_1
else if (a <= 2.75d-93) then
tmp = x + (z * y)
else if (a <= 2.6d+66) then
tmp = x + (a * t)
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 = a * (t + (z * b));
double tmp;
if (a <= -2.2e+78) {
tmp = t_1;
} else if (a <= 2.75e-93) {
tmp = x + (z * y);
} else if (a <= 2.6e+66) {
tmp = x + (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -2.2e+78: tmp = t_1 elif a <= 2.75e-93: tmp = x + (z * y) elif a <= 2.6e+66: tmp = x + (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -2.2e+78) tmp = t_1; elseif (a <= 2.75e-93) tmp = Float64(x + Float64(z * y)); elseif (a <= 2.6e+66) tmp = Float64(x + Float64(a * t)); else tmp = t_1; 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 <= -2.2e+78) tmp = t_1; elseif (a <= 2.75e-93) tmp = x + (z * y); elseif (a <= 2.6e+66) tmp = x + (a * t); else tmp = t_1; 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, -2.2e+78], t$95$1, If[LessEqual[a, 2.75e-93], N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2.6e+66], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -2.2 \cdot 10^{+78}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 2.75 \cdot 10^{-93}:\\
\;\;\;\;x + z \cdot y\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{+66}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -2.20000000000000014e78 or 2.60000000000000012e66 < a Initial program 87.6%
*-commutative87.6%
associate-*l*84.8%
Simplified84.8%
Taylor expanded in a around inf 81.1%
if -2.20000000000000014e78 < a < 2.74999999999999984e-93Initial program 96.1%
*-commutative96.1%
associate-*l*98.3%
Simplified98.3%
Taylor expanded in a around 0 77.3%
if 2.74999999999999984e-93 < a < 2.60000000000000012e66Initial program 100.0%
*-commutative100.0%
associate-*l*97.3%
Simplified97.3%
Taylor expanded in z around 0 70.9%
Final simplification77.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2.5e+81) (not (<= a 2.1e+149))) (* a (+ t (* z b))) (+ x (+ (* z y) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.5e+81) || !(a <= 2.1e+149)) {
tmp = a * (t + (z * b));
} else {
tmp = x + ((z * y) + (a * t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-2.5d+81)) .or. (.not. (a <= 2.1d+149))) then
tmp = a * (t + (z * b))
else
tmp = x + ((z * y) + (a * t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -2.5e+81) || !(a <= 2.1e+149)) {
tmp = a * (t + (z * b));
} else {
tmp = x + ((z * y) + (a * t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2.5e+81) or not (a <= 2.1e+149): tmp = a * (t + (z * b)) else: tmp = x + ((z * y) + (a * t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -2.5e+81) || !(a <= 2.1e+149)) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -2.5e+81) || ~((a <= 2.1e+149))) tmp = a * (t + (z * b)); else tmp = x + ((z * y) + (a * t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -2.5e+81], N[Not[LessEqual[a, 2.1e+149]], $MachinePrecision]], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2.5 \cdot 10^{+81} \lor \neg \left(a \leq 2.1 \cdot 10^{+149}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\end{array}
\end{array}
if a < -2.4999999999999999e81 or 2.1000000000000002e149 < a Initial program 86.4%
*-commutative86.4%
associate-*l*83.1%
Simplified83.1%
Taylor expanded in a around inf 85.8%
if -2.4999999999999999e81 < a < 2.1000000000000002e149Initial program 96.7%
*-commutative96.7%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in b around 0 88.7%
Final simplification87.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.05e-9) (not (<= t 3.6e+54))) (+ x (+ (* z y) (* a t))) (+ (* z (+ y (* a b))) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.05e-9) || !(t <= 3.6e+54)) {
tmp = x + ((z * y) + (a * t));
} else {
tmp = (z * (y + (a * b))) + x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.05d-9)) .or. (.not. (t <= 3.6d+54))) then
tmp = x + ((z * y) + (a * t))
else
tmp = (z * (y + (a * b))) + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.05e-9) || !(t <= 3.6e+54)) {
tmp = x + ((z * y) + (a * t));
} else {
tmp = (z * (y + (a * b))) + x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.05e-9) or not (t <= 3.6e+54): tmp = x + ((z * y) + (a * t)) else: tmp = (z * (y + (a * b))) + x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.05e-9) || !(t <= 3.6e+54)) tmp = Float64(x + Float64(Float64(z * y) + Float64(a * t))); else tmp = Float64(Float64(z * Float64(y + Float64(a * b))) + x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.05e-9) || ~((t <= 3.6e+54))) tmp = x + ((z * y) + (a * t)); else tmp = (z * (y + (a * b))) + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.05e-9], N[Not[LessEqual[t, 3.6e+54]], $MachinePrecision]], N[(x + N[(N[(z * y), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.05 \cdot 10^{-9} \lor \neg \left(t \leq 3.6 \cdot 10^{+54}\right):\\
\;\;\;\;x + \left(z \cdot y + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right) + x\\
\end{array}
\end{array}
if t < -1.0500000000000001e-9 or 3.6000000000000001e54 < t Initial program 90.9%
*-commutative90.9%
associate-*l*92.7%
Simplified92.7%
Taylor expanded in b around 0 91.1%
if -1.0500000000000001e-9 < t < 3.6000000000000001e54Initial program 95.3%
*-commutative95.3%
associate-*l*93.4%
Simplified93.4%
Taylor expanded in t around 0 88.7%
+-commutative88.7%
associate-*r*88.0%
distribute-rgt-in89.4%
+-commutative89.4%
Simplified89.4%
Final simplification90.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -7.4e+118)
(* z y)
(if (<= z -8.5e+48)
(* z (* a b))
(if (<= z 9.8e+95) (+ x (* a t)) (* z y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.4e+118) {
tmp = z * y;
} else if (z <= -8.5e+48) {
tmp = z * (a * b);
} else if (z <= 9.8e+95) {
tmp = x + (a * t);
} else {
tmp = z * y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-7.4d+118)) then
tmp = z * y
else if (z <= (-8.5d+48)) then
tmp = z * (a * b)
else if (z <= 9.8d+95) then
tmp = x + (a * t)
else
tmp = z * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.4e+118) {
tmp = z * y;
} else if (z <= -8.5e+48) {
tmp = z * (a * b);
} else if (z <= 9.8e+95) {
tmp = x + (a * t);
} else {
tmp = z * y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7.4e+118: tmp = z * y elif z <= -8.5e+48: tmp = z * (a * b) elif z <= 9.8e+95: tmp = x + (a * t) else: tmp = z * y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.4e+118) tmp = Float64(z * y); elseif (z <= -8.5e+48) tmp = Float64(z * Float64(a * b)); elseif (z <= 9.8e+95) tmp = Float64(x + Float64(a * t)); else tmp = Float64(z * y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7.4e+118) tmp = z * y; elseif (z <= -8.5e+48) tmp = z * (a * b); elseif (z <= 9.8e+95) tmp = x + (a * t); else tmp = z * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.4e+118], N[(z * y), $MachinePrecision], If[LessEqual[z, -8.5e+48], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.8e+95], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(z * y), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+118}:\\
\;\;\;\;z \cdot y\\
\mathbf{elif}\;z \leq -8.5 \cdot 10^{+48}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 9.8 \cdot 10^{+95}:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;z \cdot y\\
\end{array}
\end{array}
if z < -7.39999999999999973e118 or 9.7999999999999998e95 < z Initial program 85.7%
*-commutative85.7%
associate-*l*92.0%
Simplified92.0%
Taylor expanded in y around inf 57.9%
*-commutative57.9%
Simplified57.9%
if -7.39999999999999973e118 < z < -8.5000000000000001e48Initial program 93.1%
*-commutative93.1%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 82.0%
Taylor expanded in y around 0 81.5%
if -8.5000000000000001e48 < z < 9.7999999999999998e95Initial program 97.0%
*-commutative97.0%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in z around 0 70.9%
Final simplification67.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* z y))))
(if (<= z -5.5e+117)
t_1
(if (<= z -7.2e+50)
(* z (* a b))
(if (<= z 9500000000.0) (+ x (* a t)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double tmp;
if (z <= -5.5e+117) {
tmp = t_1;
} else if (z <= -7.2e+50) {
tmp = z * (a * b);
} else if (z <= 9500000000.0) {
tmp = x + (a * t);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (z * y)
if (z <= (-5.5d+117)) then
tmp = t_1
else if (z <= (-7.2d+50)) then
tmp = z * (a * b)
else if (z <= 9500000000.0d0) then
tmp = x + (a * t)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (z * y);
double tmp;
if (z <= -5.5e+117) {
tmp = t_1;
} else if (z <= -7.2e+50) {
tmp = z * (a * b);
} else if (z <= 9500000000.0) {
tmp = x + (a * t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (z * y) tmp = 0 if z <= -5.5e+117: tmp = t_1 elif z <= -7.2e+50: tmp = z * (a * b) elif z <= 9500000000.0: tmp = x + (a * t) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(z * y)) tmp = 0.0 if (z <= -5.5e+117) tmp = t_1; elseif (z <= -7.2e+50) tmp = Float64(z * Float64(a * b)); elseif (z <= 9500000000.0) tmp = Float64(x + Float64(a * t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (z * y); tmp = 0.0; if (z <= -5.5e+117) tmp = t_1; elseif (z <= -7.2e+50) tmp = z * (a * b); elseif (z <= 9500000000.0) tmp = x + (a * t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(z * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -5.5e+117], t$95$1, If[LessEqual[z, -7.2e+50], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9500000000.0], N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + z \cdot y\\
\mathbf{if}\;z \leq -5.5 \cdot 10^{+117}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -7.2 \cdot 10^{+50}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;z \leq 9500000000:\\
\;\;\;\;x + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -5.49999999999999965e117 or 9.5e9 < z Initial program 86.9%
*-commutative86.9%
associate-*l*92.2%
Simplified92.2%
Taylor expanded in a around 0 64.0%
if -5.49999999999999965e117 < z < -7.19999999999999972e50Initial program 93.1%
*-commutative93.1%
associate-*l*99.8%
Simplified99.8%
Taylor expanded in z around inf 82.0%
Taylor expanded in y around 0 81.5%
if -7.19999999999999972e50 < z < 9.5e9Initial program 97.4%
*-commutative97.4%
associate-*l*93.0%
Simplified93.0%
Taylor expanded in z around 0 73.6%
Final simplification70.6%
(FPCore (x y z t a b) :precision binary64 (if (<= t -2.15e+53) (* a t) (if (<= t 1.6e+32) x (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e+53) {
tmp = a * t;
} else if (t <= 1.6e+32) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (t <= (-2.15d+53)) then
tmp = a * t
else if (t <= 1.6d+32) then
tmp = x
else
tmp = a * t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -2.15e+53) {
tmp = a * t;
} else if (t <= 1.6e+32) {
tmp = x;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -2.15e+53: tmp = a * t elif t <= 1.6e+32: tmp = x else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -2.15e+53) tmp = Float64(a * t); elseif (t <= 1.6e+32) tmp = x; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -2.15e+53) tmp = a * t; elseif (t <= 1.6e+32) tmp = x; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -2.15e+53], N[(a * t), $MachinePrecision], If[LessEqual[t, 1.6e+32], x, N[(a * t), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.15 \cdot 10^{+53}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;t \leq 1.6 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if t < -2.1499999999999999e53 or 1.5999999999999999e32 < t Initial program 90.3%
*-commutative90.3%
associate-*l*91.3%
Simplified91.3%
Taylor expanded in t around inf 51.0%
if -2.1499999999999999e53 < t < 1.5999999999999999e32Initial program 95.6%
*-commutative95.6%
associate-*l*94.3%
Simplified94.3%
Taylor expanded in x around inf 35.4%
Final simplification41.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 93.5%
*-commutative93.5%
associate-*l*93.1%
Simplified93.1%
Taylor expanded in x around inf 29.0%
Final simplification29.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 2023287
(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)))