
(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 1e+304) t_1 (fma z y (* a (fma b z t))))))
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 <= 1e+304) {
tmp = t_1;
} else {
tmp = fma(z, y, (a * fma(b, z, t)));
}
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 <= 1e+304) tmp = t_1; else tmp = fma(z, y, Float64(a * fma(b, z, t))); 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, 1e+304], t$95$1, N[(z * y + N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + y \cdot z\right) + t \cdot a\right) + \left(z \cdot a\right) \cdot b\\
\mathbf{if}\;t\_1 \leq 10^{+304}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, a \cdot \mathsf{fma}\left(b, z, t\right)\right)\\
\end{array}
\end{array}
if (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) < 9.9999999999999994e303Initial program 98.1%
if 9.9999999999999994e303 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 81.9%
Taylor expanded in x around 0
associate-+r+N/A
distribute-lft-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6498.0
Applied rewrites98.0%
Final simplification98.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma y (fma (/ a y) (fma b z t) z) x))) (if (<= y -9.8e-151) t_1 (if (<= y 3.2e-231) (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(y, fma((a / y), fma(b, z, t), z), x);
double tmp;
if (y <= -9.8e-151) {
tmp = t_1;
} else if (y <= 3.2e-231) {
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(y, fma(Float64(a / y), fma(b, z, t), z), x) tmp = 0.0 if (y <= -9.8e-151) tmp = t_1; elseif (y <= 3.2e-231) 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[(y * N[(N[(a / y), $MachinePrecision] * N[(b * z + t), $MachinePrecision] + z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -9.8e-151], t$95$1, If[LessEqual[y, 3.2e-231], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(y, \mathsf{fma}\left(\frac{a}{y}, \mathsf{fma}\left(b, z, t\right), z\right), x\right)\\
\mathbf{if}\;y \leq -9.8 \cdot 10^{-151}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{-231}:\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -9.79999999999999933e-151 or 3.20000000000000008e-231 < y Initial program 94.4%
Taylor expanded in y around inf
+-commutativeN/A
associate-+r+N/A
distribute-lft-inN/A
+-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-/l*N/A
*-inversesN/A
*-rgt-identityN/A
lower-fma.f64N/A
Applied rewrites93.0%
if -9.79999999999999933e-151 < y < 3.20000000000000008e-231Initial program 97.7%
Taylor expanded in b around 0
Applied rewrites81.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma z y (* a (fma b z t))))) (if (<= b -1.05e+144) t_1 (if (<= b 2.15e+120) (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, y, (a * fma(b, z, t)));
double tmp;
if (b <= -1.05e+144) {
tmp = t_1;
} else if (b <= 2.15e+120) {
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, y, Float64(a * fma(b, z, t))) tmp = 0.0 if (b <= -1.05e+144) tmp = t_1; elseif (b <= 2.15e+120) 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 * y + N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.05e+144], t$95$1, If[LessEqual[b, 2.15e+120], N[(a * t + N[(z * y + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(z, y, a \cdot \mathsf{fma}\left(b, z, t\right)\right)\\
\mathbf{if}\;b \leq -1.05 \cdot 10^{+144}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{+120}:\\
\;\;\;\;\mathsf{fma}\left(a, t, \mathsf{fma}\left(z, y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.04999999999999998e144 or 2.1500000000000001e120 < b Initial program 94.0%
Taylor expanded in x around 0
associate-+r+N/A
distribute-lft-inN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6478.1
Applied rewrites78.1%
if -1.04999999999999998e144 < b < 2.1500000000000001e120Initial program 95.5%
Taylor expanded in b around 0
Applied rewrites94.1%
(FPCore (x y z t a b) :precision binary64 (if (<= b -1.6e+170) (* a (fma b z t)) (if (<= b 1.1e+124) (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 <= -1.6e+170) {
tmp = a * fma(b, z, t);
} else if (b <= 1.1e+124) {
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 <= -1.6e+170) tmp = Float64(a * fma(b, z, t)); elseif (b <= 1.1e+124) 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, -1.6e+170], N[(a * N[(b * z + t), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 1.1e+124], 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 -1.6 \cdot 10^{+170}:\\
\;\;\;\;a \cdot \mathsf{fma}\left(b, z, t\right)\\
\mathbf{elif}\;b \leq 1.1 \cdot 10^{+124}:\\
\;\;\;\;\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 < -1.59999999999999989e170Initial program 97.1%
Taylor expanded in a around inf
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6471.7
Applied rewrites71.7%
if -1.59999999999999989e170 < b < 1.1e124Initial program 95.6%
Taylor expanded in b around 0
Applied rewrites93.3%
if 1.1e124 < b Initial program 90.5%
Taylor expanded in z around inf
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6470.4
Applied rewrites70.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (fma a b y)))) (if (<= z -5e-57) t_1 (if (<= z 0.24) (fma a t x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * fma(a, b, y);
double tmp;
if (z <= -5e-57) {
tmp = t_1;
} else if (z <= 0.24) {
tmp = fma(a, t, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * fma(a, b, y)) tmp = 0.0 if (z <= -5e-57) tmp = t_1; elseif (z <= 0.24) tmp = fma(a, t, 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]), $MachinePrecision]}, If[LessEqual[z, -5e-57], t$95$1, If[LessEqual[z, 0.24], N[(a * t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \mathsf{fma}\left(a, b, y\right)\\
\mathbf{if}\;z \leq -5 \cdot 10^{-57}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 0.24:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -5.0000000000000002e-57 or 0.23999999999999999 < z Initial program 92.1%
Taylor expanded in z around inf
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6474.6
Applied rewrites74.6%
if -5.0000000000000002e-57 < z < 0.23999999999999999Initial program 98.3%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6479.9
Applied rewrites79.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* a (fma b z t)))) (if (<= a -1.32e+19) t_1 (if (<= a 2.6e-60) (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 <= -1.32e+19) {
tmp = t_1;
} else if (a <= 2.6e-60) {
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 <= -1.32e+19) tmp = t_1; elseif (a <= 2.6e-60) 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, -1.32e+19], t$95$1, If[LessEqual[a, 2.6e-60], 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 -1.32 \cdot 10^{+19}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.6 \cdot 10^{-60}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -1.32e19 or 2.5999999999999998e-60 < a Initial program 92.4%
Taylor expanded in a around inf
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6474.1
Applied rewrites74.1%
if -1.32e19 < a < 2.5999999999999998e-60Initial program 97.6%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.9
Applied rewrites74.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.4e+38) (fma z y x) (if (<= y 4.5e+102) (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 <= -6.4e+38) {
tmp = fma(z, y, x);
} else if (y <= 4.5e+102) {
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 <= -6.4e+38) tmp = fma(z, y, x); elseif (y <= 4.5e+102) 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, -6.4e+38], N[(z * y + x), $MachinePrecision], If[LessEqual[y, 4.5e+102], N[(a * t + x), $MachinePrecision], N[(z * y + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{+38}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+102}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\end{array}
\end{array}
if y < -6.3999999999999997e38 or 4.50000000000000021e102 < y Initial program 94.9%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.0
Applied rewrites74.0%
if -6.3999999999999997e38 < y < 4.50000000000000021e102Initial program 95.1%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6465.1
Applied rewrites65.1%
(FPCore (x y z t a b) :precision binary64 (if (<= y -5.3e+150) (* y z) (if (<= y 5.3e+172) (fma a t x) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -5.3e+150) {
tmp = y * z;
} else if (y <= 5.3e+172) {
tmp = fma(a, t, x);
} else {
tmp = y * z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -5.3e+150) tmp = Float64(y * z); elseif (y <= 5.3e+172) tmp = fma(a, t, x); else tmp = Float64(y * z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -5.3e+150], N[(y * z), $MachinePrecision], If[LessEqual[y, 5.3e+172], N[(a * t + x), $MachinePrecision], N[(y * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.3 \cdot 10^{+150}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 5.3 \cdot 10^{+172}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -5.30000000000000013e150 or 5.3e172 < y Initial program 93.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6474.9
Applied rewrites74.9%
if -5.30000000000000013e150 < y < 5.3e172Initial program 95.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6462.5
Applied rewrites62.5%
Final simplification65.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y -6.2e+38) (* y z) (if (<= y 1.15e+91) (* t a) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -6.2e+38) {
tmp = y * z;
} else if (y <= 1.15e+91) {
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 <= (-6.2d+38)) then
tmp = y * z
else if (y <= 1.15d+91) 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 <= -6.2e+38) {
tmp = y * z;
} else if (y <= 1.15e+91) {
tmp = t * a;
} else {
tmp = y * z;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -6.2e+38: tmp = y * z elif y <= 1.15e+91: tmp = t * a else: tmp = y * z return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -6.2e+38) tmp = Float64(y * z); elseif (y <= 1.15e+91) 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 <= -6.2e+38) tmp = y * z; elseif (y <= 1.15e+91) tmp = t * a; else tmp = y * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -6.2e+38], N[(y * z), $MachinePrecision], If[LessEqual[y, 1.15e+91], N[(t * a), $MachinePrecision], N[(y * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.2 \cdot 10^{+38}:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{+91}:\\
\;\;\;\;t \cdot a\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -6.20000000000000035e38 or 1.14999999999999996e91 < y Initial program 95.1%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6458.3
Applied rewrites58.3%
if -6.20000000000000035e38 < y < 1.14999999999999996e91Initial program 94.9%
Taylor expanded in t around inf
lower-*.f6433.4
Applied rewrites33.4%
Final simplification43.3%
(FPCore (x y z t a b) :precision binary64 (* t a))
double code(double x, double y, double z, double t, double a, double b) {
return t * a;
}
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 = t * a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return t * a;
}
def code(x, y, z, t, a, b): return t * a
function code(x, y, z, t, a, b) return Float64(t * a) end
function tmp = code(x, y, z, t, a, b) tmp = t * a; end
code[x_, y_, z_, t_, a_, b_] := N[(t * a), $MachinePrecision]
\begin{array}{l}
\\
t \cdot a
\end{array}
Initial program 95.0%
Taylor expanded in t around inf
lower-*.f6428.1
Applied rewrites28.1%
Final simplification28.1%
(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 2024226
(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)))