
(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 (<= (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)) INFINITY) (+ (fma y z x) (* a (+ t (* z b)))) (* z (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((((x + (y * z)) + (t * a)) + ((z * a) * b)) <= ((double) INFINITY)) {
tmp = fma(y, z, x) + (a * (t + (z * b)));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) <= Inf) tmp = Float64(fma(y, z, x) + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(y * z + x), $MachinePrecision] + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(y, z, x\right) + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 97.5%
associate-+l+97.5%
+-commutative97.5%
fma-def97.5%
associate-*l*97.6%
*-commutative97.6%
*-commutative97.6%
distribute-rgt-out97.6%
*-commutative97.6%
Simplified97.6%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*11.1%
Simplified11.1%
Taylor expanded in z around inf 100.0%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t a))) (t_2 (* z (+ y (* a b)))))
(if (<= z -28.0)
t_2
(if (<= z -2.4e-12)
t_1
(if (<= z -1.55e-75)
t_2
(if (<= z 4.4e-132)
t_1
(if (<= z 1.05e-61)
t_2
(if (<= z 3e-45)
t_1
(if (<= z 4.8)
(+ x (* (* z a) b))
(if (<= z 9.5e+50) (* a (+ t (* z b))) t_2))))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -28.0) {
tmp = t_2;
} else if (z <= -2.4e-12) {
tmp = t_1;
} else if (z <= -1.55e-75) {
tmp = t_2;
} else if (z <= 4.4e-132) {
tmp = t_1;
} else if (z <= 1.05e-61) {
tmp = t_2;
} else if (z <= 3e-45) {
tmp = t_1;
} else if (z <= 4.8) {
tmp = x + ((z * a) * b);
} else if (z <= 9.5e+50) {
tmp = a * (t + (z * b));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = x + (t * a)
t_2 = z * (y + (a * b))
if (z <= (-28.0d0)) then
tmp = t_2
else if (z <= (-2.4d-12)) then
tmp = t_1
else if (z <= (-1.55d-75)) then
tmp = t_2
else if (z <= 4.4d-132) then
tmp = t_1
else if (z <= 1.05d-61) then
tmp = t_2
else if (z <= 3d-45) then
tmp = t_1
else if (z <= 4.8d0) then
tmp = x + ((z * a) * b)
else if (z <= 9.5d+50) then
tmp = a * (t + (z * b))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * a);
double t_2 = z * (y + (a * b));
double tmp;
if (z <= -28.0) {
tmp = t_2;
} else if (z <= -2.4e-12) {
tmp = t_1;
} else if (z <= -1.55e-75) {
tmp = t_2;
} else if (z <= 4.4e-132) {
tmp = t_1;
} else if (z <= 1.05e-61) {
tmp = t_2;
} else if (z <= 3e-45) {
tmp = t_1;
} else if (z <= 4.8) {
tmp = x + ((z * a) * b);
} else if (z <= 9.5e+50) {
tmp = a * (t + (z * b));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * a) t_2 = z * (y + (a * b)) tmp = 0 if z <= -28.0: tmp = t_2 elif z <= -2.4e-12: tmp = t_1 elif z <= -1.55e-75: tmp = t_2 elif z <= 4.4e-132: tmp = t_1 elif z <= 1.05e-61: tmp = t_2 elif z <= 3e-45: tmp = t_1 elif z <= 4.8: tmp = x + ((z * a) * b) elif z <= 9.5e+50: tmp = a * (t + (z * b)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * a)) t_2 = Float64(z * Float64(y + Float64(a * b))) tmp = 0.0 if (z <= -28.0) tmp = t_2; elseif (z <= -2.4e-12) tmp = t_1; elseif (z <= -1.55e-75) tmp = t_2; elseif (z <= 4.4e-132) tmp = t_1; elseif (z <= 1.05e-61) tmp = t_2; elseif (z <= 3e-45) tmp = t_1; elseif (z <= 4.8) tmp = Float64(x + Float64(Float64(z * a) * b)); elseif (z <= 9.5e+50) tmp = Float64(a * Float64(t + Float64(z * b))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * a); t_2 = z * (y + (a * b)); tmp = 0.0; if (z <= -28.0) tmp = t_2; elseif (z <= -2.4e-12) tmp = t_1; elseif (z <= -1.55e-75) tmp = t_2; elseif (z <= 4.4e-132) tmp = t_1; elseif (z <= 1.05e-61) tmp = t_2; elseif (z <= 3e-45) tmp = t_1; elseif (z <= 4.8) tmp = x + ((z * a) * b); elseif (z <= 9.5e+50) tmp = a * (t + (z * b)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -28.0], t$95$2, If[LessEqual[z, -2.4e-12], t$95$1, If[LessEqual[z, -1.55e-75], t$95$2, If[LessEqual[z, 4.4e-132], t$95$1, If[LessEqual[z, 1.05e-61], t$95$2, If[LessEqual[z, 3e-45], t$95$1, If[LessEqual[z, 4.8], N[(x + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.5e+50], N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot a\\
t_2 := z \cdot \left(y + a \cdot b\right)\\
\mathbf{if}\;z \leq -28:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq -2.4 \cdot 10^{-12}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq -1.55 \cdot 10^{-75}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-132}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 1.05 \cdot 10^{-61}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3 \cdot 10^{-45}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;z \leq 4.8:\\
\;\;\;\;x + \left(z \cdot a\right) \cdot b\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+50}:\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -28 or -2.39999999999999987e-12 < z < -1.55000000000000003e-75 or 4.39999999999999981e-132 < z < 1.05e-61 or 9.4999999999999993e50 < z Initial program 83.8%
associate-+l+83.8%
associate-*l*85.2%
Simplified85.2%
Taylor expanded in z around inf 85.3%
if -28 < z < -2.39999999999999987e-12 or -1.55000000000000003e-75 < z < 4.39999999999999981e-132 or 1.05e-61 < z < 3.00000000000000011e-45Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 91.4%
+-commutative91.4%
Simplified91.4%
if 3.00000000000000011e-45 < z < 4.79999999999999982Initial program 99.8%
associate-+l+99.8%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around 0 100.0%
+-commutative100.0%
+-commutative100.0%
associate-*r*93.0%
distribute-rgt-in93.0%
Simplified93.0%
Taylor expanded in y around 0 85.4%
Taylor expanded in z around 0 92.4%
*-commutative92.4%
associate-*l*92.2%
Simplified92.2%
if 4.79999999999999982 < z < 9.4999999999999993e50Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in a around inf 100.0%
Final simplification88.2%
(FPCore (x y z t a b)
:precision binary64
(if (or (<= z -42.0)
(not
(or (<= z -3.6e-12)
(and (not (<= z -1.65e-74))
(or (<= z 4.4e-132)
(and (not (<= z 2.15e-61)) (<= z 1.5e+61)))))))
(* z (+ y (* a b)))
(+ x (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -42.0) || !((z <= -3.6e-12) || (!(z <= -1.65e-74) && ((z <= 4.4e-132) || (!(z <= 2.15e-61) && (z <= 1.5e+61)))))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-42.0d0)) .or. (.not. (z <= (-3.6d-12)) .or. (.not. (z <= (-1.65d-74))) .and. (z <= 4.4d-132) .or. (.not. (z <= 2.15d-61)) .and. (z <= 1.5d+61))) then
tmp = z * (y + (a * b))
else
tmp = x + (t * a)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -42.0) || !((z <= -3.6e-12) || (!(z <= -1.65e-74) && ((z <= 4.4e-132) || (!(z <= 2.15e-61) && (z <= 1.5e+61)))))) {
tmp = z * (y + (a * b));
} else {
tmp = x + (t * a);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -42.0) or not ((z <= -3.6e-12) or (not (z <= -1.65e-74) and ((z <= 4.4e-132) or (not (z <= 2.15e-61) and (z <= 1.5e+61))))): tmp = z * (y + (a * b)) else: tmp = x + (t * a) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -42.0) || !((z <= -3.6e-12) || (!(z <= -1.65e-74) && ((z <= 4.4e-132) || (!(z <= 2.15e-61) && (z <= 1.5e+61)))))) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(t * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -42.0) || ~(((z <= -3.6e-12) || (~((z <= -1.65e-74)) && ((z <= 4.4e-132) || (~((z <= 2.15e-61)) && (z <= 1.5e+61))))))) tmp = z * (y + (a * b)); else tmp = x + (t * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -42.0], N[Not[Or[LessEqual[z, -3.6e-12], And[N[Not[LessEqual[z, -1.65e-74]], $MachinePrecision], Or[LessEqual[z, 4.4e-132], And[N[Not[LessEqual[z, 2.15e-61]], $MachinePrecision], LessEqual[z, 1.5e+61]]]]]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -42 \lor \neg \left(z \leq -3.6 \cdot 10^{-12} \lor \neg \left(z \leq -1.65 \cdot 10^{-74}\right) \land \left(z \leq 4.4 \cdot 10^{-132} \lor \neg \left(z \leq 2.15 \cdot 10^{-61}\right) \land z \leq 1.5 \cdot 10^{+61}\right)\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot a\\
\end{array}
\end{array}
if z < -42 or -3.6e-12 < z < -1.64999999999999998e-74 or 4.39999999999999981e-132 < z < 2.1500000000000002e-61 or 1.5e61 < z Initial program 84.2%
associate-+l+84.2%
associate-*l*85.0%
Simplified85.0%
Taylor expanded in z around inf 85.8%
if -42 < z < -3.6e-12 or -1.64999999999999998e-74 < z < 4.39999999999999981e-132 or 2.1500000000000002e-61 < z < 1.5e61Initial program 99.1%
associate-+l+99.1%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 85.2%
+-commutative85.2%
Simplified85.2%
Final simplification85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* y z))))
(if (<= (+ (+ t_1 (* t a)) (* (* z a) b)) INFINITY)
(+ t_1 (+ (* a (* z b)) (* t a)))
(* z (+ y (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((t_1 + (t * a)) + ((z * a) * b)) <= ((double) INFINITY)) {
tmp = t_1 + ((a * (z * b)) + (t * a));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (y * z);
double tmp;
if (((t_1 + (t * a)) + ((z * a) * b)) <= Double.POSITIVE_INFINITY) {
tmp = t_1 + ((a * (z * b)) + (t * a));
} else {
tmp = z * (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (y * z) tmp = 0 if ((t_1 + (t * a)) + ((z * a) * b)) <= math.inf: tmp = t_1 + ((a * (z * b)) + (t * a)) else: tmp = z * (y + (a * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(y * z)) tmp = 0.0 if (Float64(Float64(t_1 + Float64(t * a)) + Float64(Float64(z * a) * b)) <= Inf) tmp = Float64(t_1 + Float64(Float64(a * Float64(z * b)) + Float64(t * a))); else tmp = Float64(z * Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (y * z); tmp = 0.0; if (((t_1 + (t * a)) + ((z * a) * b)) <= Inf) tmp = t_1 + ((a * (z * b)) + (t * a)); else tmp = z * (y + (a * 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[(t$95$1 + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], Infinity], N[(t$95$1 + N[(N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + y \cdot z\\
\mathbf{if}\;\left(t_1 + t \cdot a\right) + \left(z \cdot a\right) \cdot b \leq \infty:\\
\;\;\;\;t_1 + \left(a \cdot \left(z \cdot b\right) + t \cdot a\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < +inf.0Initial program 97.5%
associate-+l+97.5%
associate-*l*97.5%
Simplified97.5%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
associate-+l+0.0%
associate-*l*11.1%
Simplified11.1%
Taylor expanded in z around inf 100.0%
Final simplification97.7%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -1.96e-50)
(* y z)
(if (<= z 6.1e-264)
x
(if (<= z 1.6e-202)
(* t a)
(if (<= z 2.0) x (if (<= z 1.25e+51) (* t a) (* y z)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.96e-50) {
tmp = y * z;
} else if (z <= 6.1e-264) {
tmp = x;
} else if (z <= 1.6e-202) {
tmp = t * a;
} else if (z <= 2.0) {
tmp = x;
} else if (z <= 1.25e+51) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-1.96d-50)) then
tmp = y * z
else if (z <= 6.1d-264) then
tmp = x
else if (z <= 1.6d-202) then
tmp = t * a
else if (z <= 2.0d0) then
tmp = x
else if (z <= 1.25d+51) then
tmp = t * a
else
tmp = y * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.96e-50) {
tmp = y * z;
} else if (z <= 6.1e-264) {
tmp = x;
} else if (z <= 1.6e-202) {
tmp = t * a;
} else if (z <= 2.0) {
tmp = x;
} else if (z <= 1.25e+51) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -1.96e-50: tmp = y * z elif z <= 6.1e-264: tmp = x elif z <= 1.6e-202: tmp = t * a elif z <= 2.0: tmp = x elif z <= 1.25e+51: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.96e-50) tmp = Float64(y * z); elseif (z <= 6.1e-264) tmp = x; elseif (z <= 1.6e-202) tmp = Float64(t * a); elseif (z <= 2.0) tmp = x; elseif (z <= 1.25e+51) tmp = Float64(t * a); else tmp = Float64(y * z); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -1.96e-50) tmp = y * z; elseif (z <= 6.1e-264) tmp = x; elseif (z <= 1.6e-202) tmp = t * a; elseif (z <= 2.0) tmp = x; elseif (z <= 1.25e+51) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.96e-50], N[(y * z), $MachinePrecision], If[LessEqual[z, 6.1e-264], x, If[LessEqual[z, 1.6e-202], N[(t * a), $MachinePrecision], If[LessEqual[z, 2.0], x, If[LessEqual[z, 1.25e+51], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.96 \cdot 10^{-50}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 6.1 \cdot 10^{-264}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-202}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 2:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+51}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if z < -1.9599999999999999e-50 or 1.25e51 < z Initial program 83.8%
associate-+l+83.8%
associate-*l*84.6%
Simplified84.6%
Taylor expanded in y around inf 44.8%
*-commutative44.8%
Simplified44.8%
if -1.9599999999999999e-50 < z < 6.10000000000000025e-264 or 1.6000000000000001e-202 < z < 2Initial program 99.0%
associate-+l+99.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 50.4%
if 6.10000000000000025e-264 < z < 1.6000000000000001e-202 or 2 < z < 1.25e51Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 73.0%
Final simplification49.1%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.2e-48)
(* y z)
(if (<= z 1.5e-267)
x
(if (<= z 5.2e-200) (* t a) (if (<= z 4.4e-132) x (* a (* z b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-48) {
tmp = y * z;
} else if (z <= 1.5e-267) {
tmp = x;
} else if (z <= 5.2e-200) {
tmp = t * a;
} else if (z <= 4.4e-132) {
tmp = x;
} else {
tmp = a * (z * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.2d-48)) then
tmp = y * z
else if (z <= 1.5d-267) then
tmp = x
else if (z <= 5.2d-200) then
tmp = t * a
else if (z <= 4.4d-132) then
tmp = x
else
tmp = a * (z * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.2e-48) {
tmp = y * z;
} else if (z <= 1.5e-267) {
tmp = x;
} else if (z <= 5.2e-200) {
tmp = t * a;
} else if (z <= 4.4e-132) {
tmp = x;
} else {
tmp = a * (z * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.2e-48: tmp = y * z elif z <= 1.5e-267: tmp = x elif z <= 5.2e-200: tmp = t * a elif z <= 4.4e-132: tmp = x else: tmp = a * (z * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.2e-48) tmp = Float64(y * z); elseif (z <= 1.5e-267) tmp = x; elseif (z <= 5.2e-200) tmp = Float64(t * a); elseif (z <= 4.4e-132) tmp = x; else tmp = Float64(a * Float64(z * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.2e-48) tmp = y * z; elseif (z <= 1.5e-267) tmp = x; elseif (z <= 5.2e-200) tmp = t * a; elseif (z <= 4.4e-132) tmp = x; else tmp = a * (z * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.2e-48], N[(y * z), $MachinePrecision], If[LessEqual[z, 1.5e-267], x, If[LessEqual[z, 5.2e-200], N[(t * a), $MachinePrecision], If[LessEqual[z, 4.4e-132], x, N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.2 \cdot 10^{-48}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 1.5 \cdot 10^{-267}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-200}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{-132}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if z < -4.19999999999999977e-48Initial program 86.6%
associate-+l+86.6%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in y around inf 50.6%
*-commutative50.6%
Simplified50.6%
if -4.19999999999999977e-48 < z < 1.5e-267 or 5.19999999999999979e-200 < z < 4.39999999999999981e-132Initial program 100.0%
associate-+l+100.0%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 54.4%
if 1.5e-267 < z < 5.19999999999999979e-200Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 71.3%
if 4.39999999999999981e-132 < z Initial program 86.1%
associate-+l+86.1%
associate-*l*89.6%
Simplified89.6%
Taylor expanded in a around inf 62.2%
Taylor expanded in t around 0 47.6%
Final simplification51.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -5.1e-54)
(* y z)
(if (<= z 2.6e-264)
x
(if (<= z 4.5e-201) (* t a) (if (<= z 7.4e-10) x (* z (* a b)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.1e-54) {
tmp = y * z;
} else if (z <= 2.6e-264) {
tmp = x;
} else if (z <= 4.5e-201) {
tmp = t * a;
} else if (z <= 7.4e-10) {
tmp = x;
} else {
tmp = z * (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.1d-54)) then
tmp = y * z
else if (z <= 2.6d-264) then
tmp = x
else if (z <= 4.5d-201) then
tmp = t * a
else if (z <= 7.4d-10) then
tmp = x
else
tmp = z * (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.1e-54) {
tmp = y * z;
} else if (z <= 2.6e-264) {
tmp = x;
} else if (z <= 4.5e-201) {
tmp = t * a;
} else if (z <= 7.4e-10) {
tmp = x;
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.1e-54: tmp = y * z elif z <= 2.6e-264: tmp = x elif z <= 4.5e-201: tmp = t * a elif z <= 7.4e-10: tmp = x else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.1e-54) tmp = Float64(y * z); elseif (z <= 2.6e-264) tmp = x; elseif (z <= 4.5e-201) tmp = Float64(t * a); elseif (z <= 7.4e-10) tmp = x; else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.1e-54) tmp = y * z; elseif (z <= 2.6e-264) tmp = x; elseif (z <= 4.5e-201) tmp = t * a; elseif (z <= 7.4e-10) tmp = x; else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.1e-54], N[(y * z), $MachinePrecision], If[LessEqual[z, 2.6e-264], x, If[LessEqual[z, 4.5e-201], N[(t * a), $MachinePrecision], If[LessEqual[z, 7.4e-10], x, N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.1 \cdot 10^{-54}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;z \leq 2.6 \cdot 10^{-264}:\\
\;\;\;\;x\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{-201}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;z \leq 7.4 \cdot 10^{-10}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -5.1000000000000001e-54Initial program 86.6%
associate-+l+86.6%
associate-*l*85.6%
Simplified85.6%
Taylor expanded in y around inf 50.6%
*-commutative50.6%
Simplified50.6%
if -5.1000000000000001e-54 < z < 2.6000000000000002e-264 or 4.5000000000000002e-201 < z < 7.4000000000000003e-10Initial program 98.9%
associate-+l+98.9%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in x around inf 50.4%
if 2.6000000000000002e-264 < z < 4.5000000000000002e-201Initial program 100.0%
associate-+l+100.0%
associate-*l*100.0%
Simplified100.0%
Taylor expanded in t around inf 71.3%
if 7.4000000000000003e-10 < z Initial program 82.3%
associate-+l+82.3%
associate-*l*85.5%
Simplified85.5%
Taylor expanded in z around inf 78.4%
Taylor expanded in y around 0 54.1%
Final simplification52.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.4e+16) (not (<= z 5.2e+76))) (* z (+ y (* a b))) (+ x (* a (+ t (* z b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.4e+16) || !(z <= 5.2e+76)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-7.4d+16)) .or. (.not. (z <= 5.2d+76))) then
tmp = z * (y + (a * b))
else
tmp = x + (a * (t + (z * b)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.4e+16) || !(z <= 5.2e+76)) {
tmp = z * (y + (a * b));
} else {
tmp = x + (a * (t + (z * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.4e+16) or not (z <= 5.2e+76): tmp = z * (y + (a * b)) else: tmp = x + (a * (t + (z * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.4e+16) || !(z <= 5.2e+76)) tmp = Float64(z * Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.4e+16) || ~((z <= 5.2e+76))) tmp = z * (y + (a * b)); else tmp = x + (a * (t + (z * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.4e+16], N[Not[LessEqual[z, 5.2e+76]], $MachinePrecision]], N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.4 \cdot 10^{+16} \lor \neg \left(z \leq 5.2 \cdot 10^{+76}\right):\\
\;\;\;\;z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\end{array}
\end{array}
if z < -7.4e16 or 5.1999999999999999e76 < z Initial program 81.4%
associate-+l+81.4%
associate-*l*81.6%
Simplified81.6%
Taylor expanded in z around inf 88.1%
if -7.4e16 < z < 5.1999999999999999e76Initial program 98.6%
associate-+l+98.6%
+-commutative98.6%
fma-def98.6%
associate-*l*99.9%
*-commutative99.9%
*-commutative99.9%
distribute-rgt-out99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 88.6%
Final simplification88.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -2.6e+23) (not (<= b 4.4e+42))) (+ x (* a (+ t (* z b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.6e+23) || !(b <= 4.4e+42)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-2.6d+23)) .or. (.not. (b <= 4.4d+42))) then
tmp = x + (a * (t + (z * b)))
else
tmp = x + ((t * a) + (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -2.6e+23) || !(b <= 4.4e+42)) {
tmp = x + (a * (t + (z * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -2.6e+23) or not (b <= 4.4e+42): tmp = x + (a * (t + (z * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -2.6e+23) || !(b <= 4.4e+42)) tmp = Float64(x + Float64(a * Float64(t + Float64(z * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -2.6e+23) || ~((b <= 4.4e+42))) tmp = x + (a * (t + (z * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -2.6e+23], N[Not[LessEqual[b, 4.4e+42]], $MachinePrecision]], N[(x + N[(a * N[(t + N[(z * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.6 \cdot 10^{+23} \lor \neg \left(b \leq 4.4 \cdot 10^{+42}\right):\\
\;\;\;\;x + a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if b < -2.59999999999999992e23 or 4.4000000000000003e42 < b Initial program 88.6%
associate-+l+88.6%
+-commutative88.6%
fma-def88.6%
associate-*l*84.4%
*-commutative84.4%
*-commutative84.4%
distribute-rgt-out90.5%
*-commutative90.5%
Simplified90.5%
Taylor expanded in y around 0 84.6%
if -2.59999999999999992e23 < b < 4.4000000000000003e42Initial program 92.4%
associate-+l+92.4%
associate-*l*97.2%
Simplified97.2%
Taylor expanded in b around 0 93.5%
Final simplification89.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.4e-37) (not (<= b 1.75e+40))) (+ x (* z (+ y (* a b)))) (+ x (+ (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.4e-37) || !(b <= 1.75e+40)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((b <= (-6.4d-37)) .or. (.not. (b <= 1.75d+40))) then
tmp = x + (z * (y + (a * b)))
else
tmp = x + ((t * a) + (y * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.4e-37) || !(b <= 1.75e+40)) {
tmp = x + (z * (y + (a * b)));
} else {
tmp = x + ((t * a) + (y * z));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.4e-37) or not (b <= 1.75e+40): tmp = x + (z * (y + (a * b))) else: tmp = x + ((t * a) + (y * z)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.4e-37) || !(b <= 1.75e+40)) tmp = Float64(x + Float64(z * Float64(y + Float64(a * b)))); else tmp = Float64(x + Float64(Float64(t * a) + Float64(y * z))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -6.4e-37) || ~((b <= 1.75e+40))) tmp = x + (z * (y + (a * b))); else tmp = x + ((t * a) + (y * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -6.4e-37], N[Not[LessEqual[b, 1.75e+40]], $MachinePrecision]], N[(x + N[(z * N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t * a), $MachinePrecision] + N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.4 \cdot 10^{-37} \lor \neg \left(b \leq 1.75 \cdot 10^{+40}\right):\\
\;\;\;\;x + z \cdot \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t \cdot a + y \cdot z\right)\\
\end{array}
\end{array}
if b < -6.3999999999999998e-37 or 1.75e40 < b Initial program 88.9%
associate-+l+88.9%
associate-*l*85.1%
Simplified85.1%
Taylor expanded in t around 0 82.6%
+-commutative82.6%
+-commutative82.6%
associate-*r*85.6%
distribute-rgt-in90.3%
Simplified90.3%
if -6.3999999999999998e-37 < b < 1.75e40Initial program 92.4%
associate-+l+92.4%
associate-*l*97.7%
Simplified97.7%
Taylor expanded in b around 0 93.6%
Final simplification92.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= a -2e-28) (not (<= a 2.9e-13))) (* 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 <= -2e-28) || !(a <= 2.9e-13)) {
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 <= (-2d-28)) .or. (.not. (a <= 2.9d-13))) 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 <= -2e-28) || !(a <= 2.9e-13)) {
tmp = a * (t + (z * b));
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (a <= -2e-28) or not (a <= 2.9e-13): 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 <= -2e-28) || !(a <= 2.9e-13)) 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 <= -2e-28) || ~((a <= 2.9e-13))) 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, -2e-28], N[Not[LessEqual[a, 2.9e-13]], $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 -2 \cdot 10^{-28} \lor \neg \left(a \leq 2.9 \cdot 10^{-13}\right):\\
\;\;\;\;a \cdot \left(t + z \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if a < -1.99999999999999994e-28 or 2.8999999999999998e-13 < a Initial program 83.3%
associate-+l+83.3%
associate-*l*88.5%
Simplified88.5%
Taylor expanded in a around inf 77.5%
if -1.99999999999999994e-28 < a < 2.8999999999999998e-13Initial program 98.4%
associate-+l+98.4%
associate-*l*94.6%
Simplified94.6%
Taylor expanded in a around 0 77.7%
Final simplification77.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5e+116) (not (<= b 8.4e+143))) (* z (* a b)) (+ x (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5e+116) || !(b <= 8.4e+143)) {
tmp = z * (a * 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 ((b <= (-5d+116)) .or. (.not. (b <= 8.4d+143))) then
tmp = z * (a * 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 ((b <= -5e+116) || !(b <= 8.4e+143)) {
tmp = z * (a * b);
} else {
tmp = x + (y * z);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5e+116) or not (b <= 8.4e+143): tmp = z * (a * b) else: tmp = x + (y * z) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5e+116) || !(b <= 8.4e+143)) tmp = Float64(z * Float64(a * 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 ((b <= -5e+116) || ~((b <= 8.4e+143))) tmp = z * (a * b); else tmp = x + (y * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -5e+116], N[Not[LessEqual[b, 8.4e+143]], $MachinePrecision]], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5 \cdot 10^{+116} \lor \neg \left(b \leq 8.4 \cdot 10^{+143}\right):\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot z\\
\end{array}
\end{array}
if b < -5.00000000000000025e116 or 8.39999999999999951e143 < b Initial program 84.4%
associate-+l+84.4%
associate-*l*78.5%
Simplified78.5%
Taylor expanded in z around inf 77.0%
Taylor expanded in y around 0 73.9%
if -5.00000000000000025e116 < b < 8.39999999999999951e143Initial program 92.8%
associate-+l+92.8%
associate-*l*95.8%
Simplified95.8%
Taylor expanded in a around 0 63.0%
Final simplification65.7%
(FPCore (x y z t a b) :precision binary64 (if (<= z -5.4e-96) (+ x (* y z)) (if (<= z 1.75e+77) (+ x (* t a)) (* z (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.4e-96) {
tmp = x + (y * z);
} else if (z <= 1.75e+77) {
tmp = x + (t * a);
} else {
tmp = z * (a * b);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-5.4d-96)) then
tmp = x + (y * z)
else if (z <= 1.75d+77) then
tmp = x + (t * a)
else
tmp = z * (a * b)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -5.4e-96) {
tmp = x + (y * z);
} else if (z <= 1.75e+77) {
tmp = x + (t * a);
} else {
tmp = z * (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -5.4e-96: tmp = x + (y * z) elif z <= 1.75e+77: tmp = x + (t * a) else: tmp = z * (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -5.4e-96) tmp = Float64(x + Float64(y * z)); elseif (z <= 1.75e+77) tmp = Float64(x + Float64(t * a)); else tmp = Float64(z * Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -5.4e-96) tmp = x + (y * z); elseif (z <= 1.75e+77) tmp = x + (t * a); else tmp = z * (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -5.4e-96], N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+77], N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-96}:\\
\;\;\;\;x + y \cdot z\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+77}:\\
\;\;\;\;x + t \cdot a\\
\mathbf{else}:\\
\;\;\;\;z \cdot \left(a \cdot b\right)\\
\end{array}
\end{array}
if z < -5.3999999999999999e-96Initial program 87.3%
associate-+l+87.3%
associate-*l*86.4%
Simplified86.4%
Taylor expanded in a around 0 63.1%
if -5.3999999999999999e-96 < z < 1.7500000000000001e77Initial program 98.3%
associate-+l+98.3%
associate-*l*99.9%
Simplified99.9%
Taylor expanded in z around 0 79.3%
+-commutative79.3%
Simplified79.3%
if 1.7500000000000001e77 < z Initial program 79.8%
associate-+l+79.8%
associate-*l*82.0%
Simplified82.0%
Taylor expanded in z around inf 86.7%
Taylor expanded in y around 0 58.6%
Final simplification69.3%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7e-8) x (if (<= x 1.78e+37) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7e-8) {
tmp = x;
} else if (x <= 1.78e+37) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (x <= (-7d-8)) then
tmp = x
else if (x <= 1.78d+37) then
tmp = t * a
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7e-8) {
tmp = x;
} else if (x <= 1.78e+37) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7e-8: tmp = x elif x <= 1.78e+37: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7e-8) tmp = x; elseif (x <= 1.78e+37) tmp = Float64(t * a); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -7e-8) tmp = x; elseif (x <= 1.78e+37) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7e-8], x, If[LessEqual[x, 1.78e+37], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{-8}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.78 \cdot 10^{+37}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7.00000000000000048e-8 or 1.78e37 < x Initial program 90.9%
associate-+l+90.9%
associate-*l*91.0%
Simplified91.0%
Taylor expanded in x around inf 46.9%
if -7.00000000000000048e-8 < x < 1.78e37Initial program 90.5%
associate-+l+90.5%
associate-*l*91.9%
Simplified91.9%
Taylor expanded in t around inf 33.0%
Final simplification39.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 90.7%
associate-+l+90.7%
associate-*l*91.5%
Simplified91.5%
Taylor expanded in x around inf 26.3%
Final simplification26.3%
(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 2024011
(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)))