
(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 14 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))))
(if (<= (+ (* b (* z a)) (+ t_1 (* a t))) INFINITY)
(+ t_1 (+ (* a (* z b)) (* a t)))
(* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((b * (z * a)) + (t_1 + (a * t))) <= ((double) INFINITY)) {
tmp = t_1 + ((a * (z * b)) + (a * t));
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((b * (z * a)) + (t_1 + (a * t))) <= Double.POSITIVE_INFINITY) {
tmp = t_1 + ((a * (z * b)) + (a * t));
} else {
tmp = a * (t + (z * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if ((b * (z * a)) + (t_1 + (a * t))) <= math.inf: tmp = t_1 + ((a * (z * b)) + (a * t)) else: tmp = a * (t + (z * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (Float64(Float64(b * Float64(z * a)) + Float64(t_1 + Float64(a * t))) <= Inf) tmp = Float64(t_1 + Float64(Float64(a * Float64(z * b)) + Float64(a * t))); else tmp = Float64(a * Float64(t + Float64(z * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (((b * (z * a)) + (t_1 + (a * t))) <= Inf) tmp = t_1 + ((a * (z * b)) + (a * t)); else tmp = a * (t + (z * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision] + N[(t$95$1 + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;b \cdot \left(z \cdot a\right) + \left(t_1 + a \cdot t\right) \leq \infty:\\
\;\;\;\;t_1 + \left(a \cdot \left(z \cdot b\right) + a \cdot t\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 96.9%
associate-+l+96.9%
associate-*l*98.0%
Simplified98.0%
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%
*-un-lft-identity0.0%
fma-def0.0%
*-commutative0.0%
fma-def0.0%
*-commutative0.0%
Applied egg-rr0.0%
Taylor expanded in a around inf 88.9%
Final simplification97.7%
(FPCore (x y z t a b) :precision binary64 (+ (fma y z x) (* a (+ t (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
return fma(y, z, x) + (a * (t + (z * b)));
}
function code(x, y, z, t, a, b) return Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)
\end{array}
Initial program 93.5%
associate-+l+93.5%
+-commutative93.5%
fma-def93.5%
*-commutative93.5%
associate-*l*94.9%
*-commutative94.9%
distribute-lft-out96.9%
remove-double-neg96.9%
*-commutative96.9%
distribute-lft-neg-out96.9%
sub-neg96.9%
sub-neg96.9%
distribute-lft-neg-in96.9%
remove-double-neg96.9%
Simplified96.9%
Final simplification96.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -7.2e+241)
t_1
(if (<= a -2.3e+154)
(* a t)
(if (<= a -6.5e+121)
t_1
(if (<= a -2500000000.0)
(* a t)
(if (<= a 9.5e-230)
x
(if (<= a 15500.0)
(* y z)
(if (<= a 2.3e+161) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -7.2e+241) {
tmp = t_1;
} else if (a <= -2.3e+154) {
tmp = a * t;
} else if (a <= -6.5e+121) {
tmp = t_1;
} else if (a <= -2500000000.0) {
tmp = a * t;
} else if (a <= 9.5e-230) {
tmp = x;
} else if (a <= 15500.0) {
tmp = y * z;
} else if (a <= 2.3e+161) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (a <= (-7.2d+241)) then
tmp = t_1
else if (a <= (-2.3d+154)) then
tmp = a * t
else if (a <= (-6.5d+121)) then
tmp = t_1
else if (a <= (-2500000000.0d0)) then
tmp = a * t
else if (a <= 9.5d-230) then
tmp = x
else if (a <= 15500.0d0) then
tmp = y * z
else if (a <= 2.3d+161) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (a <= -7.2e+241) {
tmp = t_1;
} else if (a <= -2.3e+154) {
tmp = a * t;
} else if (a <= -6.5e+121) {
tmp = t_1;
} else if (a <= -2500000000.0) {
tmp = a * t;
} else if (a <= 9.5e-230) {
tmp = x;
} else if (a <= 15500.0) {
tmp = y * z;
} else if (a <= 2.3e+161) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -7.2e+241: tmp = t_1 elif a <= -2.3e+154: tmp = a * t elif a <= -6.5e+121: tmp = t_1 elif a <= -2500000000.0: tmp = a * t elif a <= 9.5e-230: tmp = x elif a <= 15500.0: tmp = y * z elif a <= 2.3e+161: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -7.2e+241) tmp = t_1; elseif (a <= -2.3e+154) tmp = Float64(a * t); elseif (a <= -6.5e+121) tmp = t_1; elseif (a <= -2500000000.0) tmp = Float64(a * t); elseif (a <= 9.5e-230) tmp = x; elseif (a <= 15500.0) tmp = Float64(y * z); elseif (a <= 2.3e+161) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -7.2e+241) tmp = t_1; elseif (a <= -2.3e+154) tmp = a * t; elseif (a <= -6.5e+121) tmp = t_1; elseif (a <= -2500000000.0) tmp = a * t; elseif (a <= 9.5e-230) tmp = x; elseif (a <= 15500.0) tmp = y * z; elseif (a <= 2.3e+161) tmp = t_1; else tmp = a * t; 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[a, -7.2e+241], t$95$1, If[LessEqual[a, -2.3e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -6.5e+121], t$95$1, If[LessEqual[a, -2500000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 9.5e-230], x, If[LessEqual[a, 15500.0], N[(y * z), $MachinePrecision], If[LessEqual[a, 2.3e+161], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -7.2 \cdot 10^{+241}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.3 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -6.5 \cdot 10^{+121}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2500000000:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 9.5 \cdot 10^{-230}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 15500:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 2.3 \cdot 10^{+161}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -7.19999999999999966e241 or -2.3e154 < a < -6.50000000000000019e121 or 15500 < a < 2.2999999999999999e161Initial program 83.2%
associate-+l+83.2%
*-un-lft-identity83.2%
fma-def83.2%
*-commutative83.2%
fma-def83.2%
*-commutative83.2%
Applied egg-rr83.2%
fma-udef83.2%
*-un-lft-identity83.2%
+-commutative83.2%
Applied egg-rr83.2%
Taylor expanded in b around inf 62.9%
*-commutative62.9%
Simplified62.9%
if -7.19999999999999966e241 < a < -2.3e154 or -6.50000000000000019e121 < a < -2.5e9 or 2.2999999999999999e161 < a Initial program 90.8%
associate-+l+90.8%
*-un-lft-identity90.8%
fma-def90.8%
*-commutative90.8%
fma-def90.9%
*-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in t around inf 62.5%
if -2.5e9 < a < 9.5000000000000004e-230Initial program 98.7%
associate-+l+98.7%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 56.8%
if 9.5000000000000004e-230 < a < 15500Initial program 100.0%
associate-+l+100.0%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 49.6%
*-commutative49.6%
Simplified49.6%
Final simplification58.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -1.1e+243)
t_1
(if (<= a -4.3e+154)
(* a t)
(if (<= a -3.8e+120)
(* b (* z a))
(if (<= a -5800000000.0)
(* a t)
(if (<= a 2.6e-226)
x
(if (<= a 6500.0) (* y z) (if (<= a 3.6e+161) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -1.1e+243) {
tmp = t_1;
} else if (a <= -4.3e+154) {
tmp = a * t;
} else if (a <= -3.8e+120) {
tmp = b * (z * a);
} else if (a <= -5800000000.0) {
tmp = a * t;
} else if (a <= 2.6e-226) {
tmp = x;
} else if (a <= 6500.0) {
tmp = y * z;
} else if (a <= 3.6e+161) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (a <= (-1.1d+243)) then
tmp = t_1
else if (a <= (-4.3d+154)) then
tmp = a * t
else if (a <= (-3.8d+120)) then
tmp = b * (z * a)
else if (a <= (-5800000000.0d0)) then
tmp = a * t
else if (a <= 2.6d-226) then
tmp = x
else if (a <= 6500.0d0) then
tmp = y * z
else if (a <= 3.6d+161) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (a <= -1.1e+243) {
tmp = t_1;
} else if (a <= -4.3e+154) {
tmp = a * t;
} else if (a <= -3.8e+120) {
tmp = b * (z * a);
} else if (a <= -5800000000.0) {
tmp = a * t;
} else if (a <= 2.6e-226) {
tmp = x;
} else if (a <= 6500.0) {
tmp = y * z;
} else if (a <= 3.6e+161) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -1.1e+243: tmp = t_1 elif a <= -4.3e+154: tmp = a * t elif a <= -3.8e+120: tmp = b * (z * a) elif a <= -5800000000.0: tmp = a * t elif a <= 2.6e-226: tmp = x elif a <= 6500.0: tmp = y * z elif a <= 3.6e+161: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -1.1e+243) tmp = t_1; elseif (a <= -4.3e+154) tmp = Float64(a * t); elseif (a <= -3.8e+120) tmp = Float64(b * Float64(z * a)); elseif (a <= -5800000000.0) tmp = Float64(a * t); elseif (a <= 2.6e-226) tmp = x; elseif (a <= 6500.0) tmp = Float64(y * z); elseif (a <= 3.6e+161) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -1.1e+243) tmp = t_1; elseif (a <= -4.3e+154) tmp = a * t; elseif (a <= -3.8e+120) tmp = b * (z * a); elseif (a <= -5800000000.0) tmp = a * t; elseif (a <= 2.6e-226) tmp = x; elseif (a <= 6500.0) tmp = y * z; elseif (a <= 3.6e+161) tmp = t_1; else tmp = a * t; 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[a, -1.1e+243], t$95$1, If[LessEqual[a, -4.3e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -3.8e+120], N[(b * N[(z * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -5800000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 2.6e-226], x, If[LessEqual[a, 6500.0], N[(y * z), $MachinePrecision], If[LessEqual[a, 3.6e+161], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -1.1 \cdot 10^{+243}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.3 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -3.8 \cdot 10^{+120}:\\
\;\;\;\;b \cdot \left(z \cdot a\right)\\
\mathbf{elif}\;a \leq -5800000000:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-226}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 6500:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 3.6 \cdot 10^{+161}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -1.10000000000000004e243 or 6500 < a < 3.59999999999999984e161Initial program 82.1%
associate-+l+82.1%
*-un-lft-identity82.1%
fma-def82.1%
*-commutative82.1%
fma-def82.1%
*-commutative82.1%
Applied egg-rr82.1%
fma-udef82.1%
*-un-lft-identity82.1%
+-commutative82.1%
Applied egg-rr82.1%
Taylor expanded in b around inf 62.0%
*-commutative62.0%
Simplified62.0%
if -1.10000000000000004e243 < a < -4.2999999999999998e154 or -3.7999999999999998e120 < a < -5.8e9 or 3.59999999999999984e161 < a Initial program 90.8%
associate-+l+90.8%
*-un-lft-identity90.8%
fma-def90.8%
*-commutative90.8%
fma-def90.9%
*-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in t around inf 62.5%
if -4.2999999999999998e154 < a < -3.7999999999999998e120Initial program 88.7%
associate-+l+88.7%
*-un-lft-identity88.7%
fma-def88.7%
*-commutative88.7%
fma-def88.7%
*-commutative88.7%
Applied egg-rr88.7%
fma-udef88.7%
*-un-lft-identity88.7%
+-commutative88.7%
Applied egg-rr88.7%
Taylor expanded in b around inf 67.2%
associate-*r*67.7%
*-commutative67.7%
associate-*r*67.4%
Simplified67.4%
if -5.8e9 < a < 2.5999999999999998e-226Initial program 98.7%
associate-+l+98.7%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 56.8%
if 2.5999999999999998e-226 < a < 6500Initial program 100.0%
associate-+l+100.0%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 49.6%
*-commutative49.6%
Simplified49.6%
Final simplification58.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -7e+243)
t_1
(if (<= a -2.7e+154)
(* a t)
(if (<= a -2.8e+121)
(* z (* a b))
(if (<= a -64000000000.0)
(* a t)
(if (<= a 3.8e-224)
x
(if (<= a 1300.0) (* y z) (if (<= a 6e+160) t_1 (* a t))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -7e+243) {
tmp = t_1;
} else if (a <= -2.7e+154) {
tmp = a * t;
} else if (a <= -2.8e+121) {
tmp = z * (a * b);
} else if (a <= -64000000000.0) {
tmp = a * t;
} else if (a <= 3.8e-224) {
tmp = x;
} else if (a <= 1300.0) {
tmp = y * z;
} else if (a <= 6e+160) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (a <= (-7d+243)) then
tmp = t_1
else if (a <= (-2.7d+154)) then
tmp = a * t
else if (a <= (-2.8d+121)) then
tmp = z * (a * b)
else if (a <= (-64000000000.0d0)) then
tmp = a * t
else if (a <= 3.8d-224) then
tmp = x
else if (a <= 1300.0d0) then
tmp = y * z
else if (a <= 6d+160) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (a <= -7e+243) {
tmp = t_1;
} else if (a <= -2.7e+154) {
tmp = a * t;
} else if (a <= -2.8e+121) {
tmp = z * (a * b);
} else if (a <= -64000000000.0) {
tmp = a * t;
} else if (a <= 3.8e-224) {
tmp = x;
} else if (a <= 1300.0) {
tmp = y * z;
} else if (a <= 6e+160) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -7e+243: tmp = t_1 elif a <= -2.7e+154: tmp = a * t elif a <= -2.8e+121: tmp = z * (a * b) elif a <= -64000000000.0: tmp = a * t elif a <= 3.8e-224: tmp = x elif a <= 1300.0: tmp = y * z elif a <= 6e+160: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -7e+243) tmp = t_1; elseif (a <= -2.7e+154) tmp = Float64(a * t); elseif (a <= -2.8e+121) tmp = Float64(z * Float64(a * b)); elseif (a <= -64000000000.0) tmp = Float64(a * t); elseif (a <= 3.8e-224) tmp = x; elseif (a <= 1300.0) tmp = Float64(y * z); elseif (a <= 6e+160) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -7e+243) tmp = t_1; elseif (a <= -2.7e+154) tmp = a * t; elseif (a <= -2.8e+121) tmp = z * (a * b); elseif (a <= -64000000000.0) tmp = a * t; elseif (a <= 3.8e-224) tmp = x; elseif (a <= 1300.0) tmp = y * z; elseif (a <= 6e+160) tmp = t_1; else tmp = a * t; 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[a, -7e+243], t$95$1, If[LessEqual[a, -2.7e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.8e+121], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -64000000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 3.8e-224], x, If[LessEqual[a, 1300.0], N[(y * z), $MachinePrecision], If[LessEqual[a, 6e+160], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -7 \cdot 10^{+243}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -2.7 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -2.8 \cdot 10^{+121}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq -64000000000:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 3.8 \cdot 10^{-224}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1300:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;a \leq 6 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -6.99999999999999976e243 or 1300 < a < 5.9999999999999997e160Initial program 82.1%
associate-+l+82.1%
*-un-lft-identity82.1%
fma-def82.1%
*-commutative82.1%
fma-def82.1%
*-commutative82.1%
Applied egg-rr82.1%
fma-udef82.1%
*-un-lft-identity82.1%
+-commutative82.1%
Applied egg-rr82.1%
Taylor expanded in b around inf 62.0%
*-commutative62.0%
Simplified62.0%
if -6.99999999999999976e243 < a < -2.70000000000000006e154 or -2.80000000000000006e121 < a < -6.4e10 or 5.9999999999999997e160 < a Initial program 90.8%
associate-+l+90.8%
*-un-lft-identity90.8%
fma-def90.8%
*-commutative90.8%
fma-def90.9%
*-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in t around inf 62.5%
if -2.70000000000000006e154 < a < -2.80000000000000006e121Initial program 88.7%
associate-+l+88.7%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in z around inf 78.6%
Taylor expanded in y around 0 67.7%
if -6.4e10 < a < 3.80000000000000002e-224Initial program 98.7%
associate-+l+98.7%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 56.8%
if 3.80000000000000002e-224 < a < 1300Initial program 100.0%
associate-+l+100.0%
associate-*l*93.8%
Simplified93.8%
Taylor expanded in y around inf 49.6%
*-commutative49.6%
Simplified49.6%
Final simplification58.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* z b))))
(if (<= a -2.5e+244)
t_1
(if (<= a -4.8e+154)
(* a t)
(if (<= a -2.35e+117)
(* z (* a b))
(if (<= a -320000000000.0)
(* a t)
(if (<= a 9600.0)
(+ x (* y z))
(if (<= a 8e+160) t_1 (* a t)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (z * b);
double tmp;
if (a <= -2.5e+244) {
tmp = t_1;
} else if (a <= -4.8e+154) {
tmp = a * t;
} else if (a <= -2.35e+117) {
tmp = z * (a * b);
} else if (a <= -320000000000.0) {
tmp = a * t;
} else if (a <= 9600.0) {
tmp = x + (y * z);
} else if (a <= 8e+160) {
tmp = t_1;
} 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) :: t_1
real(8) :: tmp
t_1 = a * (z * b)
if (a <= (-2.5d+244)) then
tmp = t_1
else if (a <= (-4.8d+154)) then
tmp = a * t
else if (a <= (-2.35d+117)) then
tmp = z * (a * b)
else if (a <= (-320000000000.0d0)) then
tmp = a * t
else if (a <= 9600.0d0) then
tmp = x + (y * z)
else if (a <= 8d+160) then
tmp = t_1
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 t_1 = a * (z * b);
double tmp;
if (a <= -2.5e+244) {
tmp = t_1;
} else if (a <= -4.8e+154) {
tmp = a * t;
} else if (a <= -2.35e+117) {
tmp = z * (a * b);
} else if (a <= -320000000000.0) {
tmp = a * t;
} else if (a <= 9600.0) {
tmp = x + (y * z);
} else if (a <= 8e+160) {
tmp = t_1;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (z * b) tmp = 0 if a <= -2.5e+244: tmp = t_1 elif a <= -4.8e+154: tmp = a * t elif a <= -2.35e+117: tmp = z * (a * b) elif a <= -320000000000.0: tmp = a * t elif a <= 9600.0: tmp = x + (y * z) elif a <= 8e+160: tmp = t_1 else: tmp = a * t return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(z * b)) tmp = 0.0 if (a <= -2.5e+244) tmp = t_1; elseif (a <= -4.8e+154) tmp = Float64(a * t); elseif (a <= -2.35e+117) tmp = Float64(z * Float64(a * b)); elseif (a <= -320000000000.0) tmp = Float64(a * t); elseif (a <= 9600.0) tmp = Float64(x + Float64(y * z)); elseif (a <= 8e+160) tmp = t_1; else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a * (z * b); tmp = 0.0; if (a <= -2.5e+244) tmp = t_1; elseif (a <= -4.8e+154) tmp = a * t; elseif (a <= -2.35e+117) tmp = z * (a * b); elseif (a <= -320000000000.0) tmp = a * t; elseif (a <= 9600.0) tmp = x + (y * z); elseif (a <= 8e+160) tmp = t_1; else tmp = a * t; 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[a, -2.5e+244], t$95$1, If[LessEqual[a, -4.8e+154], N[(a * t), $MachinePrecision], If[LessEqual[a, -2.35e+117], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, -320000000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 9600.0], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 8e+160], t$95$1, N[(a * t), $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(z \cdot b\right)\\
\mathbf{if}\;a \leq -2.5 \cdot 10^{+244}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq -4.8 \cdot 10^{+154}:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq -2.35 \cdot 10^{+117}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{elif}\;a \leq -320000000000:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 9600:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 8 \cdot 10^{+160}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -2.50000000000000011e244 or 9600 < a < 8.00000000000000005e160Initial program 82.1%
associate-+l+82.1%
*-un-lft-identity82.1%
fma-def82.1%
*-commutative82.1%
fma-def82.1%
*-commutative82.1%
Applied egg-rr82.1%
fma-udef82.1%
*-un-lft-identity82.1%
+-commutative82.1%
Applied egg-rr82.1%
Taylor expanded in b around inf 62.0%
*-commutative62.0%
Simplified62.0%
if -2.50000000000000011e244 < a < -4.8000000000000003e154 or -2.35000000000000003e117 < a < -3.2e11 or 8.00000000000000005e160 < a Initial program 90.8%
associate-+l+90.8%
*-un-lft-identity90.8%
fma-def90.8%
*-commutative90.8%
fma-def90.9%
*-commutative90.9%
Applied egg-rr90.9%
Taylor expanded in t around inf 62.5%
if -4.8000000000000003e154 < a < -2.35000000000000003e117Initial program 88.7%
associate-+l+88.7%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in z around inf 78.6%
Taylor expanded in y around 0 67.7%
if -3.2e11 < a < 9600Initial program 99.2%
associate-+l+99.2%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 82.6%
Final simplification72.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (+ t (* z b)))))
(if (<= a -6.4e+32)
(+ x t_1)
(if (<= a 13500.0) (+ (+ x (* y z)) (* a t)) (+ t_1 (* y z))))))
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 <= -6.4e+32) {
tmp = x + t_1;
} else if (a <= 13500.0) {
tmp = (x + (y * z)) + (a * t);
} else {
tmp = t_1 + (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 = a * (t + (z * b))
if (a <= (-6.4d+32)) then
tmp = x + t_1
else if (a <= 13500.0d0) then
tmp = (x + (y * z)) + (a * t)
else
tmp = t_1 + (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 = a * (t + (z * b));
double tmp;
if (a <= -6.4e+32) {
tmp = x + t_1;
} else if (a <= 13500.0) {
tmp = (x + (y * z)) + (a * t);
} else {
tmp = t_1 + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = a * (t + (z * b)) tmp = 0 if a <= -6.4e+32: tmp = x + t_1 elif a <= 13500.0: tmp = (x + (y * z)) + (a * t) else: tmp = t_1 + (y * z) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(t + Float64(z * b))) tmp = 0.0 if (a <= -6.4e+32) tmp = Float64(x + t_1); elseif (a <= 13500.0) tmp = Float64(Float64(x + Float64(y * z)) + Float64(a * t)); else tmp = Float64(t_1 + Float64(y * z)); 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 <= -6.4e+32) tmp = x + t_1; elseif (a <= 13500.0) tmp = (x + (y * z)) + (a * t); else tmp = t_1 + (y * z); 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, -6.4e+32], N[(x + t$95$1), $MachinePrecision], If[LessEqual[a, 13500.0], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision], N[(t$95$1 + N[(y * z), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(t + z \cdot b\right)\\
\mathbf{if}\;a \leq -6.4 \cdot 10^{+32}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;a \leq 13500:\\
\;\;\;\;\left(x + y \cdot z\right) + a \cdot t\\
\mathbf{else}:\\
\;\;\;\;t_1 + y \cdot z\\
\end{array}
\end{array}
if a < -6.3999999999999998e32Initial program 90.9%
associate-+l+90.9%
+-commutative90.9%
fma-def90.9%
*-commutative90.9%
associate-*l*94.4%
*-commutative94.4%
distribute-lft-out98.1%
remove-double-neg98.1%
*-commutative98.1%
distribute-lft-neg-out98.1%
sub-neg98.1%
sub-neg98.1%
distribute-lft-neg-in98.1%
remove-double-neg98.1%
Simplified98.1%
Taylor expanded in y around 0 93.1%
if -6.3999999999999998e32 < a < 13500Initial program 99.2%
associate-+l+99.2%
associate-*l*95.7%
Simplified95.7%
Taylor expanded in t around inf 91.5%
if 13500 < a Initial program 83.7%
associate-+l+83.7%
+-commutative83.7%
fma-def83.7%
*-commutative83.7%
associate-*l*93.9%
*-commutative93.9%
distribute-lft-out98.4%
remove-double-neg98.4%
*-commutative98.4%
distribute-lft-neg-out98.4%
sub-neg98.4%
sub-neg98.4%
distribute-lft-neg-in98.4%
remove-double-neg98.4%
Simplified98.4%
Taylor expanded in x around 0 92.6%
Final simplification92.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -4.2e-58) (not (<= a 8.4e-70))) (+ x (* a (+ t (* z b)))) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.2e-58) || !(a <= 8.4e-70)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((a <= (-4.2d-58)) .or. (.not. (a <= 8.4d-70))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + (y * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -4.2e-58) || !(a <= 8.4e-70)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -4.2e-58) or not (a <= 8.4e-70): tmp = x + (a * (t + (z * b))) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -4.2e-58) || !(a <= 8.4e-70)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(y * z)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -4.2e-58) || ~((a <= 8.4e-70))) tmp = x + (a * (t + (z * b))); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -4.2e-58], N[Not[LessEqual[a, 8.4e-70]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.2 \cdot 10^{-58} \lor \neg \left(a \leq 8.4 \cdot 10^{-70}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -4.19999999999999975e-58 or 8.4000000000000004e-70 < a Initial program 89.5%
associate-+l+89.5%
+-commutative89.5%
fma-def89.6%
*-commutative89.6%
associate-*l*95.3%
*-commutative95.3%
distribute-lft-out98.6%
remove-double-neg98.6%
*-commutative98.6%
distribute-lft-neg-out98.6%
sub-neg98.6%
sub-neg98.6%
distribute-lft-neg-in98.6%
remove-double-neg98.6%
Simplified98.6%
Taylor expanded in y around 0 88.5%
if -4.19999999999999975e-58 < a < 8.4000000000000004e-70Initial program 99.0%
associate-+l+99.0%
associate-*l*94.4%
Simplified94.4%
Taylor expanded in a around 0 86.3%
Final simplification87.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1e+32) (not (<= a 3.8e-6))) (+ x (* a (+ t (* z b)))) (+ (+ x (* y z)) (* a t))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1e+32) || !(a <= 3.8e-6)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (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 <= (-1d+32)) .or. (.not. (a <= 3.8d-6))) then
tmp = x + (a * (t + (z * b)))
else
tmp = (x + (y * z)) + (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 <= -1e+32) || !(a <= 3.8e-6)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = (x + (y * z)) + (a * t);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1e+32) or not (a <= 3.8e-6): tmp = x + (a * (t + (z * b))) else: tmp = (x + (y * z)) + (a * t) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1e+32) || !(a <= 3.8e-6)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(Float64(x + Float64(y * z)) + Float64(a * t)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1e+32) || ~((a <= 3.8e-6))) tmp = x + (a * (t + (z * b))); else tmp = (x + (y * z)) + (a * t); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1e+32], N[Not[LessEqual[a, 3.8e-6]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(a * t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1 \cdot 10^{+32} \lor \neg \left(a \leq 3.8 \cdot 10^{-6}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y \cdot z\right) + a \cdot t\\
\end{array}
\end{array}
if a < -1.00000000000000005e32 or 3.8e-6 < a Initial program 87.2%
associate-+l+87.2%
+-commutative87.2%
fma-def87.2%
*-commutative87.2%
associate-*l*94.2%
*-commutative94.2%
distribute-lft-out98.3%
remove-double-neg98.3%
*-commutative98.3%
distribute-lft-neg-out98.3%
sub-neg98.3%
sub-neg98.3%
distribute-lft-neg-in98.3%
remove-double-neg98.3%
Simplified98.3%
Taylor expanded in y around 0 93.0%
if -1.00000000000000005e32 < a < 3.8e-6Initial program 99.2%
associate-+l+99.2%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in t around inf 91.4%
Final simplification92.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a t))))
(if (<= a -5000000000.0)
t_1
(if (<= a 9600.0) (+ x (* y z)) (if (<= a 2e+161) (* a (* z b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (a <= -5000000000.0) {
tmp = t_1;
} else if (a <= 9600.0) {
tmp = x + (y * z);
} else if (a <= 2e+161) {
tmp = a * (z * b);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = x + (a * t)
if (a <= (-5000000000.0d0)) then
tmp = t_1
else if (a <= 9600.0d0) then
tmp = x + (y * z)
else if (a <= 2d+161) then
tmp = a * (z * b)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * t);
double tmp;
if (a <= -5000000000.0) {
tmp = t_1;
} else if (a <= 9600.0) {
tmp = x + (y * z);
} else if (a <= 2e+161) {
tmp = a * (z * b);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (a * t) tmp = 0 if a <= -5000000000.0: tmp = t_1 elif a <= 9600.0: tmp = x + (y * z) elif a <= 2e+161: tmp = a * (z * b) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * t)) tmp = 0.0 if (a <= -5000000000.0) tmp = t_1; elseif (a <= 9600.0) tmp = Float64(x + Float64(y * z)); elseif (a <= 2e+161) tmp = Float64(a * Float64(z * b)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (a * t); tmp = 0.0; if (a <= -5000000000.0) tmp = t_1; elseif (a <= 9600.0) tmp = x + (y * z); elseif (a <= 2e+161) tmp = a * (z * b); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -5000000000.0], t$95$1, If[LessEqual[a, 9600.0], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 2e+161], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + a \cdot t\\
\mathbf{if}\;a \leq -5000000000:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 9600:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;a \leq 2 \cdot 10^{+161}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -5e9 or 2.0000000000000001e161 < a Initial program 89.6%
associate-+l+89.6%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in z around 0 64.3%
+-commutative64.3%
Simplified64.3%
if -5e9 < a < 9600Initial program 99.2%
associate-+l+99.2%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 82.6%
if 9600 < a < 2.0000000000000001e161Initial program 82.2%
associate-+l+82.2%
*-un-lft-identity82.2%
fma-def82.2%
*-commutative82.2%
fma-def82.2%
*-commutative82.2%
Applied egg-rr82.2%
fma-udef82.2%
*-un-lft-identity82.2%
+-commutative82.2%
Applied egg-rr82.2%
Taylor expanded in b around inf 58.4%
*-commutative58.4%
Simplified58.4%
Final simplification72.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -550000000000.0) (not (<= a 122.0))) (* 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 <= -550000000000.0) || !(a <= 122.0)) {
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 <= (-550000000000.0d0)) .or. (.not. (a <= 122.0d0))) 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 <= -550000000000.0) || !(a <= 122.0)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -550000000000.0) or not (a <= 122.0): 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 <= -550000000000.0) || !(a <= 122.0)) 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 <= -550000000000.0) || ~((a <= 122.0))) 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, -550000000000.0], N[Not[LessEqual[a, 122.0]], $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 -550000000000 \lor \neg \left(a \leq 122\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -5.5e11 or 122 < a Initial program 87.7%
associate-+l+87.7%
*-un-lft-identity87.7%
fma-def87.7%
*-commutative87.7%
fma-def87.7%
*-commutative87.7%
Applied egg-rr87.7%
Taylor expanded in a around inf 82.9%
if -5.5e11 < a < 122Initial program 99.2%
associate-+l+99.2%
associate-*l*95.4%
Simplified95.4%
Taylor expanded in a around 0 82.6%
Final simplification82.8%
(FPCore (x y z t a b) :precision binary64 (if (<= a -2050000000.0) (* a t) (if (<= a 2.8e-223) x (if (<= a 1.45e+79) (* y z) (* a t)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -2050000000.0) {
tmp = a * t;
} else if (a <= 2.8e-223) {
tmp = x;
} else if (a <= 1.45e+79) {
tmp = y * z;
} 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 (a <= (-2050000000.0d0)) then
tmp = a * t
else if (a <= 2.8d-223) then
tmp = x
else if (a <= 1.45d+79) then
tmp = y * z
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 (a <= -2050000000.0) {
tmp = a * t;
} else if (a <= 2.8e-223) {
tmp = x;
} else if (a <= 1.45e+79) {
tmp = y * z;
} else {
tmp = a * t;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -2050000000.0: tmp = a * t elif a <= 2.8e-223: tmp = x elif a <= 1.45e+79: tmp = y * z else: tmp = a * t return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -2050000000.0) tmp = Float64(a * t); elseif (a <= 2.8e-223) tmp = x; elseif (a <= 1.45e+79) tmp = Float64(y * z); else tmp = Float64(a * t); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -2050000000.0) tmp = a * t; elseif (a <= 2.8e-223) tmp = x; elseif (a <= 1.45e+79) tmp = y * z; else tmp = a * t; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -2050000000.0], N[(a * t), $MachinePrecision], If[LessEqual[a, 2.8e-223], x, If[LessEqual[a, 1.45e+79], N[(y * z), $MachinePrecision], N[(a * t), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -2050000000:\\
\;\;\;\;a \cdot t\\
\mathbf{elif}\;a \leq 2.8 \cdot 10^{-223}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 1.45 \cdot 10^{+79}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;a \cdot t\\
\end{array}
\end{array}
if a < -2.05e9 or 1.44999999999999996e79 < a Initial program 86.3%
associate-+l+86.3%
*-un-lft-identity86.3%
fma-def86.3%
*-commutative86.3%
fma-def86.3%
*-commutative86.3%
Applied egg-rr86.3%
Taylor expanded in t around inf 51.7%
if -2.05e9 < a < 2.80000000000000015e-223Initial program 98.7%
associate-+l+98.7%
associate-*l*96.4%
Simplified96.4%
Taylor expanded in x around inf 56.8%
if 2.80000000000000015e-223 < a < 1.44999999999999996e79Initial program 100.0%
associate-+l+100.0%
associate-*l*95.1%
Simplified95.1%
Taylor expanded in y around inf 45.9%
*-commutative45.9%
Simplified45.9%
Final simplification52.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -1060000000.0) (not (<= a 5.6e+53))) (* a t) x))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((a <= -1060000000.0) || !(a <= 5.6e+53)) {
tmp = a * t;
} 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 <= (-1060000000.0d0)) .or. (.not. (a <= 5.6d+53))) then
tmp = a * t
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 <= -1060000000.0) || !(a <= 5.6e+53)) {
tmp = a * t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -1060000000.0) or not (a <= 5.6e+53): tmp = a * t else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((a <= -1060000000.0) || !(a <= 5.6e+53)) tmp = Float64(a * t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((a <= -1060000000.0) || ~((a <= 5.6e+53))) tmp = a * t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[a, -1060000000.0], N[Not[LessEqual[a, 5.6e+53]], $MachinePrecision]], N[(a * t), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1060000000 \lor \neg \left(a \leq 5.6 \cdot 10^{+53}\right):\\
\;\;\;\;a \cdot t\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < -1.06e9 or 5.6e53 < a Initial program 86.9%
associate-+l+86.9%
*-un-lft-identity86.9%
fma-def86.9%
*-commutative86.9%
fma-def87.0%
*-commutative87.0%
Applied egg-rr87.0%
Taylor expanded in t around inf 50.2%
if -1.06e9 < a < 5.6e53Initial program 99.2%
associate-+l+99.2%
associate-*l*95.6%
Simplified95.6%
Taylor expanded in x around inf 43.5%
Final simplification46.6%
(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%
associate-+l+93.5%
associate-*l*94.9%
Simplified94.9%
Taylor expanded in x around inf 28.2%
Final simplification28.2%
(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 2023322
(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)))