
(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 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((x + (y * z)) + (t * a)) + ((a * z) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + (y * z)) + (t * a)) + ((a * z) * b);
}
def code(x, y, z, t, a, b): return ((x + (y * z)) + (t * a)) + ((a * z) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(a * z) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + (y * z)) + (t * a)) + ((a * z) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(a * z), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(a \cdot z\right) \cdot b
\end{array}
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ (+ (+ x (* y z)) (* t a)) (* (* z a) b)))) (if (<= t_1 2e+300) t_1 (fma a t (fma z (fma a b y) x)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (y * z)) + (t * a)) + ((z * a) * b);
double tmp;
if (t_1 <= 2e+300) {
tmp = t_1;
} else {
tmp = fma(a, t, fma(z, fma(a, b, y), x));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(y * z)) + Float64(t * a)) + Float64(Float64(z * a) * b)) tmp = 0.0 if (t_1 <= 2e+300) tmp = t_1; else tmp = fma(a, t, fma(z, fma(a, b, y), x)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(y * z), $MachinePrecision]), $MachinePrecision] + N[(t * a), $MachinePrecision]), $MachinePrecision] + N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 2e+300], t$95$1, N[(a * t + N[(z * N[(a * b + y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), x\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 2.0000000000000001e300Initial program 99.1%
if 2.0000000000000001e300 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 76.7%
Taylor expanded in x around 0
Simplified95.3%
Final simplification98.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma z (fma a b y) x))) (if (<= z -7.8e-48) t_1 (if (<= z 4.8e-14) (fma a t (fma z y x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(z, fma(a, b, y), x);
double tmp;
if (z <= -7.8e-48) {
tmp = t_1;
} else if (z <= 4.8e-14) {
tmp = fma(a, t, fma(z, y, x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(z, fma(a, b, y), x) tmp = 0.0 if (z <= -7.8e-48) tmp = t_1; elseif (z <= 4.8e-14) tmp = fma(a, t, fma(z, y, x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(a * b + y), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[z, -7.8e-48], t$95$1, If[LessEqual[z, 4.8e-14], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), x\right)\\
\mathbf{if}\;z \leq -7.8 \cdot 10^{-48}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.8 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -7.800000000000001e-48 or 4.8e-14 < z Initial program 91.7%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6489.8%
Simplified89.8%
if -7.800000000000001e-48 < z < 4.8e-14Initial program 100.0%
Taylor expanded in b around 0
Simplified93.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2.4e+54) (fma (* z b) a x) (if (<= b 4.2e+229) (fma a t (fma z y x)) (* z (fma a b y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2.4e+54) {
tmp = fma((z * b), a, x);
} else if (b <= 4.2e+229) {
tmp = fma(a, t, fma(z, y, x));
} else {
tmp = z * fma(a, b, y);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2.4e+54) tmp = fma(Float64(z * b), a, x); elseif (b <= 4.2e+229) tmp = fma(a, t, fma(z, y, x)); else tmp = Float64(z * fma(a, b, y)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2.4e+54], N[(N[(z * b), $MachinePrecision] * a + x), $MachinePrecision], If[LessEqual[b, 4.2e+229], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], N[(z * N[(a * b + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2.4 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(z \cdot b, a, x\right)\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{+229}:\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;z \cdot \mathsf{fma}\left(a, b, y\right)\\
\end{array}
\end{array}
if b < -2.39999999999999998e54Initial program 95.6%
Taylor expanded in x around inf
Simplified75.8%
+-commutativeN/A
associate-*r*N/A
*-commutativeN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f6477.3%
Applied egg-rr77.3%
if -2.39999999999999998e54 < b < 4.19999999999999975e229Initial program 95.0%
Taylor expanded in b around 0
Simplified90.4%
if 4.19999999999999975e229 < b Initial program 100.0%
Taylor expanded in z around inf
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6489.6%
Simplified89.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -8e+120) (* y z) (if (<= y 1.9e-153) x (if (<= y 10000000.0) (* t a) (* y z)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -8e+120) {
tmp = y * z;
} else if (y <= 1.9e-153) {
tmp = x;
} else if (y <= 10000000.0) {
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 (y <= (-8d+120)) then
tmp = y * z
else if (y <= 1.9d-153) then
tmp = x
else if (y <= 10000000.0d0) 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 (y <= -8e+120) {
tmp = y * z;
} else if (y <= 1.9e-153) {
tmp = x;
} else if (y <= 10000000.0) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -8e+120: tmp = y * z elif y <= 1.9e-153: tmp = x elif y <= 10000000.0: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -8e+120) tmp = Float64(y * z); elseif (y <= 1.9e-153) tmp = x; elseif (y <= 10000000.0) 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 (y <= -8e+120) tmp = y * z; elseif (y <= 1.9e-153) tmp = x; elseif (y <= 10000000.0) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -8e+120], N[(y * z), $MachinePrecision], If[LessEqual[y, 1.9e-153], x, If[LessEqual[y, 10000000.0], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8 \cdot 10^{+120}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 1.9 \cdot 10^{-153}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 10000000:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -7.9999999999999998e120 or 1e7 < y Initial program 90.6%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6457.9%
Simplified57.9%
if -7.9999999999999998e120 < y < 1.90000000000000011e-153Initial program 99.1%
Taylor expanded in x around inf
Simplified40.5%
if 1.90000000000000011e-153 < y < 1e7Initial program 96.7%
Taylor expanded in t around inf
*-lowering-*.f6445.2%
Simplified45.2%
Final simplification48.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* a (fma b z t)))) (if (<= a -8.2e-55) t_1 (if (<= a 2.5e-95) (fma z y x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * fma(b, z, t);
double tmp;
if (a <= -8.2e-55) {
tmp = t_1;
} else if (a <= 2.5e-95) {
tmp = fma(z, y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * fma(b, z, t)) tmp = 0.0 if (a <= -8.2e-55) tmp = t_1; elseif (a <= 2.5e-95) tmp = fma(z, y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -8.2e-55], t$95$1, If[LessEqual[a, 2.5e-95], N[(z * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \mathsf{fma}\left(b, z, t\right)\\
\mathbf{if}\;a \leq -8.2 \cdot 10^{-55}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.5 \cdot 10^{-95}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -8.1999999999999996e-55 or 2.4999999999999999e-95 < a Initial program 91.7%
Taylor expanded in a around inf
*-lowering-*.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f6470.4%
Simplified70.4%
if -8.1999999999999996e-55 < a < 2.4999999999999999e-95Initial program 100.0%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6486.3%
Simplified86.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -1.45e+85) (fma z y x) (if (<= y 5500000000000.0) (fma a t x) (fma z y x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.45e+85) {
tmp = fma(z, y, x);
} else if (y <= 5500000000000.0) {
tmp = fma(a, t, x);
} else {
tmp = fma(z, y, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.45e+85) tmp = fma(z, y, x); elseif (y <= 5500000000000.0) tmp = fma(a, t, x); else tmp = fma(z, y, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.45e+85], N[(z * y + x), $MachinePrecision], If[LessEqual[y, 5500000000000.0], N[(a * t + x), $MachinePrecision], N[(z * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.45 \cdot 10^{+85}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{elif}\;y \leq 5500000000000:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\end{array}
\end{array}
if y < -1.44999999999999999e85 or 5.5e12 < y Initial program 91.1%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6475.9%
Simplified75.9%
if -1.44999999999999999e85 < y < 5.5e12Initial program 98.6%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f6465.2%
Simplified65.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y -4.6e+147) (* y z) (if (<= y 2e+148) (fma a t x) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -4.6e+147) {
tmp = y * z;
} else if (y <= 2e+148) {
tmp = fma(a, t, x);
} else {
tmp = y * z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -4.6e+147) tmp = Float64(y * z); elseif (y <= 2e+148) tmp = fma(a, t, x); else tmp = Float64(y * z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -4.6e+147], N[(y * z), $MachinePrecision], If[LessEqual[y, 2e+148], N[(a * t + x), $MachinePrecision], N[(y * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.6 \cdot 10^{+147}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 2 \cdot 10^{+148}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -4.5999999999999998e147 or 2.0000000000000001e148 < y Initial program 90.5%
Taylor expanded in y around inf
*-commutativeN/A
*-lowering-*.f6469.3%
Simplified69.3%
if -4.5999999999999998e147 < y < 2.0000000000000001e148Initial program 97.2%
Taylor expanded in z around 0
+-commutativeN/A
accelerator-lowering-fma.f6463.8%
Simplified63.8%
Final simplification65.4%
(FPCore (x y z t a b) :precision binary64 (fma a t (fma z (fma a b y) x)))
double code(double x, double y, double z, double t, double a, double b) {
return fma(a, t, fma(z, fma(a, b, y), x));
}
function code(x, y, z, t, a, b) return fma(a, t, fma(z, fma(a, b, y), x)) end
code[x_, y_, z_, t_, a_, b_] := N[(a * t + N[(z * N[(a * b + y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), x\right)\right)
\end{array}
Initial program 95.3%
Taylor expanded in x around 0
Simplified96.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -7e+20) x (if (<= x 2.3e+120) (* t a) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -7e+20) {
tmp = x;
} else if (x <= 2.3e+120) {
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+20)) then
tmp = x
else if (x <= 2.3d+120) 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+20) {
tmp = x;
} else if (x <= 2.3e+120) {
tmp = t * a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -7e+20: tmp = x elif x <= 2.3e+120: tmp = t * a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -7e+20) tmp = x; elseif (x <= 2.3e+120) 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+20) tmp = x; elseif (x <= 2.3e+120) tmp = t * a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -7e+20], x, If[LessEqual[x, 2.3e+120], N[(t * a), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7 \cdot 10^{+20}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 2.3 \cdot 10^{+120}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -7e20 or 2.29999999999999993e120 < x Initial program 95.1%
Taylor expanded in x around inf
Simplified58.9%
if -7e20 < x < 2.29999999999999993e120Initial program 95.5%
Taylor expanded in t around inf
*-lowering-*.f6434.2%
Simplified34.2%
Final simplification44.0%
(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 95.3%
Taylor expanded in x around inf
Simplified29.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ (* z (+ (* b a) y)) (+ x (* t a)))))
(if (< z -11820553527347888000.0)
t_1
(if (< z 4.7589743188364287e-122)
(+ (* (+ (* b z) t) a) (+ (* z y) x))
t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (z * ((b * a) + y)) + (x + (t * a))
if (z < (-11820553527347888000.0d0)) then
tmp = t_1
else if (z < 4.7589743188364287d-122) then
tmp = (((b * z) + t) * a) + ((z * y) + x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (z * ((b * a) + y)) + (x + (t * a));
double tmp;
if (z < -11820553527347888000.0) {
tmp = t_1;
} else if (z < 4.7589743188364287e-122) {
tmp = (((b * z) + t) * a) + ((z * y) + x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (z * ((b * a) + y)) + (x + (t * a)) tmp = 0 if z < -11820553527347888000.0: tmp = t_1 elif z < 4.7589743188364287e-122: tmp = (((b * z) + t) * a) + ((z * y) + x) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(z * Float64(Float64(b * a) + y)) + Float64(x + Float64(t * a))) tmp = 0.0 if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = Float64(Float64(Float64(Float64(b * z) + t) * a) + Float64(Float64(z * y) + x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (z * ((b * a) + y)) + (x + (t * a)); tmp = 0.0; if (z < -11820553527347888000.0) tmp = t_1; elseif (z < 4.7589743188364287e-122) tmp = (((b * z) + t) * a) + ((z * y) + x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(z * N[(N[(b * a), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision] + N[(x + N[(t * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[z, -11820553527347888000.0], t$95$1, If[Less[z, 4.7589743188364287e-122], N[(N[(N[(N[(b * z), $MachinePrecision] + t), $MachinePrecision] * a), $MachinePrecision] + N[(N[(z * y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(b \cdot a + y\right) + \left(x + t \cdot a\right)\\
\mathbf{if}\;z < -11820553527347888000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z < 4.7589743188364287 \cdot 10^{-122}:\\
\;\;\;\;\left(b \cdot z + t\right) \cdot a + \left(z \cdot y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
herbie shell --seed 2024193
(FPCore (x y z t a b)
:name "Graphics.Rasterific.CubicBezier:cachedBezierAt from Rasterific-0.6.1"
:precision binary64
:alt
(! :herbie-platform default (if (< z -11820553527347888000) (+ (* z (+ (* b a) y)) (+ x (* t a))) (if (< z 47589743188364287/1000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000) (+ (* (+ (* b z) t) a) (+ (* z y) x)) (+ (* z (+ (* b a) y)) (+ x (* t a))))))
(+ (+ (+ x (* y z)) (* t a)) (* (* a z) b)))