
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * 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 - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 22 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * 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 - 1.0d0) * z)) - ((t - 1.0d0) * a)) + (((y + t) - 2.0d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b);
}
def code(x, y, z, t, a, b): return ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x - Float64(Float64(y - 1.0) * z)) - Float64(Float64(t - 1.0) * a)) + Float64(Float64(Float64(y + t) - 2.0) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x - ((y - 1.0) * z)) - ((t - 1.0) * a)) + (((y + t) - 2.0) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x - N[(N[(y - 1.0), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision] - N[(N[(t - 1.0), $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x - \left(y - 1\right) \cdot z\right) - \left(t - 1\right) \cdot a\right) + \left(\left(y + t\right) - 2\right) \cdot b
\end{array}
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (- 1.0 t))) (t_2 (* (- (+ y t) 2.0) b)))
(if (<= (+ (+ (+ x (* z (- 1.0 y))) t_1) t_2) INFINITY)
(+ t_2 (+ (- x (fma z y (- 0.0 z))) t_1))
(fma b (+ y -2.0) (fma t (- b a) (fma z (- 1.0 y) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (1.0 - t);
double t_2 = ((y + t) - 2.0) * b;
double tmp;
if ((((x + (z * (1.0 - y))) + t_1) + t_2) <= ((double) INFINITY)) {
tmp = t_2 + ((x - fma(z, y, (0.0 - z))) + t_1);
} else {
tmp = fma(b, (y + -2.0), fma(t, (b - a), fma(z, (1.0 - y), a)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(1.0 - t)) t_2 = Float64(Float64(Float64(y + t) - 2.0) * b) tmp = 0.0 if (Float64(Float64(Float64(x + Float64(z * Float64(1.0 - y))) + t_1) + t_2) <= Inf) tmp = Float64(t_2 + Float64(Float64(x - fma(z, y, Float64(0.0 - z))) + t_1)); else tmp = fma(b, Float64(y + -2.0), fma(t, Float64(b - a), fma(z, Float64(1.0 - y), a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], Infinity], N[(t$95$2 + N[(N[(x - N[(z * y + N[(0.0 - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]), $MachinePrecision], N[(b * N[(y + -2.0), $MachinePrecision] + N[(t * N[(b - a), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(1 - t\right)\\
t_2 := \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;\left(\left(x + z \cdot \left(1 - y\right)\right) + t\_1\right) + t\_2 \leq \infty:\\
\;\;\;\;t\_2 + \left(\left(x - \mathsf{fma}\left(z, y, 0 - z\right)\right) + t\_1\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, y + -2, \mathsf{fma}\left(t, b - a, \mathsf{fma}\left(z, 1 - y, a\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 100.0%
*-commutativeN/A
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
metadata-eval100.0
Applied egg-rr100.0%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 0.0%
Taylor expanded in x around 0
Simplified92.3%
Final simplification99.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1
(+ (+ (+ x (* z (- 1.0 y))) (* a (- 1.0 t))) (* (- (+ y t) 2.0) b))))
(if (<= t_1 INFINITY)
t_1
(fma b (+ y -2.0) (fma t (- b a) (fma z (- 1.0 y) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = ((x + (z * (1.0 - y))) + (a * (1.0 - t))) + (((y + t) - 2.0) * b);
double tmp;
if (t_1 <= ((double) INFINITY)) {
tmp = t_1;
} else {
tmp = fma(b, (y + -2.0), fma(t, (b - a), fma(z, (1.0 - y), a)));
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(Float64(x + Float64(z * Float64(1.0 - y))) + Float64(a * Float64(1.0 - t))) + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (t_1 <= Inf) tmp = t_1; else tmp = fma(b, Float64(y + -2.0), fma(t, Float64(b - a), fma(z, Float64(1.0 - y), a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[(x + N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, Infinity], t$95$1, N[(b * N[(y + -2.0), $MachinePrecision] + N[(t * N[(b - a), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(\left(x + z \cdot \left(1 - y\right)\right) + a \cdot \left(1 - t\right)\right) + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;t\_1 \leq \infty:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, y + -2, \mathsf{fma}\left(t, b - a, \mathsf{fma}\left(z, 1 - y, a\right)\right)\right)\\
\end{array}
\end{array}
if (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) < +inf.0Initial program 100.0%
if +inf.0 < (+.f64 (-.f64 (-.f64 x (*.f64 (-.f64 y #s(literal 1 binary64)) z)) (*.f64 (-.f64 t #s(literal 1 binary64)) a)) (*.f64 (-.f64 (+.f64 y t) #s(literal 2 binary64)) b)) Initial program 0.0%
Taylor expanded in x around 0
Simplified92.3%
Final simplification99.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.15e+15)
(fma b (+ t (+ y -2.0)) (fma a (- 1.0 t) x))
(if (<= b 3.4e-64)
(fma a (- 1.0 t) (fma z (- 1.0 y) x))
(fma b (+ y -2.0) (fma t (- b a) (fma z (- 1.0 y) a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.15e+15) {
tmp = fma(b, (t + (y + -2.0)), fma(a, (1.0 - t), x));
} else if (b <= 3.4e-64) {
tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
} else {
tmp = fma(b, (y + -2.0), fma(t, (b - a), fma(z, (1.0 - y), a)));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.15e+15) tmp = fma(b, Float64(t + Float64(y + -2.0)), fma(a, Float64(1.0 - t), x)); elseif (b <= 3.4e-64) tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x)); else tmp = fma(b, Float64(y + -2.0), fma(t, Float64(b - a), fma(z, Float64(1.0 - y), a))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.15e+15], N[(b * N[(t + N[(y + -2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 3.4e-64], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(b * N[(y + -2.0), $MachinePrecision] + N[(t * N[(b - a), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.15 \cdot 10^{+15}:\\
\;\;\;\;\mathsf{fma}\left(b, t + \left(y + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)\\
\mathbf{elif}\;b \leq 3.4 \cdot 10^{-64}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, y + -2, \mathsf{fma}\left(t, b - a, \mathsf{fma}\left(z, 1 - y, a\right)\right)\right)\\
\end{array}
\end{array}
if b < -1.15e15Initial program 95.9%
*-commutativeN/A
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
metadata-eval95.9
Applied egg-rr95.9%
Taylor expanded in z around 0
*-commutativeN/A
cancel-sign-sub-invN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
*-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
Simplified92.4%
if -1.15e15 < b < 3.40000000000000012e-64Initial program 99.2%
Taylor expanded in b around 0
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified97.3%
if 3.40000000000000012e-64 < b Initial program 86.5%
Taylor expanded in x around 0
Simplified91.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma b (+ t (+ y -2.0)) (fma a (- 1.0 t) x))))
(if (<= b -1.3e+17)
t_1
(if (<= b 8e-31) (fma a (- 1.0 t) (fma z (- 1.0 y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(b, (t + (y + -2.0)), fma(a, (1.0 - t), x));
double tmp;
if (b <= -1.3e+17) {
tmp = t_1;
} else if (b <= 8e-31) {
tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(b, Float64(t + Float64(y + -2.0)), fma(a, Float64(1.0 - t), x)) tmp = 0.0 if (b <= -1.3e+17) tmp = t_1; elseif (b <= 8e-31) tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(t + N[(y + -2.0), $MachinePrecision]), $MachinePrecision] + N[(a * N[(1.0 - t), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.3e+17], t$95$1, If[LessEqual[b, 8e-31], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, t + \left(y + -2\right), \mathsf{fma}\left(a, 1 - t, x\right)\right)\\
\mathbf{if}\;b \leq -1.3 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 8 \cdot 10^{-31}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.3e17 or 8.000000000000001e-31 < b Initial program 89.6%
*-commutativeN/A
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
metadata-eval89.6
Applied egg-rr89.6%
Taylor expanded in z around 0
*-commutativeN/A
cancel-sign-sub-invN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
*-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
associate--l+N/A
+-lowering-+.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-evalN/A
+-commutativeN/A
Simplified85.6%
if -1.3e17 < b < 8.000000000000001e-31Initial program 99.3%
Taylor expanded in b around 0
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified96.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma a (- 1.0 t) (fma b (+ y (+ t -2.0)) x))))
(if (<= b -1.22e+16)
t_1
(if (<= b 2.4e-30) (fma a (- 1.0 t) (fma z (- 1.0 y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(a, (1.0 - t), fma(b, (y + (t + -2.0)), x));
double tmp;
if (b <= -1.22e+16) {
tmp = t_1;
} else if (b <= 2.4e-30) {
tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(a, Float64(1.0 - t), fma(b, Float64(y + Float64(t + -2.0)), x)) tmp = 0.0 if (b <= -1.22e+16) tmp = t_1; elseif (b <= 2.4e-30) tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(1.0 - t), $MachinePrecision] + N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.22e+16], t$95$1, If[LessEqual[b, 2.4e-30], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(b, y + \left(t + -2\right), x\right)\right)\\
\mathbf{if}\;b \leq -1.22 \cdot 10^{+16}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.4 \cdot 10^{-30}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.22e16 or 2.39999999999999985e-30 < b Initial program 89.6%
Taylor expanded in z around 0
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f64N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
+-commutativeN/A
associate-+r-N/A
+-lowering-+.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval83.0
Simplified83.0%
if -1.22e16 < b < 2.39999999999999985e-30Initial program 99.3%
Taylor expanded in b around 0
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified96.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* t b))) (t_2 (* y (- b z))))
(if (<= y -2.35e+92)
t_2
(if (<= y -3.2e-203)
t_1
(if (<= y 4.2e-298) (* a (- 1.0 t)) (if (<= y 1.7e+49) t_1 t_2))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (t * b);
double t_2 = y * (b - z);
double tmp;
if (y <= -2.35e+92) {
tmp = t_2;
} else if (y <= -3.2e-203) {
tmp = t_1;
} else if (y <= 4.2e-298) {
tmp = a * (1.0 - t);
} else if (y <= 1.7e+49) {
tmp = t_1;
} 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 * b)
t_2 = y * (b - z)
if (y <= (-2.35d+92)) then
tmp = t_2
else if (y <= (-3.2d-203)) then
tmp = t_1
else if (y <= 4.2d-298) then
tmp = a * (1.0d0 - t)
else if (y <= 1.7d+49) then
tmp = t_1
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 * b);
double t_2 = y * (b - z);
double tmp;
if (y <= -2.35e+92) {
tmp = t_2;
} else if (y <= -3.2e-203) {
tmp = t_1;
} else if (y <= 4.2e-298) {
tmp = a * (1.0 - t);
} else if (y <= 1.7e+49) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x + (t * b) t_2 = y * (b - z) tmp = 0 if y <= -2.35e+92: tmp = t_2 elif y <= -3.2e-203: tmp = t_1 elif y <= 4.2e-298: tmp = a * (1.0 - t) elif y <= 1.7e+49: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(t * b)) t_2 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -2.35e+92) tmp = t_2; elseif (y <= -3.2e-203) tmp = t_1; elseif (y <= 4.2e-298) tmp = Float64(a * Float64(1.0 - t)); elseif (y <= 1.7e+49) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x + (t * b); t_2 = y * (b - z); tmp = 0.0; if (y <= -2.35e+92) tmp = t_2; elseif (y <= -3.2e-203) tmp = t_1; elseif (y <= 4.2e-298) tmp = a * (1.0 - t); elseif (y <= 1.7e+49) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(t * b), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.35e+92], t$95$2, If[LessEqual[y, -3.2e-203], t$95$1, If[LessEqual[y, 4.2e-298], N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.7e+49], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + t \cdot b\\
t_2 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -2.35 \cdot 10^{+92}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -3.2 \cdot 10^{-203}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 4.2 \cdot 10^{-298}:\\
\;\;\;\;a \cdot \left(1 - t\right)\\
\mathbf{elif}\;y \leq 1.7 \cdot 10^{+49}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -2.35e92 or 1.7e49 < y Initial program 93.1%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6471.5
Simplified71.5%
if -2.35e92 < y < -3.2e-203 or 4.2000000000000001e-298 < y < 1.7e49Initial program 96.2%
Taylor expanded in x around inf
Simplified55.1%
Taylor expanded in t around inf
Simplified45.2%
if -3.2e-203 < y < 4.2000000000000001e-298Initial program 95.7%
Taylor expanded in a around inf
sub-negN/A
neg-mul-1N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f6453.9
Simplified53.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* y (- b z))))
(if (<= y -5.9e+115)
t_1
(if (<= y 2400000000000.0)
(+ a (fma t (- b a) (fma b -2.0 z)))
(if (<= y 4.8e+110) (+ x (* (- (+ y t) 2.0) b)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y * (b - z);
double tmp;
if (y <= -5.9e+115) {
tmp = t_1;
} else if (y <= 2400000000000.0) {
tmp = a + fma(t, (b - a), fma(b, -2.0, z));
} else if (y <= 4.8e+110) {
tmp = x + (((y + t) - 2.0) * b);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(y * Float64(b - z)) tmp = 0.0 if (y <= -5.9e+115) tmp = t_1; elseif (y <= 2400000000000.0) tmp = Float64(a + fma(t, Float64(b - a), fma(b, -2.0, z))); elseif (y <= 4.8e+110) tmp = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -5.9e+115], t$95$1, If[LessEqual[y, 2400000000000.0], N[(a + N[(t * N[(b - a), $MachinePrecision] + N[(b * -2.0 + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.8e+110], N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \left(b - z\right)\\
\mathbf{if}\;y \leq -5.9 \cdot 10^{+115}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2400000000000:\\
\;\;\;\;a + \mathsf{fma}\left(t, b - a, \mathsf{fma}\left(b, -2, z\right)\right)\\
\mathbf{elif}\;y \leq 4.8 \cdot 10^{+110}:\\
\;\;\;\;x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -5.8999999999999997e115 or 4.80000000000000025e110 < y Initial program 91.8%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6475.1
Simplified75.1%
if -5.8999999999999997e115 < y < 2.4e12Initial program 96.6%
Taylor expanded in x around 0
Simplified77.0%
Taylor expanded in y around 0
+-lowering-+.f64N/A
associate-+r+N/A
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f64N/A
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6473.3
Simplified73.3%
if 2.4e12 < y < 4.80000000000000025e110Initial program 95.8%
Taylor expanded in x around inf
Simplified70.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* (- (+ y t) 2.0) b))))
(if (<= b -9.8e+116)
t_1
(if (<= b 2.8e+133) (fma a (- 1.0 t) (fma z (- 1.0 y) x)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (((y + t) - 2.0) * b);
double tmp;
if (b <= -9.8e+116) {
tmp = t_1;
} else if (b <= 2.8e+133) {
tmp = fma(a, (1.0 - t), fma(z, (1.0 - y), x));
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -9.8e+116) tmp = t_1; elseif (b <= 2.8e+133) tmp = fma(a, Float64(1.0 - t), fma(z, Float64(1.0 - y), x)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -9.8e+116], t$95$1, If[LessEqual[b, 2.8e+133], N[(a * N[(1.0 - t), $MachinePrecision] + N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -9.8 \cdot 10^{+116}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.8 \cdot 10^{+133}:\\
\;\;\;\;\mathsf{fma}\left(a, 1 - t, \mathsf{fma}\left(z, 1 - y, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -9.7999999999999996e116 or 2.80000000000000016e133 < b Initial program 87.3%
Taylor expanded in x around inf
Simplified86.4%
if -9.7999999999999996e116 < b < 2.80000000000000016e133Initial program 97.8%
Taylor expanded in b around 0
associate--r+N/A
sub-negN/A
+-commutativeN/A
associate-+r-N/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f64N/A
sub-negN/A
+-commutativeN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
Simplified88.6%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -2.2e+105)
(* y b)
(if (<= y -2.85e-98)
x
(if (<= y 6.3e-158) z (if (<= y 4.5e+16) x (* y b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e+105) {
tmp = y * b;
} else if (y <= -2.85e-98) {
tmp = x;
} else if (y <= 6.3e-158) {
tmp = z;
} else if (y <= 4.5e+16) {
tmp = x;
} else {
tmp = y * 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 (y <= (-2.2d+105)) then
tmp = y * b
else if (y <= (-2.85d-98)) then
tmp = x
else if (y <= 6.3d-158) then
tmp = z
else if (y <= 4.5d+16) then
tmp = x
else
tmp = y * 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 (y <= -2.2e+105) {
tmp = y * b;
} else if (y <= -2.85e-98) {
tmp = x;
} else if (y <= 6.3e-158) {
tmp = z;
} else if (y <= 4.5e+16) {
tmp = x;
} else {
tmp = y * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.2e+105: tmp = y * b elif y <= -2.85e-98: tmp = x elif y <= 6.3e-158: tmp = z elif y <= 4.5e+16: tmp = x else: tmp = y * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.2e+105) tmp = Float64(y * b); elseif (y <= -2.85e-98) tmp = x; elseif (y <= 6.3e-158) tmp = z; elseif (y <= 4.5e+16) tmp = x; else tmp = Float64(y * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -2.2e+105) tmp = y * b; elseif (y <= -2.85e-98) tmp = x; elseif (y <= 6.3e-158) tmp = z; elseif (y <= 4.5e+16) tmp = x; else tmp = y * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e+105], N[(y * b), $MachinePrecision], If[LessEqual[y, -2.85e-98], x, If[LessEqual[y, 6.3e-158], z, If[LessEqual[y, 4.5e+16], x, N[(y * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{+105}:\\
\;\;\;\;y \cdot b\\
\mathbf{elif}\;y \leq -2.85 \cdot 10^{-98}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.3 \cdot 10^{-158}:\\
\;\;\;\;z\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+16}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y \cdot b\\
\end{array}
\end{array}
if y < -2.20000000000000007e105 or 4.5e16 < y Initial program 92.7%
Taylor expanded in x around inf
Simplified49.0%
Taylor expanded in y around inf
*-lowering-*.f6438.1
Simplified38.1%
if -2.20000000000000007e105 < y < -2.8499999999999999e-98 or 6.30000000000000014e-158 < y < 4.5e16Initial program 97.5%
Taylor expanded in x around inf
Simplified29.7%
if -2.8499999999999999e-98 < y < 6.30000000000000014e-158Initial program 95.5%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
neg-mul-1N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
sub-negN/A
--lowering--.f6434.5
Simplified34.5%
Taylor expanded in y around 0
Simplified34.5%
Final simplification34.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (fma b (+ y -2.0) x)))
(if (<= b -7.5e+27)
t_1
(if (<= b 5.6e+140)
(fma z (- 1.0 y) x)
(if (<= b 5.5e+239) t_1 (* t (- b a)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = fma(b, (y + -2.0), x);
double tmp;
if (b <= -7.5e+27) {
tmp = t_1;
} else if (b <= 5.6e+140) {
tmp = fma(z, (1.0 - y), x);
} else if (b <= 5.5e+239) {
tmp = t_1;
} else {
tmp = t * (b - a);
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = fma(b, Float64(y + -2.0), x) tmp = 0.0 if (b <= -7.5e+27) tmp = t_1; elseif (b <= 5.6e+140) tmp = fma(z, Float64(1.0 - y), x); elseif (b <= 5.5e+239) tmp = t_1; else tmp = Float64(t * Float64(b - a)); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(y + -2.0), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[b, -7.5e+27], t$95$1, If[LessEqual[b, 5.6e+140], N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[b, 5.5e+239], t$95$1, N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \mathsf{fma}\left(b, y + -2, x\right)\\
\mathbf{if}\;b \leq -7.5 \cdot 10^{+27}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 5.6 \cdot 10^{+140}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - y, x\right)\\
\mathbf{elif}\;b \leq 5.5 \cdot 10^{+239}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;t \cdot \left(b - a\right)\\
\end{array}
\end{array}
if b < -7.5000000000000002e27 or 5.59999999999999966e140 < b < 5.5000000000000004e239Initial program 91.7%
Taylor expanded in x around inf
Simplified79.7%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval70.7
Simplified70.7%
if -7.5000000000000002e27 < b < 5.59999999999999966e140Initial program 98.2%
*-commutativeN/A
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
metadata-eval98.3
Applied egg-rr98.3%
Taylor expanded in b around 0
Simplified88.9%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6460.2
Simplified60.2%
if 5.5000000000000004e239 < b Initial program 63.6%
Taylor expanded in t around inf
*-lowering-*.f64N/A
--lowering--.f6482.8
Simplified82.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* t (- b a))))
(if (<= t -3.4e+39)
t_1
(if (<= t 2.65e-95) (fma y b x) (if (<= t 5.5e+48) (* y (- b z)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -3.4e+39) {
tmp = t_1;
} else if (t <= 2.65e-95) {
tmp = fma(y, b, x);
} else if (t <= 5.5e+48) {
tmp = y * (b - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -3.4e+39) tmp = t_1; elseif (t <= 2.65e-95) tmp = fma(y, b, x); elseif (t <= 5.5e+48) tmp = Float64(y * Float64(b - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3.4e+39], t$95$1, If[LessEqual[t, 2.65e-95], N[(y * b + x), $MachinePrecision], If[LessEqual[t, 5.5e+48], N[(y * N[(b - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -3.4 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.65 \cdot 10^{-95}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{elif}\;t \leq 5.5 \cdot 10^{+48}:\\
\;\;\;\;y \cdot \left(b - z\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -3.3999999999999999e39 or 5.5000000000000002e48 < t Initial program 89.2%
Taylor expanded in t around inf
*-lowering-*.f64N/A
--lowering--.f6462.0
Simplified62.0%
if -3.3999999999999999e39 < t < 2.6499999999999999e-95Initial program 99.2%
Taylor expanded in x around inf
Simplified51.9%
Taylor expanded in y around inf
Simplified44.8%
+-commutativeN/A
accelerator-lowering-fma.f6444.8
Applied egg-rr44.8%
if 2.6499999999999999e-95 < t < 5.5000000000000002e48Initial program 99.9%
Taylor expanded in y around inf
*-lowering-*.f64N/A
--lowering--.f6452.0
Simplified52.0%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (+ x (* (- (+ y t) 2.0) b)))) (if (<= b -2.7e+32) t_1 (if (<= b 4.1e-58) (fma z (- 1.0 y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (((y + t) - 2.0) * b);
double tmp;
if (b <= -2.7e+32) {
tmp = t_1;
} else if (b <= 4.1e-58) {
tmp = fma(z, (1.0 - y), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(Float64(Float64(y + t) - 2.0) * b)) tmp = 0.0 if (b <= -2.7e+32) tmp = t_1; elseif (b <= 4.1e-58) tmp = fma(z, Float64(1.0 - y), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[(N[(y + t), $MachinePrecision] - 2.0), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.7e+32], t$95$1, If[LessEqual[b, 4.1e-58], N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \left(\left(y + t\right) - 2\right) \cdot b\\
\mathbf{if}\;b \leq -2.7 \cdot 10^{+32}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 4.1 \cdot 10^{-58}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.70000000000000013e32 or 4.10000000000000028e-58 < b Initial program 89.7%
Taylor expanded in x around inf
Simplified70.8%
if -2.70000000000000013e32 < b < 4.10000000000000028e-58Initial program 99.3%
*-commutativeN/A
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
metadata-eval99.3
Applied egg-rr99.3%
Taylor expanded in b around 0
Simplified95.9%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6465.6
Simplified65.6%
(FPCore (x y z t a b) :precision binary64 (if (<= b -3.2e+33) (* y b) (if (<= b 5.7e-36) x (if (<= b 4.2e+239) (* y b) (* t b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -3.2e+33) {
tmp = y * b;
} else if (b <= 5.7e-36) {
tmp = x;
} else if (b <= 4.2e+239) {
tmp = y * b;
} else {
tmp = t * 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 (b <= (-3.2d+33)) then
tmp = y * b
else if (b <= 5.7d-36) then
tmp = x
else if (b <= 4.2d+239) then
tmp = y * b
else
tmp = t * 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 (b <= -3.2e+33) {
tmp = y * b;
} else if (b <= 5.7e-36) {
tmp = x;
} else if (b <= 4.2e+239) {
tmp = y * b;
} else {
tmp = t * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -3.2e+33: tmp = y * b elif b <= 5.7e-36: tmp = x elif b <= 4.2e+239: tmp = y * b else: tmp = t * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -3.2e+33) tmp = Float64(y * b); elseif (b <= 5.7e-36) tmp = x; elseif (b <= 4.2e+239) tmp = Float64(y * b); else tmp = Float64(t * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -3.2e+33) tmp = y * b; elseif (b <= 5.7e-36) tmp = x; elseif (b <= 4.2e+239) tmp = y * b; else tmp = t * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -3.2e+33], N[(y * b), $MachinePrecision], If[LessEqual[b, 5.7e-36], x, If[LessEqual[b, 4.2e+239], N[(y * b), $MachinePrecision], N[(t * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.2 \cdot 10^{+33}:\\
\;\;\;\;y \cdot b\\
\mathbf{elif}\;b \leq 5.7 \cdot 10^{-36}:\\
\;\;\;\;x\\
\mathbf{elif}\;b \leq 4.2 \cdot 10^{+239}:\\
\;\;\;\;y \cdot b\\
\mathbf{else}:\\
\;\;\;\;t \cdot b\\
\end{array}
\end{array}
if b < -3.20000000000000017e33 or 5.6999999999999999e-36 < b < 4.1999999999999998e239Initial program 92.1%
Taylor expanded in x around inf
Simplified69.1%
Taylor expanded in y around inf
*-lowering-*.f6441.4
Simplified41.4%
if -3.20000000000000017e33 < b < 5.6999999999999999e-36Initial program 99.3%
Taylor expanded in x around inf
Simplified24.5%
if 4.1999999999999998e239 < b Initial program 63.6%
Taylor expanded in t around inf
*-lowering-*.f64N/A
--lowering--.f6482.8
Simplified82.8%
Taylor expanded in b around inf
Simplified73.8%
Final simplification33.3%
(FPCore (x y z t a b) :precision binary64 (if (<= b -2e+35) (fma b (+ y -2.0) x) (if (<= b 1.15e+126) (fma z (- 1.0 y) x) (* b (+ y (+ t -2.0))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -2e+35) {
tmp = fma(b, (y + -2.0), x);
} else if (b <= 1.15e+126) {
tmp = fma(z, (1.0 - y), x);
} else {
tmp = b * (y + (t + -2.0));
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -2e+35) tmp = fma(b, Float64(y + -2.0), x); elseif (b <= 1.15e+126) tmp = fma(z, Float64(1.0 - y), x); else tmp = Float64(b * Float64(y + Float64(t + -2.0))); end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -2e+35], N[(b * N[(y + -2.0), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[b, 1.15e+126], N[(z * N[(1.0 - y), $MachinePrecision] + x), $MachinePrecision], N[(b * N[(y + N[(t + -2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -2 \cdot 10^{+35}:\\
\;\;\;\;\mathsf{fma}\left(b, y + -2, x\right)\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+126}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - y, x\right)\\
\mathbf{else}:\\
\;\;\;\;b \cdot \left(y + \left(t + -2\right)\right)\\
\end{array}
\end{array}
if b < -1.9999999999999999e35Initial program 95.6%
Taylor expanded in x around inf
Simplified82.7%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval70.0
Simplified70.0%
if -1.9999999999999999e35 < b < 1.15e126Initial program 98.3%
*-commutativeN/A
sub-negN/A
distribute-lft-inN/A
accelerator-lowering-fma.f64N/A
*-lowering-*.f64N/A
metadata-eval98.3
Applied egg-rr98.3%
Taylor expanded in b around 0
Simplified89.5%
Taylor expanded in a around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
--lowering--.f6460.5
Simplified60.5%
if 1.15e126 < b Initial program 78.4%
Taylor expanded in b around inf
*-lowering-*.f64N/A
+-commutativeN/A
associate-+r-N/A
+-lowering-+.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval76.3
Simplified76.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (- 1.0 y)))) (if (<= z -3.5e+108) t_1 (if (<= z 2e+108) (fma b (+ y -2.0) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - y);
double tmp;
if (z <= -3.5e+108) {
tmp = t_1;
} else if (z <= 2e+108) {
tmp = fma(b, (y + -2.0), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - y)) tmp = 0.0 if (z <= -3.5e+108) tmp = t_1; elseif (z <= 2e+108) tmp = fma(b, Float64(y + -2.0), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.5e+108], t$95$1, If[LessEqual[z, 2e+108], N[(b * N[(y + -2.0), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -3.5 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2 \cdot 10^{+108}:\\
\;\;\;\;\mathsf{fma}\left(b, y + -2, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.5000000000000002e108 or 2.0000000000000001e108 < z Initial program 91.0%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
neg-mul-1N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
sub-negN/A
--lowering--.f6470.3
Simplified70.3%
if -3.5000000000000002e108 < z < 2.0000000000000001e108Initial program 97.0%
Taylor expanded in x around inf
Simplified59.6%
Taylor expanded in t around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
+-lowering-+.f64N/A
metadata-eval48.9
Simplified48.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (- 1.0 y)))) (if (<= z -3.8e+108) t_1 (if (<= z 1.26e+108) (fma y b x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - y);
double tmp;
if (z <= -3.8e+108) {
tmp = t_1;
} else if (z <= 1.26e+108) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - y)) tmp = 0.0 if (z <= -3.8e+108) tmp = t_1; elseif (z <= 1.26e+108) tmp = fma(y, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.8e+108], t$95$1, If[LessEqual[z, 1.26e+108], N[(y * b + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - y\right)\\
\mathbf{if}\;z \leq -3.8 \cdot 10^{+108}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.26 \cdot 10^{+108}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -3.80000000000000008e108 or 1.2600000000000001e108 < z Initial program 91.0%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
neg-mul-1N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
sub-negN/A
--lowering--.f6470.3
Simplified70.3%
if -3.80000000000000008e108 < z < 1.2600000000000001e108Initial program 97.0%
Taylor expanded in x around inf
Simplified59.6%
Taylor expanded in y around inf
Simplified43.1%
+-commutativeN/A
accelerator-lowering-fma.f6443.1
Applied egg-rr43.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* t (- b a)))) (if (<= t -2.8e+39) t_1 (if (<= t 6e+20) (fma y b x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = t * (b - a);
double tmp;
if (t <= -2.8e+39) {
tmp = t_1;
} else if (t <= 6e+20) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(t * Float64(b - a)) tmp = 0.0 if (t <= -2.8e+39) tmp = t_1; elseif (t <= 6e+20) tmp = fma(y, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(t * N[(b - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -2.8e+39], t$95$1, If[LessEqual[t, 6e+20], N[(y * b + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := t \cdot \left(b - a\right)\\
\mathbf{if}\;t \leq -2.8 \cdot 10^{+39}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 6 \cdot 10^{+20}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.80000000000000001e39 or 6e20 < t Initial program 89.7%
Taylor expanded in t around inf
*-lowering-*.f64N/A
--lowering--.f6460.7
Simplified60.7%
if -2.80000000000000001e39 < t < 6e20Initial program 99.3%
Taylor expanded in x around inf
Simplified49.7%
Taylor expanded in y around inf
Simplified42.9%
+-commutativeN/A
accelerator-lowering-fma.f6442.9
Applied egg-rr42.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* a (- 1.0 t)))) (if (<= a -6.8) t_1 (if (<= a 3.7e+62) (fma y b x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (1.0 - t);
double tmp;
if (a <= -6.8) {
tmp = t_1;
} else if (a <= 3.7e+62) {
tmp = fma(y, b, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(a * Float64(1.0 - t)) tmp = 0.0 if (a <= -6.8) tmp = t_1; elseif (a <= 3.7e+62) tmp = fma(y, b, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(a * N[(1.0 - t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -6.8], t$95$1, If[LessEqual[a, 3.7e+62], N[(y * b + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := a \cdot \left(1 - t\right)\\
\mathbf{if}\;a \leq -6.8:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.7 \cdot 10^{+62}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if a < -6.79999999999999982 or 3.70000000000000014e62 < a Initial program 90.5%
Taylor expanded in a around inf
sub-negN/A
neg-mul-1N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f6453.2
Simplified53.2%
if -6.79999999999999982 < a < 3.70000000000000014e62Initial program 98.6%
Taylor expanded in x around inf
Simplified63.0%
Taylor expanded in y around inf
Simplified45.4%
+-commutativeN/A
accelerator-lowering-fma.f6445.4
Applied egg-rr45.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -1.25e+42) x (if (<= x 5.4e+55) z x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -1.25e+42) {
tmp = x;
} else if (x <= 5.4e+55) {
tmp = z;
} 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 <= (-1.25d+42)) then
tmp = x
else if (x <= 5.4d+55) then
tmp = z
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 <= -1.25e+42) {
tmp = x;
} else if (x <= 5.4e+55) {
tmp = z;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -1.25e+42: tmp = x elif x <= 5.4e+55: tmp = z else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -1.25e+42) tmp = x; elseif (x <= 5.4e+55) tmp = z; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -1.25e+42) tmp = x; elseif (x <= 5.4e+55) tmp = z; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -1.25e+42], x, If[LessEqual[x, 5.4e+55], z, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.25 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 5.4 \cdot 10^{+55}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.25000000000000002e42 or 5.39999999999999954e55 < x Initial program 94.0%
Taylor expanded in x around inf
Simplified36.5%
if -1.25000000000000002e42 < x < 5.39999999999999954e55Initial program 95.7%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
neg-mul-1N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
sub-negN/A
--lowering--.f6443.2
Simplified43.2%
Taylor expanded in y around 0
Simplified21.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.5e+42) x (if (<= x 1.7e+53) a x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.5e+42) {
tmp = x;
} else if (x <= 1.7e+53) {
tmp = 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 <= (-3.5d+42)) then
tmp = x
else if (x <= 1.7d+53) then
tmp = 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 <= -3.5e+42) {
tmp = x;
} else if (x <= 1.7e+53) {
tmp = a;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.5e+42: tmp = x elif x <= 1.7e+53: tmp = a else: tmp = x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.5e+42) tmp = x; elseif (x <= 1.7e+53) tmp = a; else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.5e+42) tmp = x; elseif (x <= 1.7e+53) tmp = a; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.5e+42], x, If[LessEqual[x, 1.7e+53], a, x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.5 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.7 \cdot 10^{+53}:\\
\;\;\;\;a\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -3.50000000000000023e42 or 1.69999999999999999e53 < x Initial program 93.9%
Taylor expanded in x around inf
Simplified36.8%
if -3.50000000000000023e42 < x < 1.69999999999999999e53Initial program 95.7%
Taylor expanded in a around inf
sub-negN/A
neg-mul-1N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f6435.8
Simplified35.8%
Taylor expanded in t around 0
Simplified18.2%
(FPCore (x y z t a b) :precision binary64 (if (<= z 5.5e+153) (fma y b x) z))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= 5.5e+153) {
tmp = fma(y, b, x);
} else {
tmp = z;
}
return tmp;
}
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= 5.5e+153) tmp = fma(y, b, x); else tmp = z; end return tmp end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, 5.5e+153], N[(y * b + x), $MachinePrecision], z]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 5.5 \cdot 10^{+153}:\\
\;\;\;\;\mathsf{fma}\left(y, b, x\right)\\
\mathbf{else}:\\
\;\;\;\;z\\
\end{array}
\end{array}
if z < 5.5000000000000003e153Initial program 96.0%
Taylor expanded in x around inf
Simplified52.0%
Taylor expanded in y around inf
Simplified37.2%
+-commutativeN/A
accelerator-lowering-fma.f6437.2
Applied egg-rr37.2%
if 5.5000000000000003e153 < z Initial program 87.5%
Taylor expanded in z around inf
sub-negN/A
metadata-evalN/A
neg-mul-1N/A
distribute-lft-inN/A
+-commutativeN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-lft-inN/A
metadata-evalN/A
neg-mul-1N/A
sub-negN/A
--lowering--.f6478.8
Simplified78.8%
Taylor expanded in y around 0
Simplified43.1%
(FPCore (x y z t a b) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b) {
return 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 = a
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return a;
}
def code(x, y, z, t, a, b): return a
function code(x, y, z, t, a, b) return a end
function tmp = code(x, y, z, t, a, b) tmp = a; end
code[x_, y_, z_, t_, a_, b_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 94.9%
Taylor expanded in a around inf
sub-negN/A
neg-mul-1N/A
+-commutativeN/A
metadata-evalN/A
distribute-lft-inN/A
metadata-evalN/A
sub-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
metadata-evalN/A
+-commutativeN/A
distribute-neg-inN/A
metadata-evalN/A
sub-negN/A
--lowering--.f6428.4
Simplified28.4%
Taylor expanded in t around 0
Simplified12.0%
herbie shell --seed 2024195
(FPCore (x y z t a b)
:name "Statistics.Distribution.Beta:$centropy from math-functions-0.1.5.2"
:precision binary64
(+ (- (- x (* (- y 1.0) z)) (* (- t 1.0) a)) (* (- (+ y t) 2.0) b)))