
(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 17 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 and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ x (fma z (- 1.0 (log t)) (fma (+ a -0.5) b y))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return x + fma(z, (1.0 - log(t)), fma((a + -0.5), b, y));
}
x, y = sort([x, y]) function code(x, y, z, t, a, b) return Float64(x + fma(z, Float64(1.0 - log(t)), fma(Float64(a + -0.5), b, y))) end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x + \mathsf{fma}\left(z, 1 - \log t, \mathsf{fma}\left(a + -0.5, b, y\right)\right)
\end{array}
Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
NOTE: x and y 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 (or (<= t_1 -5e+189) (not (<= t_1 1e+99)))
(+ (- z (* z (log t))) (* (+ a -0.5) b))
(+ (+ x y) (* z (- 1.0 (log t)))))))assert(x < y);
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+189) || !(t_1 <= 1e+99)) {
tmp = (z - (z * log(t))) + ((a + -0.5) * b);
} else {
tmp = (x + y) + (z * (1.0 - log(t)));
}
return tmp;
}
NOTE: x and y 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+189)) .or. (.not. (t_1 <= 1d+99))) then
tmp = (z - (z * log(t))) + ((a + (-0.5d0)) * b)
else
tmp = (x + y) + (z * (1.0d0 - log(t)))
end if
code = tmp
end function
assert x < y;
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+189) || !(t_1 <= 1e+99)) {
tmp = (z - (z * Math.log(t))) + ((a + -0.5) * b);
} else {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e+189) or not (t_1 <= 1e+99): tmp = (z - (z * math.log(t))) + ((a + -0.5) * b) else: tmp = (x + y) + (z * (1.0 - math.log(t))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -5e+189) || !(t_1 <= 1e+99)) tmp = Float64(Float64(z - Float64(z * log(t))) + Float64(Float64(a + -0.5) * b)); else tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if ((t_1 <= -5e+189) || ~((t_1 <= 1e+99)))
tmp = (z - (z * log(t))) + ((a + -0.5) * b);
else
tmp = (x + y) + (z * (1.0 - log(t)));
end
tmp_2 = tmp;
end
NOTE: x and y 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[Or[LessEqual[t$95$1, -5e+189], N[Not[LessEqual[t$95$1, 1e+99]], $MachinePrecision]], N[(N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+189} \lor \neg \left(t_1 \leq 10^{+99}\right):\\
\;\;\;\;\left(z - z \cdot \log t\right) + \left(a + -0.5\right) \cdot b\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -5.0000000000000004e189 or 9.9999999999999997e98 < (*.f64 (-.f64 a 1/2) b) Initial program 100.0%
associate--l+100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around 0 94.1%
Taylor expanded in z around inf 91.1%
sub-neg91.1%
log-rec91.1%
+-commutative91.1%
distribute-rgt1-in91.1%
log-rec91.1%
cancel-sign-sub-inv91.1%
Simplified91.1%
if -5.0000000000000004e189 < (*.f64 (-.f64 a 1/2) b) < 9.9999999999999997e98Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 92.1%
Final simplification91.7%
NOTE: x and y 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 (or (<= t_1 -2e+159) (not (<= t_1 1e+91)))
(+ x (+ y t_1))
(+ (+ x y) (* z (- 1.0 (log t)))))))assert(x < y);
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 <= -2e+159) || !(t_1 <= 1e+91)) {
tmp = x + (y + t_1);
} else {
tmp = (x + y) + (z * (1.0 - log(t)));
}
return tmp;
}
NOTE: x and y 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 <= (-2d+159)) .or. (.not. (t_1 <= 1d+91))) then
tmp = x + (y + t_1)
else
tmp = (x + y) + (z * (1.0d0 - log(t)))
end if
code = tmp
end function
assert x < y;
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 <= -2e+159) || !(t_1 <= 1e+91)) {
tmp = x + (y + t_1);
} else {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+159) or not (t_1 <= 1e+91): tmp = x + (y + t_1) else: tmp = (x + y) + (z * (1.0 - math.log(t))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -2e+159) || !(t_1 <= 1e+91)) tmp = Float64(x + Float64(y + t_1)); else tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if ((t_1 <= -2e+159) || ~((t_1 <= 1e+91)))
tmp = x + (y + t_1);
else
tmp = (x + y) + (z * (1.0 - log(t)));
end
tmp_2 = tmp;
end
NOTE: x and y 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[Or[LessEqual[t$95$1, -2e+159], N[Not[LessEqual[t$95$1, 1e+91]], $MachinePrecision]], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+159} \lor \neg \left(t_1 \leq 10^{+91}\right):\\
\;\;\;\;x + \left(y + t_1\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -1.9999999999999999e159 or 1.00000000000000008e91 < (*.f64 (-.f64 a 1/2) b) Initial program 100.0%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 88.7%
if -1.9999999999999999e159 < (*.f64 (-.f64 a 1/2) b) < 1.00000000000000008e91Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 93.4%
Final simplification91.4%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 1e+31) (+ (* (+ a -0.5) b) (- (+ x z) (* z (log t)))) (+ x (+ y (* b (- a 0.5))))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 1e+31) {
tmp = ((a + -0.5) * b) + ((x + z) - (z * log(t)));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
NOTE: x and y 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 ((x + y) <= 1d+31) then
tmp = ((a + (-0.5d0)) * b) + ((x + z) - (z * log(t)))
else
tmp = x + (y + (b * (a - 0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 1e+31) {
tmp = ((a + -0.5) * b) + ((x + z) - (z * Math.log(t)));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 1e+31: tmp = ((a + -0.5) * b) + ((x + z) - (z * math.log(t))) else: tmp = x + (y + (b * (a - 0.5))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 1e+31) tmp = Float64(Float64(Float64(a + -0.5) * b) + Float64(Float64(x + z) - Float64(z * log(t)))); else tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x + y) <= 1e+31)
tmp = ((a + -0.5) * b) + ((x + z) - (z * log(t)));
else
tmp = x + (y + (b * (a - 0.5)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 1e+31], N[(N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision] + N[(N[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 10^{+31}:\\
\;\;\;\;\left(a + -0.5\right) \cdot b + \left(\left(x + z\right) - z \cdot \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 9.9999999999999996e30Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 82.5%
if 9.9999999999999996e30 < (+.f64 x y) Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 86.9%
Final simplification83.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ (+ (+ x y) (- z (* z (log t)))) (* (+ a -0.5) b)))
assert(x < y);
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);
}
NOTE: x and y 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 + y) + (z - (z * log(t)))) + ((a + (-0.5d0)) * b)
end function
assert x < y;
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);
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): return ((x + y) + (z - (z * math.log(t)))) + ((a + -0.5) * b)
x, y = sort([x, y]) function code(x, y, z, t, a, b) return Float64(Float64(Float64(x + y) + Float64(z - Float64(z * log(t)))) + Float64(Float64(a + -0.5) * b)) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b)
tmp = ((x + y) + (z - (z * log(t)))) + ((a + -0.5) * b);
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(x + y), $MachinePrecision] + N[(z - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\left(\left(x + y\right) + \left(z - z \cdot \log t\right)\right) + \left(a + -0.5\right) \cdot b
\end{array}
Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Final simplification99.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -2.3e+171) (not (<= z 3.15e+103))) (+ x (* z (- 1.0 (log t)))) (+ x (+ y (* b (- a 0.5))))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.3e+171) || !(z <= 3.15e+103)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
NOTE: x and y 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 ((z <= (-2.3d+171)) .or. (.not. (z <= 3.15d+103))) then
tmp = x + (z * (1.0d0 - log(t)))
else
tmp = x + (y + (b * (a - 0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -2.3e+171) || !(z <= 3.15e+103)) {
tmp = x + (z * (1.0 - Math.log(t)));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -2.3e+171) or not (z <= 3.15e+103): tmp = x + (z * (1.0 - math.log(t))) else: tmp = x + (y + (b * (a - 0.5))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -2.3e+171) || !(z <= 3.15e+103)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -2.3e+171) || ~((z <= 3.15e+103)))
tmp = x + (z * (1.0 - log(t)));
else
tmp = x + (y + (b * (a - 0.5)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -2.3e+171], N[Not[LessEqual[z, 3.15e+103]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.3 \cdot 10^{+171} \lor \neg \left(z \leq 3.15 \cdot 10^{+103}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -2.30000000000000017e171 or 3.14999999999999985e103 < z Initial program 99.6%
associate--l+99.6%
associate-+l+99.6%
associate-+l+99.6%
+-commutative99.6%
associate-+r+99.6%
+-commutative99.6%
+-commutative99.6%
*-commutative99.6%
cancel-sign-sub-inv99.6%
distribute-rgt1-in99.7%
*-commutative99.7%
fma-def99.7%
+-commutative99.7%
unsub-neg99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 68.6%
if -2.30000000000000017e171 < z < 3.14999999999999985e103Initial program 100.0%
associate--l+100.0%
associate-+l+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
+-commutative100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 94.5%
Final simplification86.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= z -9.2e+169) (+ x (* z (- 1.0 (log t)))) (if (<= z 3.5e+103) (+ x (+ y (* b (- a 0.5)))) (- (+ x z) (* z (log t))))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.2e+169) {
tmp = x + (z * (1.0 - log(t)));
} else if (z <= 3.5e+103) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (x + z) - (z * log(t));
}
return tmp;
}
NOTE: x and y 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 (z <= (-9.2d+169)) then
tmp = x + (z * (1.0d0 - log(t)))
else if (z <= 3.5d+103) then
tmp = x + (y + (b * (a - 0.5d0)))
else
tmp = (x + z) - (z * log(t))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -9.2e+169) {
tmp = x + (z * (1.0 - Math.log(t)));
} else if (z <= 3.5e+103) {
tmp = x + (y + (b * (a - 0.5)));
} else {
tmp = (x + z) - (z * Math.log(t));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if z <= -9.2e+169: tmp = x + (z * (1.0 - math.log(t))) elif z <= 3.5e+103: tmp = x + (y + (b * (a - 0.5))) else: tmp = (x + z) - (z * math.log(t)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -9.2e+169) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); elseif (z <= 3.5e+103) tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); else tmp = Float64(Float64(x + z) - Float64(z * log(t))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (z <= -9.2e+169)
tmp = x + (z * (1.0 - log(t)));
elseif (z <= 3.5e+103)
tmp = x + (y + (b * (a - 0.5)));
else
tmp = (x + z) - (z * log(t));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -9.2e+169], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.5e+103], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -9.2 \cdot 10^{+169}:\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{elif}\;z \leq 3.5 \cdot 10^{+103}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x + z\right) - z \cdot \log t\\
\end{array}
\end{array}
if z < -9.1999999999999997e169Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
*-commutative99.5%
cancel-sign-sub-inv99.5%
distribute-rgt1-in99.6%
*-commutative99.6%
fma-def99.6%
+-commutative99.6%
unsub-neg99.6%
fma-def99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in z around inf 72.4%
if -9.1999999999999997e169 < z < 3.5e103Initial program 100.0%
associate--l+100.0%
associate-+l+100.0%
associate-+l+100.0%
+-commutative100.0%
associate-+r+100.0%
+-commutative100.0%
+-commutative100.0%
*-commutative100.0%
cancel-sign-sub-inv100.0%
distribute-rgt1-in100.0%
*-commutative100.0%
fma-def100.0%
+-commutative100.0%
unsub-neg100.0%
fma-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in z around 0 94.5%
if 3.5e103 < z Initial program 99.7%
associate--l+99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in y around 0 86.6%
Taylor expanded in b around 0 66.5%
Final simplification86.8%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (or (<= z -3.2e+227) (not (<= z 4.8e+189))) (* z (- 1.0 (log t))) (+ x (+ y (* b (- a 0.5))))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e+227) || !(z <= 4.8e+189)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
NOTE: x and y 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 ((z <= (-3.2d+227)) .or. (.not. (z <= 4.8d+189))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + (b * (a - 0.5d0)))
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -3.2e+227) || !(z <= 4.8e+189)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + (b * (a - 0.5)));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (z <= -3.2e+227) or not (z <= 4.8e+189): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + (b * (a - 0.5))) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -3.2e+227) || !(z <= 4.8e+189)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((z <= -3.2e+227) || ~((z <= 4.8e+189)))
tmp = z * (1.0 - log(t));
else
tmp = x + (y + (b * (a - 0.5)));
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -3.2e+227], N[Not[LessEqual[z, 4.8e+189]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.2 \cdot 10^{+227} \lor \neg \left(z \leq 4.8 \cdot 10^{+189}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + b \cdot \left(a - 0.5\right)\right)\\
\end{array}
\end{array}
if z < -3.19999999999999988e227 or 4.8000000000000001e189 < z Initial program 99.5%
associate--l+99.5%
associate-+l+99.5%
associate-+l+99.5%
+-commutative99.5%
associate-+r+99.5%
+-commutative99.5%
+-commutative99.5%
*-commutative99.5%
cancel-sign-sub-inv99.5%
distribute-rgt1-in99.7%
*-commutative99.7%
fma-def99.7%
+-commutative99.7%
unsub-neg99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in z around inf 79.6%
Taylor expanded in z around inf 79.1%
if -3.19999999999999988e227 < z < 4.8000000000000001e189Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 88.0%
Final simplification86.6%
NOTE: x and y 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 (or (<= t_1 -1e+117) (not (<= t_1 1e+99)))
(+ x t_1)
(+ x (+ y (* -0.5 b))))))assert(x < y);
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 <= -1e+117) || !(t_1 <= 1e+99)) {
tmp = x + t_1;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
NOTE: x and y 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 <= (-1d+117)) .or. (.not. (t_1 <= 1d+99))) then
tmp = x + t_1
else
tmp = x + (y + ((-0.5d0) * b))
end if
code = tmp
end function
assert x < y;
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 <= -1e+117) || !(t_1 <= 1e+99)) {
tmp = x + t_1;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+117) or not (t_1 <= 1e+99): tmp = x + t_1 else: tmp = x + (y + (-0.5 * b)) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -1e+117) || !(t_1 <= 1e+99)) tmp = Float64(x + t_1); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = b * (a - 0.5);
tmp = 0.0;
if ((t_1 <= -1e+117) || ~((t_1 <= 1e+99)))
tmp = x + t_1;
else
tmp = x + (y + (-0.5 * b));
end
tmp_2 = tmp;
end
NOTE: x and y 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[Or[LessEqual[t$95$1, -1e+117], N[Not[LessEqual[t$95$1, 1e+99]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+117} \lor \neg \left(t_1 \leq 10^{+99}\right):\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -1.00000000000000005e117 or 9.9999999999999997e98 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 79.4%
if -1.00000000000000005e117 < (*.f64 (-.f64 a 1/2) b) < 9.9999999999999997e98Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 69.2%
Taylor expanded in a around 0 67.4%
*-commutative67.4%
Simplified67.4%
Final simplification72.6%
NOTE: x and y should be sorted in increasing order before calling this function.
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ x (* a b))))
(if (<= a -2.75e-11)
t_1
(if (<= a 1.25e-280) (+ x y) (if (<= a 7.5e-24) (+ x (* -0.5 b)) t_1)))))assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * b);
double tmp;
if (a <= -2.75e-11) {
tmp = t_1;
} else if (a <= 1.25e-280) {
tmp = x + y;
} else if (a <= 7.5e-24) {
tmp = x + (-0.5 * b);
} else {
tmp = t_1;
}
return tmp;
}
NOTE: x and y 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 = x + (a * b)
if (a <= (-2.75d-11)) then
tmp = t_1
else if (a <= 1.25d-280) then
tmp = x + y
else if (a <= 7.5d-24) then
tmp = x + ((-0.5d0) * b)
else
tmp = t_1
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x + (a * b);
double tmp;
if (a <= -2.75e-11) {
tmp = t_1;
} else if (a <= 1.25e-280) {
tmp = x + y;
} else if (a <= 7.5e-24) {
tmp = x + (-0.5 * b);
} else {
tmp = t_1;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): t_1 = x + (a * b) tmp = 0 if a <= -2.75e-11: tmp = t_1 elif a <= 1.25e-280: tmp = x + y elif a <= 7.5e-24: tmp = x + (-0.5 * b) else: tmp = t_1 return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) t_1 = Float64(x + Float64(a * b)) tmp = 0.0 if (a <= -2.75e-11) tmp = t_1; elseif (a <= 1.25e-280) tmp = Float64(x + y); elseif (a <= 7.5e-24) tmp = Float64(x + Float64(-0.5 * b)); else tmp = t_1; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
t_1 = x + (a * b);
tmp = 0.0;
if (a <= -2.75e-11)
tmp = t_1;
elseif (a <= 1.25e-280)
tmp = x + y;
elseif (a <= 7.5e-24)
tmp = x + (-0.5 * b);
else
tmp = t_1;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function.
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2.75e-11], t$95$1, If[LessEqual[a, 1.25e-280], N[(x + y), $MachinePrecision], If[LessEqual[a, 7.5e-24], N[(x + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
t_1 := x + a \cdot b\\
\mathbf{if}\;a \leq -2.75 \cdot 10^{-11}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;a \leq 1.25 \cdot 10^{-280}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;a \leq 7.5 \cdot 10^{-24}:\\
\;\;\;\;x + -0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if a < -2.74999999999999987e-11 or 7.50000000000000007e-24 < a Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 62.9%
if -2.74999999999999987e-11 < a < 1.25000000000000007e-280Initial program 99.9%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 58.9%
if 1.25000000000000007e-280 < a < 7.50000000000000007e-24Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.8%
*-commutative99.8%
fma-def99.8%
+-commutative99.8%
unsub-neg99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 70.4%
Taylor expanded in a around 0 70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in y around 0 51.6%
Final simplification59.2%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 5e+45) (+ x (* b (- a 0.5))) (+ y (* -0.5 b))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5e+45) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
NOTE: x and y 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 ((x + y) <= 5d+45) then
tmp = x + (b * (a - 0.5d0))
else
tmp = y + ((-0.5d0) * b)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5e+45) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 5e+45: tmp = x + (b * (a - 0.5)) else: tmp = y + (-0.5 * b) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 5e+45) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x + y) <= 5e+45)
tmp = x + (b * (a - 0.5));
else
tmp = y + (-0.5 * b);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 5e+45], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5 \cdot 10^{+45}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < 5e45Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 55.7%
if 5e45 < (+.f64 x y) Initial program 99.8%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 86.2%
Taylor expanded in a around 0 68.8%
*-commutative68.8%
Simplified68.8%
Taylor expanded in x around 0 41.2%
Final simplification51.6%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 5e+45) (+ x (* a b)) (+ x y)))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5e+45) {
tmp = x + (a * b);
} else {
tmp = x + y;
}
return tmp;
}
NOTE: x and y 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 ((x + y) <= 5d+45) then
tmp = x + (a * b)
else
tmp = x + y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5e+45) {
tmp = x + (a * b);
} else {
tmp = x + y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 5e+45: tmp = x + (a * b) else: tmp = x + y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 5e+45) tmp = Float64(x + Float64(a * b)); else tmp = Float64(x + y); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x + y) <= 5e+45)
tmp = x + (a * b);
else
tmp = x + y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 5e+45], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5 \cdot 10^{+45}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (+.f64 x y) < 5e45Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 43.5%
if 5e45 < (+.f64 x y) Initial program 99.8%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 60.0%
Final simplification48.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 1e-52) (+ x (* a b)) (+ y (* -0.5 b))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 1e-52) {
tmp = x + (a * b);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
NOTE: x and y 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 ((x + y) <= 1d-52) then
tmp = x + (a * b)
else
tmp = y + ((-0.5d0) * b)
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 1e-52) {
tmp = x + (a * b);
} else {
tmp = y + (-0.5 * b);
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 1e-52: tmp = x + (a * b) else: tmp = y + (-0.5 * b) return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 1e-52) tmp = Float64(x + Float64(a * b)); else tmp = Float64(y + Float64(-0.5 * b)); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if ((x + y) <= 1e-52)
tmp = x + (a * b);
else
tmp = y + (-0.5 * b);
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 1e-52], N[(x + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 10^{-52}:\\
\;\;\;\;x + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y + -0.5 \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < 1e-52Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 44.0%
if 1e-52 < (+.f64 x y) Initial program 99.8%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 81.4%
Taylor expanded in a around 0 62.1%
*-commutative62.1%
Simplified62.1%
Taylor expanded in x around 0 38.4%
Final simplification42.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (+ x (+ y (* b (- a 0.5)))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (b * (a - 0.5)));
}
NOTE: x and y 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 + (y + (b * (a - 0.5d0)))
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (b * (a - 0.5)));
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): return x + (y + (b * (a - 0.5)))
x, y = sort([x, y]) function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))) end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x + (y + (b * (a - 0.5)));
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x + \left(y + b \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 76.9%
Final simplification76.9%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= b -1.8e+126) (* -0.5 b) (if (<= b 4.6e+151) (+ x y) (* -0.5 b))))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.8e+126) {
tmp = -0.5 * b;
} else if (b <= 4.6e+151) {
tmp = x + y;
} else {
tmp = -0.5 * b;
}
return tmp;
}
NOTE: x and y 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.8d+126)) then
tmp = (-0.5d0) * b
else if (b <= 4.6d+151) then
tmp = x + y
else
tmp = (-0.5d0) * b
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.8e+126) {
tmp = -0.5 * b;
} else if (b <= 4.6e+151) {
tmp = x + y;
} else {
tmp = -0.5 * b;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if b <= -1.8e+126: tmp = -0.5 * b elif b <= 4.6e+151: tmp = x + y else: tmp = -0.5 * b return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.8e+126) tmp = Float64(-0.5 * b); elseif (b <= 4.6e+151) tmp = Float64(x + y); else tmp = Float64(-0.5 * b); end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (b <= -1.8e+126)
tmp = -0.5 * b;
elseif (b <= 4.6e+151)
tmp = x + y;
else
tmp = -0.5 * b;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.8e+126], N[(-0.5 * b), $MachinePrecision], If[LessEqual[b, 4.6e+151], N[(x + y), $MachinePrecision], N[(-0.5 * b), $MachinePrecision]]]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.8 \cdot 10^{+126}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;b \leq 4.6 \cdot 10^{+151}:\\
\;\;\;\;x + y\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b\\
\end{array}
\end{array}
if b < -1.8e126 or 4.6000000000000002e151 < b Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 86.9%
Taylor expanded in a around 0 41.3%
*-commutative41.3%
Simplified41.3%
Taylor expanded in b around inf 34.4%
if -1.8e126 < b < 4.6000000000000002e151Initial program 99.8%
associate--l+99.8%
associate-+l+99.8%
associate-+l+99.8%
+-commutative99.8%
associate-+r+99.8%
+-commutative99.8%
+-commutative99.8%
*-commutative99.8%
cancel-sign-sub-inv99.8%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 54.9%
Final simplification49.0%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 (if (<= y 6.2e+42) x y))
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e+42) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
NOTE: x and y 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 (y <= 6.2d+42) then
tmp = x
else
tmp = y
end if
code = tmp
end function
assert x < y;
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 6.2e+42) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): tmp = 0 if y <= 6.2e+42: tmp = x else: tmp = y return tmp
x, y = sort([x, y]) function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 6.2e+42) tmp = x; else tmp = y; end return tmp end
x, y = num2cell(sort([x, y])){:}
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (y <= 6.2e+42)
tmp = x;
else
tmp = y;
end
tmp_2 = tmp;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 6.2e+42], x, y]
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
\begin{array}{l}
\mathbf{if}\;y \leq 6.2 \cdot 10^{+42}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 6.2000000000000003e42Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 22.4%
if 6.2000000000000003e42 < y Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 86.4%
Taylor expanded in a around 0 70.4%
*-commutative70.4%
Simplified70.4%
Taylor expanded in y around inf 44.9%
Final simplification27.1%
NOTE: x and y should be sorted in increasing order before calling this function. (FPCore (x y z t a b) :precision binary64 x)
assert(x < y);
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
NOTE: x and y 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;
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
[x, y] = sort([x, y]) def code(x, y, z, t, a, b): return x
x, y = sort([x, y]) function code(x, y, z, t, a, b) return x end
x, y = num2cell(sort([x, y])){:}
function tmp = code(x, y, z, t, a, b)
tmp = x;
end
NOTE: x and y should be sorted in increasing order before calling this function. code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
[x, y] = \mathsf{sort}([x, y])\\
\\
x
\end{array}
Initial program 99.9%
associate--l+99.9%
associate-+l+99.9%
associate-+l+99.9%
+-commutative99.9%
associate-+r+99.9%
+-commutative99.9%
+-commutative99.9%
*-commutative99.9%
cancel-sign-sub-inv99.9%
distribute-rgt1-in99.9%
*-commutative99.9%
fma-def99.9%
+-commutative99.9%
unsub-neg99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 21.2%
Final simplification21.2%
(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 2023238
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(+ (+ (+ x y) (/ (* (- 1.0 (pow (log t) 2.0)) z) (+ 1.0 (log t)))) (* (- a 0.5) b))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))