
(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 INFINITY) t_1 (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 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = 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 <= Inf) tmp = t_1; else tmp = 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, Infinity], t$95$1, N[(z * N[(a * b + y), $MachinePrecision] + x), $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 \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(z, \mathsf{fma}\left(a, b, y\right), x\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.1%
if +inf.0 < (+.f64 (+.f64 (+.f64 x (*.f64 y z)) (*.f64 t a)) (*.f64 (*.f64 a z) b)) Initial program 0.0%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6480.4
Applied rewrites80.4%
Final simplification95.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (fma a b y))))
(if (<= z -4.5e+49)
t_1
(if (<= z 6.6e-45)
(fma a t x)
(if (<= z 5.6e+135) (fma z (* a b) 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 <= -4.5e+49) {
tmp = t_1;
} else if (z <= 6.6e-45) {
tmp = fma(a, t, x);
} else if (z <= 5.6e+135) {
tmp = fma(z, (a * b), 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 <= -4.5e+49) tmp = t_1; elseif (z <= 6.6e-45) tmp = fma(a, t, x); elseif (z <= 5.6e+135) tmp = fma(z, Float64(a * b), 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, -4.5e+49], t$95$1, If[LessEqual[z, 6.6e-45], N[(a * t + x), $MachinePrecision], If[LessEqual[z, 5.6e+135], N[(z * N[(a * b), $MachinePrecision] + 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 -4.5 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.6 \cdot 10^{-45}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{elif}\;z \leq 5.6 \cdot 10^{+135}:\\
\;\;\;\;\mathsf{fma}\left(z, a \cdot b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.49999999999999982e49 or 5.60000000000000004e135 < z Initial program 83.3%
Taylor expanded in z around inf
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6483.1
Applied rewrites83.1%
if -4.49999999999999982e49 < z < 6.6000000000000001e-45Initial program 96.6%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6474.9
Applied rewrites74.9%
if 6.6000000000000001e-45 < z < 5.60000000000000004e135Initial program 91.7%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6497.2
Applied rewrites97.2%
Taylor expanded in a around inf
Applied rewrites81.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (fma z (fma a b y) x))) (if (<= z -1.22e-58) t_1 (if (<= z 6.5e-96) (fma a t 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 <= -1.22e-58) {
tmp = t_1;
} else if (z <= 6.5e-96) {
tmp = fma(a, t, 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 <= -1.22e-58) tmp = t_1; elseif (z <= 6.5e-96) 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] + x), $MachinePrecision]}, If[LessEqual[z, -1.22e-58], t$95$1, If[LessEqual[z, 6.5e-96], N[(a * t + x), $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 -1.22 \cdot 10^{-58}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.5 \cdot 10^{-96}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.2199999999999999e-58 or 6.50000000000000001e-96 < z Initial program 87.8%
Taylor expanded in t around 0
+-commutativeN/A
+-commutativeN/A
associate-*r*N/A
distribute-rgt-inN/A
lower-fma.f64N/A
+-commutativeN/A
lower-fma.f6487.4
Applied rewrites87.4%
if -1.2199999999999999e-58 < z < 6.50000000000000001e-96Initial program 97.2%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6484.2
Applied rewrites84.2%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* a (fma b z t)))) (if (<= a -6.6e-41) t_1 (if (<= a 2.7e+125) (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 <= -6.6e-41) {
tmp = t_1;
} else if (a <= 2.7e+125) {
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 <= -6.6e-41) tmp = t_1; elseif (a <= 2.7e+125) 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, -6.6e-41], t$95$1, If[LessEqual[a, 2.7e+125], 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 -6.6 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 2.7 \cdot 10^{+125}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.60000000000000047e-41 or 2.6999999999999999e125 < a Initial program 83.3%
Taylor expanded in a around inf
lower-*.f64N/A
+-commutativeN/A
lower-fma.f6479.3
Applied rewrites79.3%
if -6.60000000000000047e-41 < a < 2.6999999999999999e125Initial program 95.9%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.5
Applied rewrites74.5%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.7e-66) (fma a t x) (if (<= a 7.2e+127) (fma z y x) (* (* z a) b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.7e-66) {
tmp = fma(a, t, x);
} else if (a <= 7.2e+127) {
tmp = fma(z, y, x);
} else {
tmp = (z * a) * b;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.7e-66) tmp = fma(a, t, x); elseif (a <= 7.2e+127) tmp = fma(z, y, x); else tmp = Float64(Float64(z * a) * b); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.7e-66], N[(a * t + x), $MachinePrecision], If[LessEqual[a, 7.2e+127], N[(z * y + x), $MachinePrecision], N[(N[(z * a), $MachinePrecision] * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{-66}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{elif}\;a \leq 7.2 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z \cdot a\right) \cdot b\\
\end{array}
\end{array}
if a < -4.6999999999999999e-66Initial program 87.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6458.0
Applied rewrites58.0%
if -4.6999999999999999e-66 < a < 7.19999999999999958e127Initial program 95.8%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.6
Applied rewrites74.6%
if 7.19999999999999958e127 < a Initial program 75.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
Applied rewrites62.9%
(FPCore (x y z t a b) :precision binary64 (if (<= a -4.7e-66) (fma a t x) (if (<= a 1.1e+127) (fma z y x) (* a (* z b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -4.7e-66) {
tmp = fma(a, t, x);
} else if (a <= 1.1e+127) {
tmp = fma(z, y, x);
} else {
tmp = a * (z * b);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -4.7e-66) tmp = fma(a, t, x); elseif (a <= 1.1e+127) tmp = fma(z, y, x); else tmp = Float64(a * Float64(z * b)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -4.7e-66], N[(a * t + x), $MachinePrecision], If[LessEqual[a, 1.1e+127], N[(z * y + x), $MachinePrecision], N[(a * N[(z * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -4.7 \cdot 10^{-66}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{elif}\;a \leq 1.1 \cdot 10^{+127}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot \left(z \cdot b\right)\\
\end{array}
\end{array}
if a < -4.6999999999999999e-66Initial program 87.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6458.0
Applied rewrites58.0%
if -4.6999999999999999e-66 < a < 1.1000000000000001e127Initial program 95.8%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6474.6
Applied rewrites74.6%
if 1.1000000000000001e127 < a Initial program 75.6%
Taylor expanded in b around inf
lower-*.f64N/A
lower-*.f6457.4
Applied rewrites57.4%
Final simplification67.2%
(FPCore (x y z t a b) :precision binary64 (if (<= t -3.8e+33) (fma a t x) (if (<= t 2.7e+42) (fma z y x) (fma a t x))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -3.8e+33) {
tmp = fma(a, t, x);
} else if (t <= 2.7e+42) {
tmp = fma(z, y, x);
} else {
tmp = fma(a, t, x);
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -3.8e+33) tmp = fma(a, t, x); elseif (t <= 2.7e+42) tmp = fma(z, y, x); else tmp = fma(a, t, x); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -3.8e+33], N[(a * t + x), $MachinePrecision], If[LessEqual[t, 2.7e+42], N[(z * y + x), $MachinePrecision], N[(a * t + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.8 \cdot 10^{+33}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{elif}\;t \leq 2.7 \cdot 10^{+42}:\\
\;\;\;\;\mathsf{fma}\left(z, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\end{array}
\end{array}
if t < -3.80000000000000002e33 or 2.7000000000000001e42 < t Initial program 91.5%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6472.7
Applied rewrites72.7%
if -3.80000000000000002e33 < t < 2.7000000000000001e42Initial program 89.7%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f6462.6
Applied rewrites62.6%
(FPCore (x y z t a b) :precision binary64 (if (<= y -3200000000000.0) (* y z) (if (<= y 9.6e+168) (fma a t x) (* y z))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -3200000000000.0) {
tmp = y * z;
} else if (y <= 9.6e+168) {
tmp = fma(a, t, x);
} else {
tmp = y * z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -3200000000000.0) tmp = Float64(y * z); elseif (y <= 9.6e+168) tmp = fma(a, t, x); else tmp = Float64(y * z); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -3200000000000.0], N[(y * z), $MachinePrecision], If[LessEqual[y, 9.6e+168], N[(a * t + x), $MachinePrecision], N[(y * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3200000000000:\\
\;\;\;\;y \cdot z\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(a, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot z\\
\end{array}
\end{array}
if y < -3.2e12 or 9.60000000000000037e168 < y Initial program 86.3%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6462.0
Applied rewrites62.0%
if -3.2e12 < y < 9.60000000000000037e168Initial program 92.3%
Taylor expanded in z around 0
+-commutativeN/A
lower-fma.f6460.0
Applied rewrites60.0%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6.2e+30) (* t a) (if (<= t 7e+43) (* y z) (* t a))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.2e+30) {
tmp = t * a;
} else if (t <= 7e+43) {
tmp = y * z;
} else {
tmp = 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 (t <= (-6.2d+30)) then
tmp = t * a
else if (t <= 7d+43) then
tmp = y * z
else
tmp = 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 (t <= -6.2e+30) {
tmp = t * a;
} else if (t <= 7e+43) {
tmp = y * z;
} else {
tmp = t * a;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.2e+30: tmp = t * a elif t <= 7e+43: tmp = y * z else: tmp = t * a return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.2e+30) tmp = Float64(t * a); elseif (t <= 7e+43) tmp = Float64(y * z); else tmp = Float64(t * a); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6.2e+30) tmp = t * a; elseif (t <= 7e+43) tmp = y * z; else tmp = t * a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.2e+30], N[(t * a), $MachinePrecision], If[LessEqual[t, 7e+43], N[(y * z), $MachinePrecision], N[(t * a), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.2 \cdot 10^{+30}:\\
\;\;\;\;t \cdot a\\
\mathbf{elif}\;t \leq 7 \cdot 10^{+43}:\\
\;\;\;\;y \cdot z\\
\mathbf{else}:\\
\;\;\;\;t \cdot a\\
\end{array}
\end{array}
if t < -6.1999999999999995e30 or 7.0000000000000002e43 < t Initial program 91.5%
Taylor expanded in t around inf
lower-*.f6453.2
Applied rewrites53.2%
if -6.1999999999999995e30 < t < 7.0000000000000002e43Initial program 89.7%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f6434.2
Applied rewrites34.2%
Final simplification42.1%
(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 90.4%
Taylor expanded in t around inf
lower-*.f6426.4
Applied rewrites26.4%
Final simplification26.4%
(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 2024232
(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)))