
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * 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) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 19 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * log(t))) + ((a - 0.5) * 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) - (z * log(t))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (((x + y) + z) - (z * Math.log(t))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return (((x + y) + z) - (z * math.log(t))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(Float64(x + y) + z) - Float64(z * log(t))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (((x + y) + z) - (z * log(t))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(N[(x + y), $MachinePrecision] + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(x + y\right) + z\right) - z \cdot \log t\right) + \left(a - 0.5\right) \cdot b
\end{array}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ y (fma z (- 1.0 (log t)) (fma b (+ a -0.5) x))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return y + fma(z, (1.0 - log(t)), fma(b, (a + -0.5), x));
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(y + fma(z, Float64(1.0 - log(t)), fma(b, Float64(a + -0.5), x))) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
y + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(b, a + -0.5, x\right)\right)
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (+ y (fma b (+ a -0.5) x))))
(if (<= t_1 -1e+158)
t_2
(if (<= t_1 2e+118) (+ x (fma b -0.5 (fma z (- 1.0 (log t)) y))) t_2))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = y + fma(b, (a + -0.5), x);
double tmp;
if (t_1 <= -1e+158) {
tmp = t_2;
} else if (t_1 <= 2e+118) {
tmp = x + fma(b, -0.5, fma(z, (1.0 - log(t)), y));
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(y + fma(b, Float64(a + -0.5), x)) tmp = 0.0 if (t_1 <= -1e+158) tmp = t_2; elseif (t_1 <= 2e+118) tmp = Float64(x + fma(b, -0.5, fma(z, Float64(1.0 - log(t)), y))); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+158], t$95$2, If[LessEqual[t$95$1, 2e+118], N[(x + N[(b * -0.5 + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+158}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+118}:\\
\;\;\;\;x + \mathsf{fma}\left(b, -0.5, \mathsf{fma}\left(z, 1 - \log t, y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.99999999999999953e157 or 1.99999999999999993e118 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6495.1
Simplified95.1%
if -9.99999999999999953e157 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999993e118Initial program 99.8%
Taylor expanded in a around 0
associate--l+N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate--l+N/A
*-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
accelerator-lowering-fma.f64N/A
cancel-sign-sub-invN/A
associate-+l+N/A
cancel-sign-sub-invN/A
Simplified93.9%
Final simplification94.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))) (t_2 (+ y (fma b (+ a -0.5) x))))
(if (<= t_1 -4e+109)
t_2
(if (<= t_1 2e+118) (fma z (- 1.0 (log t)) (+ y x)) t_2))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = y + fma(b, (a + -0.5), x);
double tmp;
if (t_1 <= -4e+109) {
tmp = t_2;
} else if (t_1 <= 2e+118) {
tmp = fma(z, (1.0 - log(t)), (y + x));
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(y + fma(b, Float64(a + -0.5), x)) tmp = 0.0 if (t_1 <= -4e+109) tmp = t_2; elseif (t_1 <= 2e+118) tmp = fma(z, Float64(1.0 - log(t)), Float64(y + x)); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+109], t$95$2, If[LessEqual[t$95$1, 2e+118], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+109}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+118}:\\
\;\;\;\;\mathsf{fma}\left(z, 1 - \log t, y + x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -3.99999999999999993e109 or 1.99999999999999993e118 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6493.3
Simplified93.3%
if -3.99999999999999993e109 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999993e118Initial program 99.8%
Taylor expanded in b around 0
cancel-sign-sub-invN/A
associate-+r+N/A
associate-+l+N/A
cancel-sign-sub-invN/A
*-rgt-identityN/A
distribute-lft-out--N/A
+-commutativeN/A
sub-negN/A
mul-1-negN/A
accelerator-lowering-fma.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f64N/A
+-commutativeN/A
+-lowering-+.f6490.7
Simplified90.7%
Final simplification92.0%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ (* b (- a 0.5)) (- (+ z (+ y x)) (* z (log t)))) -5e-151) x y))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((b * (a - 0.5)) + ((z + (y + x)) - (z * log(t)))) <= -5e-151) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 * (a - 0.5d0)) + ((z + (y + x)) - (z * log(t)))) <= (-5d-151)) then
tmp = x
else
tmp = y
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((b * (a - 0.5)) + ((z + (y + x)) - (z * Math.log(t)))) <= -5e-151) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if ((b * (a - 0.5)) + ((z + (y + x)) - (z * math.log(t)))) <= -5e-151: tmp = x else: tmp = y return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(b * Float64(a - 0.5)) + Float64(Float64(z + Float64(y + x)) - Float64(z * log(t)))) <= -5e-151) tmp = x; else tmp = y; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (((b * (a - 0.5)) + ((z + (y + x)) - (z * log(t)))) <= -5e-151)
tmp = x;
else
tmp = y;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -5e-151], x, y]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \cdot \left(a - 0.5\right) + \left(\left(z + \left(y + x\right)\right) - z \cdot \log t\right) \leq -5 \cdot 10^{-151}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) < -5.00000000000000003e-151Initial program 99.9%
Taylor expanded in x around inf
Simplified16.5%
if -5.00000000000000003e-151 < (+.f64 (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) (*.f64 (-.f64 a #s(literal 1/2 binary64)) b)) Initial program 99.9%
Taylor expanded in y around inf
Simplified19.9%
Final simplification18.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (- (+ z (+ y x)) (* z (log t))) -1e-151) (fma b (+ a -0.5) x) (fma b (+ a -0.5) y)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((z + (y + x)) - (z * log(t))) <= -1e-151) {
tmp = fma(b, (a + -0.5), x);
} else {
tmp = fma(b, (a + -0.5), y);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(Float64(z + Float64(y + x)) - Float64(z * log(t))) <= -1e-151) tmp = fma(b, Float64(a + -0.5), x); else tmp = fma(b, Float64(a + -0.5), y); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(N[(z + N[(y + x), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], -1e-151], N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision], N[(b * N[(a + -0.5), $MachinePrecision] + y), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;\left(z + \left(y + x\right)\right) - z \cdot \log t \leq -1 \cdot 10^{-151}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, y\right)\\
\end{array}
\end{array}
if (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) < -9.9999999999999994e-152Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6478.7
Simplified78.7%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6456.1
Simplified56.1%
if -9.9999999999999994e-152 < (-.f64 (+.f64 (+.f64 x y) z) (*.f64 z (log.f64 t))) Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6483.7
Simplified83.7%
Taylor expanded in x around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6461.4
Simplified61.4%
Final simplification58.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (fma (log t) (- z) z))))
(if (<= z -4.5e+158)
t_1
(if (<= z 1.55e+180) (+ y (fma b (+ a -0.5) x)) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + fma(log(t), -z, z);
double tmp;
if (z <= -4.5e+158) {
tmp = t_1;
} else if (z <= 1.55e+180) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(y + fma(log(t), Float64(-z), z)) tmp = 0.0 if (z <= -4.5e+158) tmp = t_1; elseif (z <= 1.55e+180) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(N[Log[t], $MachinePrecision] * (-z) + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -4.5e+158], t$95$1, If[LessEqual[z, 1.55e+180], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := y + \mathsf{fma}\left(\log t, -z, z\right)\\
\mathbf{if}\;z \leq -4.5 \cdot 10^{+158}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.55 \cdot 10^{+180}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -4.50000000000000046e158 or 1.54999999999999999e180 < z Initial program 99.7%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.8%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
associate-*l*N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
mul-1-negN/A
neg-lowering-neg.f6469.4
Simplified69.4%
if -4.50000000000000046e158 < z < 1.54999999999999999e180Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6491.3
Simplified91.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (fma (log t) (- z) z))))
(if (<= z -2.5e+194)
t_1
(if (<= z 4.4e+182) (+ y (fma b (+ a -0.5) x)) t_1))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + fma(log(t), -z, z);
double tmp;
if (z <= -2.5e+194) {
tmp = t_1;
} else if (z <= 4.4e+182) {
tmp = y + fma(b, (a + -0.5), x);
} else {
tmp = t_1;
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(x + fma(log(t), Float64(-z), z)) tmp = 0.0 if (z <= -2.5e+194) tmp = t_1; elseif (z <= 4.4e+182) tmp = Float64(y + fma(b, Float64(a + -0.5), x)); else tmp = t_1; end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(N[Log[t], $MachinePrecision] * (-z) + z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -2.5e+194], t$95$1, If[LessEqual[z, 4.4e+182], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := x + \mathsf{fma}\left(\log t, -z, z\right)\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{+194}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.4 \cdot 10^{+182}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -2.49999999999999994e194 or 4.39999999999999993e182 < z Initial program 99.7%
Taylor expanded in a around 0
associate--l+N/A
+-lowering-+.f64N/A
associate-+r+N/A
+-commutativeN/A
remove-double-negN/A
log-recN/A
distribute-rgt-neg-inN/A
mul-1-negN/A
associate--l+N/A
*-commutativeN/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
accelerator-lowering-fma.f64N/A
cancel-sign-sub-invN/A
associate-+l+N/A
cancel-sign-sub-invN/A
Simplified80.7%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
associate-*l*N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
mul-1-negN/A
neg-lowering-neg.f6470.1
Simplified70.1%
if -2.49999999999999994e194 < z < 4.39999999999999993e182Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.6
Simplified89.6%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1e+193) (fma (log t) (- z) z) (+ y (fma b (+ a -0.5) x))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1e+193) {
tmp = fma(log(t), -z, z);
} else {
tmp = y + fma(b, (a + -0.5), x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1e+193) tmp = fma(log(t), Float64(-z), z); else tmp = Float64(y + fma(b, Float64(a + -0.5), x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1e+193], N[(N[Log[t], $MachinePrecision] * (-z) + z), $MachinePrecision], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1 \cdot 10^{+193}:\\
\;\;\;\;\mathsf{fma}\left(\log t, -z, z\right)\\
\mathbf{else}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\end{array}
\end{array}
if z < -1.00000000000000007e193Initial program 99.6%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.7%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
+-commutativeN/A
distribute-rgt-inN/A
*-lft-identityN/A
associate-*l*N/A
metadata-evalN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
log-recN/A
remove-double-negN/A
associate-*l*N/A
*-lft-identityN/A
accelerator-lowering-fma.f64N/A
log-lowering-log.f64N/A
mul-1-negN/A
neg-lowering-neg.f6471.5
Simplified71.5%
if -1.00000000000000007e193 < z Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6485.8
Simplified85.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -1.3e+195) (- z (* z (log t))) (+ y (fma b (+ a -0.5) x))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -1.3e+195) {
tmp = z - (z * log(t));
} else {
tmp = y + fma(b, (a + -0.5), x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -1.3e+195) tmp = Float64(z - Float64(z * log(t))); else tmp = Float64(y + fma(b, Float64(a + -0.5), x)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -1.3e+195], N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.3 \cdot 10^{+195}:\\
\;\;\;\;z - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;y + \mathsf{fma}\left(b, a + -0.5, x\right)\\
\end{array}
\end{array}
if z < -1.30000000000000001e195Initial program 99.6%
Taylor expanded in z around inf
sub-negN/A
log-recN/A
distribute-lft-inN/A
*-rgt-identityN/A
remove-double-negN/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
log-recN/A
remove-double-negN/A
*-lowering-*.f64N/A
log-lowering-log.f6471.5
Simplified71.5%
if -1.30000000000000001e195 < z Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6485.8
Simplified85.8%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -5e+301)
(* b a)
(if (<= t_1 -1e+168)
(fma b -0.5 x)
(if (<= t_1 2e+181) (+ y x) (fma b a x))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -5e+301) {
tmp = b * a;
} else if (t_1 <= -1e+168) {
tmp = fma(b, -0.5, x);
} else if (t_1 <= 2e+181) {
tmp = y + x;
} else {
tmp = fma(b, a, x);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -5e+301) tmp = Float64(b * a); elseif (t_1 <= -1e+168) tmp = fma(b, -0.5, x); elseif (t_1 <= 2e+181) tmp = Float64(y + x); else tmp = fma(b, a, x); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+301], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, -1e+168], N[(b * -0.5 + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+181], N[(y + x), $MachinePrecision], N[(b * a + x), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+301}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+181}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(b, a, x\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e301Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f64100.0
Simplified100.0%
if -5.0000000000000004e301 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.9999999999999993e167Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.1
Simplified89.1%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6481.7
Simplified81.7%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6456.3
Simplified56.3%
if -9.9999999999999993e167 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e181Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified59.6%
if 1.9999999999999998e181 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6498.0
Simplified98.0%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6495.8
Simplified95.8%
Taylor expanded in a around inf
Simplified76.1%
Final simplification65.1%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -5e+301)
(* b a)
(if (<= t_1 -1e+168)
(fma b -0.5 x)
(if (<= t_1 2e+181) (+ y x) (* b a))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -5e+301) {
tmp = b * a;
} else if (t_1 <= -1e+168) {
tmp = fma(b, -0.5, x);
} else if (t_1 <= 2e+181) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -5e+301) tmp = Float64(b * a); elseif (t_1 <= -1e+168) tmp = fma(b, -0.5, x); elseif (t_1 <= 2e+181) tmp = Float64(y + x); else tmp = Float64(b * a); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+301], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, -1e+168], N[(b * -0.5 + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+181], N[(y + x), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+301}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+168}:\\
\;\;\;\;\mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+181}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e301 or 1.9999999999999998e181 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6481.5
Simplified81.5%
if -5.0000000000000004e301 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.9999999999999993e167Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.1
Simplified89.1%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6481.7
Simplified81.7%
Taylor expanded in a around 0
+-commutativeN/A
*-commutativeN/A
accelerator-lowering-fma.f6456.3
Simplified56.3%
if -9.9999999999999993e167 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e181Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified59.6%
Final simplification64.7%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -5e+301)
(* b a)
(if (<= t_1 -1e+168) (* b -0.5) (if (<= t_1 2e+181) (+ y x) (* b a))))))assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -5e+301) {
tmp = b * a;
} else if (t_1 <= -1e+168) {
tmp = b * -0.5;
} else if (t_1 <= 2e+181) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
if (t_1 <= (-5d+301)) then
tmp = b * a
else if (t_1 <= (-1d+168)) then
tmp = b * (-0.5d0)
else if (t_1 <= 2d+181) then
tmp = y + x
else
tmp = b * a
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -5e+301) {
tmp = b * a;
} else if (t_1 <= -1e+168) {
tmp = b * -0.5;
} else if (t_1 <= 2e+181) {
tmp = y + x;
} else {
tmp = b * a;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -5e+301: tmp = b * a elif t_1 <= -1e+168: tmp = b * -0.5 elif t_1 <= 2e+181: tmp = y + x else: tmp = b * a return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -5e+301) tmp = Float64(b * a); elseif (t_1 <= -1e+168) tmp = Float64(b * -0.5); elseif (t_1 <= 2e+181) tmp = Float64(y + x); else tmp = Float64(b * a); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if (t_1 <= -5e+301)
tmp = b * a;
elseif (t_1 <= -1e+168)
tmp = b * -0.5;
elseif (t_1 <= 2e+181)
tmp = y + x;
else
tmp = b * a;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+301], N[(b * a), $MachinePrecision], If[LessEqual[t$95$1, -1e+168], N[(b * -0.5), $MachinePrecision], If[LessEqual[t$95$1, 2e+181], N[(y + x), $MachinePrecision], N[(b * a), $MachinePrecision]]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+301}:\\
\;\;\;\;b \cdot a\\
\mathbf{elif}\;t\_1 \leq -1 \cdot 10^{+168}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+181}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot a\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -5.0000000000000004e301 or 1.9999999999999998e181 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6481.5
Simplified81.5%
if -5.0000000000000004e301 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -9.9999999999999993e167Initial program 99.9%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6473.4
Simplified73.4%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f6447.7
Simplified47.7%
if -9.9999999999999993e167 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e181Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified59.6%
Final simplification63.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5))) (t_2 (* b (+ a -0.5)))) (if (<= t_1 -4e+158) t_2 (if (<= t_1 2e+181) (+ y (fma b -0.5 x)) t_2))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = b * (a + -0.5);
double tmp;
if (t_1 <= -4e+158) {
tmp = t_2;
} else if (t_1 <= 2e+181) {
tmp = y + fma(b, -0.5, x);
} else {
tmp = t_2;
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(b * Float64(a + -0.5)) tmp = 0.0 if (t_1 <= -4e+158) tmp = t_2; elseif (t_1 <= 2e+181) tmp = Float64(y + fma(b, -0.5, x)); else tmp = t_2; end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+158], t$95$2, If[LessEqual[t$95$1, 2e+181], N[(y + N[(b * -0.5 + x), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+158}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+181}:\\
\;\;\;\;y + \mathsf{fma}\left(b, -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -3.99999999999999981e158 or 1.9999999999999998e181 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6487.8
Simplified87.8%
if -3.99999999999999981e158 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999998e181Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6472.1
Simplified72.1%
Taylor expanded in a around 0
Simplified65.6%
Final simplification74.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5))) (t_2 (* b (+ a -0.5)))) (if (<= t_1 -4e+158) t_2 (if (<= t_1 2e+159) (+ y x) t_2))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = b * (a + -0.5);
double tmp;
if (t_1 <= -4e+158) {
tmp = t_2;
} else if (t_1 <= 2e+159) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = b * (a - 0.5d0)
t_2 = b * (a + (-0.5d0))
if (t_1 <= (-4d+158)) then
tmp = t_2
else if (t_1 <= 2d+159) then
tmp = y + x
else
tmp = t_2
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double t_2 = b * (a + -0.5);
double tmp;
if (t_1 <= -4e+158) {
tmp = t_2;
} else if (t_1 <= 2e+159) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) t_2 = b * (a + -0.5) tmp = 0 if t_1 <= -4e+158: tmp = t_2 elif t_1 <= 2e+159: tmp = y + x else: tmp = t_2 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) t_2 = Float64(b * Float64(a + -0.5)) tmp = 0.0 if (t_1 <= -4e+158) tmp = t_2; elseif (t_1 <= 2e+159) tmp = Float64(y + x); else tmp = t_2; end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
t_2 = b * (a + -0.5);
tmp = 0.0;
if (t_1 <= -4e+158)
tmp = t_2;
elseif (t_1 <= 2e+159)
tmp = y + x;
else
tmp = t_2;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a + -0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+158], t$95$2, If[LessEqual[t$95$1, 2e+159], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
t_2 := b \cdot \left(a + -0.5\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+158}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+159}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -3.99999999999999981e158 or 1.9999999999999999e159 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6485.8
Simplified85.8%
if -3.99999999999999981e158 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.9999999999999999e159Initial program 99.8%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified60.9%
Final simplification71.3%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ y x) 1e-61) (fma b (+ a -0.5) x) (+ y (* b a))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y + x) <= 1e-61) {
tmp = fma(b, (a + -0.5), x);
} else {
tmp = y + (b * a);
}
return tmp;
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(y + x) <= 1e-61) tmp = fma(b, Float64(a + -0.5), x); else tmp = Float64(y + Float64(b * a)); end return tmp end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(y + x), $MachinePrecision], 1e-61], N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision], N[(y + N[(b * a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;y + x \leq 10^{-61}:\\
\;\;\;\;\mathsf{fma}\left(b, a + -0.5, x\right)\\
\mathbf{else}:\\
\;\;\;\;y + b \cdot a\\
\end{array}
\end{array}
if (+.f64 x y) < 1e-61Initial program 99.8%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6477.3
Simplified77.3%
Taylor expanded in y around 0
+-commutativeN/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6457.4
Simplified57.4%
if 1e-61 < (+.f64 x y) Initial program 100.0%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6448.9
Simplified48.9%
Final simplification53.9%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -1.05e+197) (* b -0.5) (if (<= b 1.05e+172) (+ y x) (* b -0.5))))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.05e+197) {
tmp = b * -0.5;
} else if (b <= 1.05e+172) {
tmp = y + x;
} else {
tmp = b * -0.5;
}
return tmp;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 <= (-1.05d+197)) then
tmp = b * (-0.5d0)
else if (b <= 1.05d+172) then
tmp = y + x
else
tmp = b * (-0.5d0)
end if
code = tmp
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.05e+197) {
tmp = b * -0.5;
} else if (b <= 1.05e+172) {
tmp = y + x;
} else {
tmp = b * -0.5;
}
return tmp;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): tmp = 0 if b <= -1.05e+197: tmp = b * -0.5 elif b <= 1.05e+172: tmp = y + x else: tmp = b * -0.5 return tmp
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.05e+197) tmp = Float64(b * -0.5); elseif (b <= 1.05e+172) tmp = Float64(y + x); else tmp = Float64(b * -0.5); end return tmp end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -1.05e+197)
tmp = b * -0.5;
elseif (b <= 1.05e+172)
tmp = y + x;
else
tmp = b * -0.5;
end
tmp_2 = tmp;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.05e+197], N[(b * -0.5), $MachinePrecision], If[LessEqual[b, 1.05e+172], N[(y + x), $MachinePrecision], N[(b * -0.5), $MachinePrecision]]]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.05 \cdot 10^{+197}:\\
\;\;\;\;b \cdot -0.5\\
\mathbf{elif}\;b \leq 1.05 \cdot 10^{+172}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;b \cdot -0.5\\
\end{array}
\end{array}
if b < -1.05000000000000003e197 or 1.0500000000000001e172 < b Initial program 100.0%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6490.3
Simplified90.3%
Taylor expanded in a around 0
*-commutativeN/A
*-lowering-*.f6441.4
Simplified41.4%
if -1.05000000000000003e197 < b < 1.0500000000000001e172Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified50.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ y (fma b (+ a -0.5) x)))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return y + fma(b, (a + -0.5), x);
}
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(y + fma(b, Float64(a + -0.5), x)) end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(y + N[(b * N[(a + -0.5), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
y + \mathsf{fma}\left(b, a + -0.5, x\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
accelerator-lowering-fma.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6481.2
Simplified81.2%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ y x))
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return y + x;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
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 = y + x
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return y + x;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return y + x
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return Float64(y + x) end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = y + x;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
y + x
\end{array}
Initial program 99.9%
Taylor expanded in x around 0
associate-+r+N/A
associate--l+N/A
+-commutativeN/A
associate-+r+N/A
associate--l+N/A
+-lowering-+.f64N/A
*-commutativeN/A
cancel-sign-sub-invN/A
log-recN/A
*-commutativeN/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
associate-+r+N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified39.5%
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 x)
assert(x < y && y < z && z < t && t < a && a < b);
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function.
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
assert x < y && y < z && z < t && t < a && a < b;
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
[x, y, z, t, a, b] = sort([x, y, z, t, a, b]) def code(x, y, z, t, a, b): return x
x, y, z, t, a, b = sort([x, y, z, t, a, b]) function code(x, y, z, t, a, b) return x end
x, y, z, t, a, b = num2cell(sort([x, y, z, t, a, b])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x;
end
NOTE: x, y, z, t, a, and b should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
[x, y, z, t, a, b] = \mathsf{sort}([x, y, z, t, a, b])\\
\\
x
\end{array}
Initial program 99.9%
Taylor expanded in x around inf
Simplified20.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - pow(log(t), 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * 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 - (log(t) ** 2.0d0)) * z) / (1.0d0 + log(t)))) + ((a - 0.5d0) * b)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x + y) + (((1.0 - Math.pow(Math.log(t), 2.0)) * z) / (1.0 + Math.log(t)))) + ((a - 0.5) * b);
}
def code(x, y, z, t, a, b): return ((x + y) + (((1.0 - math.pow(math.log(t), 2.0)) * z) / (1.0 + math.log(t)))) + ((a - 0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(Float64(Float64(1.0 - (log(t) ^ 2.0)) * z) / Float64(1.0 + log(t)))) + Float64(Float64(a - 0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = ((x + y) + (((1.0 - (log(t) ^ 2.0)) * z) / (1.0 + log(t)))) + ((a - 0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(N[(N[(1.0 - N[Power[N[Log[t], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] * z), $MachinePrecision] / N[(1.0 + N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a - 0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x + y\right) + \frac{\left(1 - {\log t}^{2}\right) \cdot z}{1 + \log t}\right) + \left(a - 0.5\right) \cdot b
\end{array}
herbie shell --seed 2024199
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))