
(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 20 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}
(FPCore (x y z t a b) :precision binary64 (+ x (fma z (- 1.0 (log t)) (fma (+ a -0.5) b 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));
}
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
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 + \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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -1e+92)
(+ (+ y (+ x z)) t_1)
(if (<= t_1 1e+94)
(+ (+ x y) (* z (- 1.0 (log t))))
(- (+ (+ x z) t_1) (* z (log t)))))))
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+92) {
tmp = (y + (x + z)) + t_1;
} else if (t_1 <= 1e+94) {
tmp = (x + y) + (z * (1.0 - log(t)));
} else {
tmp = ((x + z) + t_1) - (z * log(t));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (t_1 <= (-1d+92)) then
tmp = (y + (x + z)) + t_1
else if (t_1 <= 1d+94) then
tmp = (x + y) + (z * (1.0d0 - log(t)))
else
tmp = ((x + z) + t_1) - (z * log(t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -1e+92) {
tmp = (y + (x + z)) + t_1;
} else if (t_1 <= 1e+94) {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
} else {
tmp = ((x + z) + t_1) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -1e+92: tmp = (y + (x + z)) + t_1 elif t_1 <= 1e+94: tmp = (x + y) + (z * (1.0 - math.log(t))) else: tmp = ((x + z) + t_1) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (t_1 <= -1e+92) tmp = Float64(Float64(y + Float64(x + z)) + t_1); elseif (t_1 <= 1e+94) tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(Float64(Float64(x + z) + t_1) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (t_1 <= -1e+92) tmp = (y + (x + z)) + t_1; elseif (t_1 <= 1e+94) tmp = (x + y) + (z * (1.0 - log(t))); else tmp = ((x + z) + t_1) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e+92], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 1e+94], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x + z), $MachinePrecision] + t$95$1), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+92}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + t_1\\
\mathbf{elif}\;t_1 \leq 10^{+94}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(\left(x + z\right) + t_1\right) - z \cdot \log t\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -1e92Initial program 99.9%
add-sqr-sqrt41.1%
pow241.1%
Applied egg-rr41.1%
Taylor expanded in z around 0 98.0%
if -1e92 < (*.f64 (-.f64 a 1/2) b) < 1e94Initial 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 b around 0 95.1%
if 1e94 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
Taylor expanded in y around 0 90.4%
Final simplification94.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -1e+92) (not (<= t_1 2e+39)))
(+ (+ y (+ x z)) t_1)
(+ (+ x y) (* z (- 1.0 (log t)))))))
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+92) || !(t_1 <= 2e+39)) {
tmp = (y + (x + z)) + t_1;
} else {
tmp = (x + y) + (z * (1.0 - log(t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-1d+92)) .or. (.not. (t_1 <= 2d+39))) then
tmp = (y + (x + z)) + t_1
else
tmp = (x + y) + (z * (1.0d0 - log(t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -1e+92) || !(t_1 <= 2e+39)) {
tmp = (y + (x + z)) + t_1;
} else {
tmp = (x + y) + (z * (1.0 - Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -1e+92) or not (t_1 <= 2e+39): tmp = (y + (x + z)) + t_1 else: tmp = (x + y) + (z * (1.0 - math.log(t))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -1e+92) || !(t_1 <= 2e+39)) tmp = Float64(Float64(y + Float64(x + z)) + t_1); else tmp = Float64(Float64(x + y) + Float64(z * Float64(1.0 - log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -1e+92) || ~((t_1 <= 2e+39))) tmp = (y + (x + z)) + t_1; else tmp = (x + y) + (z * (1.0 - log(t))); end tmp_2 = tmp; end
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+92], N[Not[LessEqual[t$95$1, 2e+39]], $MachinePrecision]], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(x + y), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -1 \cdot 10^{+92} \lor \neg \left(t_1 \leq 2 \cdot 10^{+39}\right):\\
\;\;\;\;\left(y + \left(x + z\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(x + y\right) + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -1e92 or 1.99999999999999988e39 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
add-sqr-sqrt48.3%
pow248.3%
Applied egg-rr48.3%
Taylor expanded in z around 0 94.0%
if -1e92 < (*.f64 (-.f64 a 1/2) b) < 1.99999999999999988e39Initial 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 b around 0 97.5%
Final simplification95.8%
(FPCore (x y z t a b) :precision binary64 (- (+ (* a b) (+ (* -0.5 b) (+ y (+ x z)))) (* z (log t))))
double code(double x, double y, double z, double t, double a, double b) {
return ((a * b) + ((-0.5 * b) + (y + (x + z)))) - (z * log(t));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = ((a * b) + (((-0.5d0) * b) + (y + (x + z)))) - (z * log(t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((a * b) + ((-0.5 * b) + (y + (x + z)))) - (z * Math.log(t));
}
def code(x, y, z, t, a, b): return ((a * b) + ((-0.5 * b) + (y + (x + z)))) - (z * math.log(t))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(a * b) + Float64(Float64(-0.5 * b) + Float64(y + Float64(x + z)))) - Float64(z * log(t))) end
function tmp = code(x, y, z, t, a, b) tmp = ((a * b) + ((-0.5 * b) + (y + (x + z)))) - (z * log(t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(a * b), $MachinePrecision] + N[(N[(-0.5 * b), $MachinePrecision] + N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(a \cdot b + \left(-0.5 \cdot b + \left(y + \left(x + z\right)\right)\right)\right) - z \cdot \log t
\end{array}
Initial program 99.9%
Taylor expanded in a around 0 99.9%
Final simplification99.9%
(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(x + y) + Float64(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[(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}
\\
\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%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -6.5e+206) (not (<= z 2.55e+165))) (+ x (* z (- 1.0 (log t)))) (+ (+ y (+ x z)) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.5e+206) || !(z <= 2.55e+165)) {
tmp = x + (z * (1.0 - log(t)));
} else {
tmp = (y + (x + z)) + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-6.5d+206)) .or. (.not. (z <= 2.55d+165))) then
tmp = x + (z * (1.0d0 - log(t)))
else
tmp = (y + (x + z)) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -6.5e+206) || !(z <= 2.55e+165)) {
tmp = x + (z * (1.0 - Math.log(t)));
} else {
tmp = (y + (x + z)) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -6.5e+206) or not (z <= 2.55e+165): tmp = x + (z * (1.0 - math.log(t))) else: tmp = (y + (x + z)) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -6.5e+206) || !(z <= 2.55e+165)) tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(Float64(y + Float64(x + z)) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -6.5e+206) || ~((z <= 2.55e+165))) tmp = x + (z * (1.0 - log(t))); else tmp = (y + (x + z)) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -6.5e+206], N[Not[LessEqual[z, 2.55e+165]], $MachinePrecision]], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -6.5 \cdot 10^{+206} \lor \neg \left(z \leq 2.55 \cdot 10^{+165}\right):\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -6.4999999999999995e206 or 2.5500000000000002e165 < z Initial program 99.7%
associate--l+99.7%
associate-+l+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
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 inf 76.3%
if -6.4999999999999995e206 < z < 2.5500000000000002e165Initial program 100.0%
add-sqr-sqrt47.5%
pow247.5%
Applied egg-rr47.5%
Taylor expanded in z around 0 91.5%
Final simplification88.3%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -4.5e+184)
(- (+ z y) (* z (log t)))
(if (<= z 1e+164)
(+ (+ y (+ x z)) (* b (- a 0.5)))
(+ x (* z (- 1.0 (log t)))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e+184) {
tmp = (z + y) - (z * log(t));
} else if (z <= 1e+164) {
tmp = (y + (x + z)) + (b * (a - 0.5));
} else {
tmp = x + (z * (1.0 - log(t)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (z <= (-4.5d+184)) then
tmp = (z + y) - (z * log(t))
else if (z <= 1d+164) then
tmp = (y + (x + z)) + (b * (a - 0.5d0))
else
tmp = x + (z * (1.0d0 - log(t)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.5e+184) {
tmp = (z + y) - (z * Math.log(t));
} else if (z <= 1e+164) {
tmp = (y + (x + z)) + (b * (a - 0.5));
} else {
tmp = x + (z * (1.0 - Math.log(t)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.5e+184: tmp = (z + y) - (z * math.log(t)) elif z <= 1e+164: tmp = (y + (x + z)) + (b * (a - 0.5)) else: tmp = x + (z * (1.0 - math.log(t))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.5e+184) tmp = Float64(Float64(z + y) - Float64(z * log(t))); elseif (z <= 1e+164) tmp = Float64(Float64(y + Float64(x + z)) + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + Float64(z * Float64(1.0 - log(t)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -4.5e+184) tmp = (z + y) - (z * log(t)); elseif (z <= 1e+164) tmp = (y + (x + z)) + (b * (a - 0.5)); else tmp = x + (z * (1.0 - log(t))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.5e+184], N[(N[(z + y), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1e+164], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.5 \cdot 10^{+184}:\\
\;\;\;\;\left(z + y\right) - z \cdot \log t\\
\mathbf{elif}\;z \leq 10^{+164}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \left(1 - \log t\right)\\
\end{array}
\end{array}
if z < -4.50000000000000036e184Initial program 99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in b around 0 85.2%
Taylor expanded in x around 0 72.3%
if -4.50000000000000036e184 < z < 1e164Initial program 100.0%
add-sqr-sqrt47.7%
pow247.7%
Applied egg-rr47.7%
Taylor expanded in z around 0 92.2%
if 1e164 < z Initial program 99.6%
associate--l+99.7%
associate-+l+99.7%
associate-+l+99.7%
+-commutative99.7%
associate-+r+99.7%
+-commutative99.7%
+-commutative99.7%
*-commutative99.7%
cancel-sign-sub-inv99.7%
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 inf 75.0%
Final simplification88.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.02e+210) (not (<= z 5.4e+209))) (* z (- 1.0 (log t))) (+ (+ y (+ x z)) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.02e+210) || !(z <= 5.4e+209)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (y + (x + z)) + (b * (a - 0.5));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.02d+210)) .or. (.not. (z <= 5.4d+209))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (y + (x + z)) + (b * (a - 0.5d0))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.02e+210) || !(z <= 5.4e+209)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (y + (x + z)) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.02e+210) or not (z <= 5.4e+209): tmp = z * (1.0 - math.log(t)) else: tmp = (y + (x + z)) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.02e+210) || !(z <= 5.4e+209)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(y + Float64(x + z)) + Float64(b * Float64(a - 0.5))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.02e+210) || ~((z <= 5.4e+209))) tmp = z * (1.0 - log(t)); else tmp = (y + (x + z)) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.02e+210], N[Not[LessEqual[z, 5.4e+209]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.02 \cdot 10^{+210} \lor \neg \left(z \leq 5.4 \cdot 10^{+209}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(x + z\right)\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.02000000000000005e210 or 5.4e209 < z Initial program 99.7%
Taylor expanded in a around 0 99.7%
Taylor expanded in z around inf 76.0%
if -1.02000000000000005e210 < z < 5.4e209Initial program 99.9%
add-sqr-sqrt46.9%
pow246.9%
Applied egg-rr46.9%
Taylor expanded in z around 0 89.7%
Final simplification87.4%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -2e+117) (not (<= t_1 1e+94))) (+ x t_1) (+ 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+117) || !(t_1 <= 1e+94)) {
tmp = x + t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-2d+117)) .or. (.not. (t_1 <= 1d+94))) then
tmp = x + t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+117) || !(t_1 <= 1e+94)) {
tmp = x + t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+117) or not (t_1 <= 1e+94): tmp = x + t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -2e+117) || !(t_1 <= 1e+94)) tmp = Float64(x + t_1); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -2e+117) || ~((t_1 <= 1e+94))) tmp = x + t_1; else tmp = x + y; end tmp_2 = tmp; end
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+117], N[Not[LessEqual[t$95$1, 1e+94]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+117} \lor \neg \left(t_1 \leq 10^{+94}\right):\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -2.0000000000000001e117 or 1e94 < (*.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-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 b around inf 83.7%
if -2.0000000000000001e117 < (*.f64 (-.f64 a 1/2) b) < 1e94Initial 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 y around inf 61.5%
Final simplification70.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -5e+184) (not (<= t_1 1e+94)))
(+ x t_1)
(+ (* -0.5 b) (+ 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+184) || !(t_1 <= 1e+94)) {
tmp = x + t_1;
} else {
tmp = (-0.5 * b) + (x + y);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-5d+184)) .or. (.not. (t_1 <= 1d+94))) then
tmp = x + t_1
else
tmp = ((-0.5d0) * b) + (x + y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -5e+184) || !(t_1 <= 1e+94)) {
tmp = x + t_1;
} else {
tmp = (-0.5 * b) + (x + y);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -5e+184) or not (t_1 <= 1e+94): tmp = x + t_1 else: tmp = (-0.5 * b) + (x + y) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -5e+184) || !(t_1 <= 1e+94)) tmp = Float64(x + t_1); else tmp = Float64(Float64(-0.5 * b) + Float64(x + y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -5e+184) || ~((t_1 <= 1e+94))) tmp = x + t_1; else tmp = (-0.5 * b) + (x + y); end tmp_2 = tmp; end
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+184], N[Not[LessEqual[t$95$1, 1e+94]], $MachinePrecision]], N[(x + t$95$1), $MachinePrecision], N[(N[(-0.5 * b), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -5 \cdot 10^{+184} \lor \neg \left(t_1 \leq 10^{+94}\right):\\
\;\;\;\;x + t_1\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b + \left(x + y\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -4.9999999999999999e184 or 1e94 < (*.f64 (-.f64 a 1/2) b) Initial 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 b around inf 84.9%
if -4.9999999999999999e184 < (*.f64 (-.f64 a 1/2) b) < 1e94Initial program 99.8%
associate--l+99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in z around 0 69.1%
Taylor expanded in a around 0 65.9%
*-commutative65.9%
Simplified65.9%
Final simplification73.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (or (<= t_1 -2e+184) (not (<= t_1 2e+105))) t_1 (+ 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+184) || !(t_1 <= 2e+105)) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-2d+184)) .or. (.not. (t_1 <= 2d+105))) then
tmp = t_1
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -2e+184) || !(t_1 <= 2e+105)) {
tmp = t_1;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -2e+184) or not (t_1 <= 2e+105): tmp = t_1 else: tmp = x + y return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -2e+184) || !(t_1 <= 2e+105)) tmp = t_1; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if ((t_1 <= -2e+184) || ~((t_1 <= 2e+105))) tmp = t_1; else tmp = x + y; end tmp_2 = tmp; end
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+184], N[Not[LessEqual[t$95$1, 2e+105]], $MachinePrecision]], t$95$1, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -2 \cdot 10^{+184} \lor \neg \left(t_1 \leq 2 \cdot 10^{+105}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -2.00000000000000003e184 or 1.9999999999999999e105 < (*.f64 (-.f64 a 1/2) b) Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around inf 82.4%
if -2.00000000000000003e184 < (*.f64 (-.f64 a 1/2) b) < 1.9999999999999999e105Initial 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 61.9%
Final simplification69.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -8.2e+107)
(* -0.5 b)
(if (<= b 1.15e+146)
(+ x y)
(if (or (<= b 1.55e+183) (and (not (<= b 7.8e+239)) (<= b 2.6e+298)))
(* a b)
(* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.2e+107) {
tmp = -0.5 * b;
} else if (b <= 1.15e+146) {
tmp = x + y;
} else if ((b <= 1.55e+183) || (!(b <= 7.8e+239) && (b <= 2.6e+298))) {
tmp = a * b;
} else {
tmp = -0.5 * b;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (b <= (-8.2d+107)) then
tmp = (-0.5d0) * b
else if (b <= 1.15d+146) then
tmp = x + y
else if ((b <= 1.55d+183) .or. (.not. (b <= 7.8d+239)) .and. (b <= 2.6d+298)) then
tmp = a * b
else
tmp = (-0.5d0) * b
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -8.2e+107) {
tmp = -0.5 * b;
} else if (b <= 1.15e+146) {
tmp = x + y;
} else if ((b <= 1.55e+183) || (!(b <= 7.8e+239) && (b <= 2.6e+298))) {
tmp = a * b;
} else {
tmp = -0.5 * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -8.2e+107: tmp = -0.5 * b elif b <= 1.15e+146: tmp = x + y elif (b <= 1.55e+183) or (not (b <= 7.8e+239) and (b <= 2.6e+298)): tmp = a * b else: tmp = -0.5 * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -8.2e+107) tmp = Float64(-0.5 * b); elseif (b <= 1.15e+146) tmp = Float64(x + y); elseif ((b <= 1.55e+183) || (!(b <= 7.8e+239) && (b <= 2.6e+298))) tmp = Float64(a * b); else tmp = Float64(-0.5 * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -8.2e+107) tmp = -0.5 * b; elseif (b <= 1.15e+146) tmp = x + y; elseif ((b <= 1.55e+183) || (~((b <= 7.8e+239)) && (b <= 2.6e+298))) tmp = a * b; else tmp = -0.5 * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -8.2e+107], N[(-0.5 * b), $MachinePrecision], If[LessEqual[b, 1.15e+146], N[(x + y), $MachinePrecision], If[Or[LessEqual[b, 1.55e+183], And[N[Not[LessEqual[b, 7.8e+239]], $MachinePrecision], LessEqual[b, 2.6e+298]]], N[(a * b), $MachinePrecision], N[(-0.5 * b), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8.2 \cdot 10^{+107}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;b \leq 1.15 \cdot 10^{+146}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;b \leq 1.55 \cdot 10^{+183} \lor \neg \left(b \leq 7.8 \cdot 10^{+239}\right) \land b \leq 2.6 \cdot 10^{+298}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;-0.5 \cdot b\\
\end{array}
\end{array}
if b < -8.1999999999999998e107 or 1.5499999999999999e183 < b < 7.7999999999999996e239 or 2.6e298 < b Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in b around inf 82.0%
Taylor expanded in a around 0 54.7%
if -8.1999999999999998e107 < b < 1.15e146Initial 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 y around inf 57.1%
if 1.15e146 < b < 1.5499999999999999e183 or 7.7999999999999996e239 < b < 2.6e298Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in a around inf 71.7%
*-commutative71.7%
Simplified71.7%
Final simplification58.0%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -5e-112) (+ x (* b (- a 0.5))) (+ (* a b) (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -5e-112) {
tmp = x + (b * (a - 0.5));
} else {
tmp = (a * b) + (y + (-0.5 * b));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((x + y) <= (-5d-112)) then
tmp = x + (b * (a - 0.5d0))
else
tmp = (a * b) + (y + ((-0.5d0) * b))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -5e-112) {
tmp = x + (b * (a - 0.5));
} else {
tmp = (a * b) + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -5e-112: tmp = x + (b * (a - 0.5)) else: tmp = (a * b) + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -5e-112) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(Float64(a * b) + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -5e-112) tmp = x + (b * (a - 0.5)); else tmp = (a * b) + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -5e-112], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(a * b), $MachinePrecision] + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -5 \cdot 10^{-112}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;a \cdot b + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 x y) < -5.00000000000000044e-112Initial 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 49.8%
if -5.00000000000000044e-112 < (+.f64 x y) Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 79.1%
Taylor expanded in a around 0 79.1%
Taylor expanded in x around 0 59.3%
Final simplification55.2%
(FPCore (x y z t a b)
:precision binary64
(if (<= y 7e-227)
x
(if (<= y 1.05e-126)
(* a b)
(if (<= y 4.6e-14) (* -0.5 b) (if (<= y 4.5e+43) (* a b) y)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 7e-227) {
tmp = x;
} else if (y <= 1.05e-126) {
tmp = a * b;
} else if (y <= 4.6e-14) {
tmp = -0.5 * b;
} else if (y <= 4.5e+43) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 7d-227) then
tmp = x
else if (y <= 1.05d-126) then
tmp = a * b
else if (y <= 4.6d-14) then
tmp = (-0.5d0) * b
else if (y <= 4.5d+43) then
tmp = a * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 7e-227) {
tmp = x;
} else if (y <= 1.05e-126) {
tmp = a * b;
} else if (y <= 4.6e-14) {
tmp = -0.5 * b;
} else if (y <= 4.5e+43) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 7e-227: tmp = x elif y <= 1.05e-126: tmp = a * b elif y <= 4.6e-14: tmp = -0.5 * b elif y <= 4.5e+43: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 7e-227) tmp = x; elseif (y <= 1.05e-126) tmp = Float64(a * b); elseif (y <= 4.6e-14) tmp = Float64(-0.5 * b); elseif (y <= 4.5e+43) tmp = Float64(a * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 7e-227) tmp = x; elseif (y <= 1.05e-126) tmp = a * b; elseif (y <= 4.6e-14) tmp = -0.5 * b; elseif (y <= 4.5e+43) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 7e-227], x, If[LessEqual[y, 1.05e-126], N[(a * b), $MachinePrecision], If[LessEqual[y, 4.6e-14], N[(-0.5 * b), $MachinePrecision], If[LessEqual[y, 4.5e+43], N[(a * b), $MachinePrecision], y]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{-227}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 1.05 \cdot 10^{-126}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;y \leq 4.6 \cdot 10^{-14}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{elif}\;y \leq 4.5 \cdot 10^{+43}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 7.0000000000000002e-227Initial 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 24.5%
if 7.0000000000000002e-227 < y < 1.0499999999999999e-126 or 4.59999999999999996e-14 < y < 4.5e43Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in a around inf 39.1%
*-commutative39.1%
Simplified39.1%
if 1.0499999999999999e-126 < y < 4.59999999999999996e-14Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in b around inf 44.5%
Taylor expanded in a around 0 31.8%
if 4.5e43 < y Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in y around inf 51.5%
Final simplification32.5%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (+ (* a b) (* -0.5 b))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a * b) + (-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) + ((a * b) + ((-0.5d0) * b))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((a * b) + (-0.5 * b));
}
def code(x, y, z, t, a, b): return (x + y) + ((a * b) + (-0.5 * b))
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(Float64(a * b) + Float64(-0.5 * b))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + ((a * b) + (-0.5 * b)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(N[(a * b), $MachinePrecision] + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + \left(a \cdot b + -0.5 \cdot b\right)
\end{array}
Initial program 99.9%
associate--l+99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 78.5%
Taylor expanded in a around 0 78.5%
Final simplification78.5%
(FPCore (x y z t a b) :precision binary64 (+ (+ y (+ x z)) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (y + (x + z)) + (b * (a - 0.5));
}
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 + z)) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (y + (x + z)) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (y + (x + z)) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(y + Float64(x + z)) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (y + (x + z)) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(y + N[(x + z), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y + \left(x + z\right)\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
add-sqr-sqrt46.0%
pow246.0%
Applied egg-rr46.0%
Taylor expanded in z around 0 79.5%
Final simplification79.5%
(FPCore (x y z t a b) :precision binary64 (+ (+ x y) (* (+ a -0.5) b)))
double code(double x, double y, double z, double t, double a, double b) {
return (x + y) + ((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) + ((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) + ((a + -0.5) * b);
}
def code(x, y, z, t, a, b): return (x + y) + ((a + -0.5) * b)
function code(x, y, z, t, a, b) return Float64(Float64(x + y) + Float64(Float64(a + -0.5) * b)) end
function tmp = code(x, y, z, t, a, b) tmp = (x + y) + ((a + -0.5) * b); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + y), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\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%
Taylor expanded in z around 0 78.5%
Final simplification78.5%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.7e-127) x (if (<= y 3.3e+37) (* -0.5 b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.7e-127) {
tmp = x;
} else if (y <= 3.3e+37) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 2.7d-127) then
tmp = x
else if (y <= 3.3d+37) then
tmp = (-0.5d0) * b
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.7e-127) {
tmp = x;
} else if (y <= 3.3e+37) {
tmp = -0.5 * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.7e-127: tmp = x elif y <= 3.3e+37: tmp = -0.5 * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.7e-127) tmp = x; elseif (y <= 3.3e+37) tmp = Float64(-0.5 * b); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.7e-127) tmp = x; elseif (y <= 3.3e+37) tmp = -0.5 * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.7e-127], x, If[LessEqual[y, 3.3e+37], N[(-0.5 * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{-127}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 3.3 \cdot 10^{+37}:\\
\;\;\;\;-0.5 \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.7e-127Initial 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 24.5%
if 2.7e-127 < y < 3.3000000000000001e37Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in b around inf 46.4%
Taylor expanded in a around 0 24.6%
if 3.3000000000000001e37 < y Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in y around inf 50.3%
Final simplification30.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.65e+37) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.65e+37) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (y <= 1.65d+37) then
tmp = x
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.65e+37) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.65e+37: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.65e+37) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.65e+37) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.65e+37], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.65 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 1.65e37Initial 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 25.5%
if 1.65e37 < y Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in y around inf 50.3%
Final simplification30.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
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
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
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.8%
Final simplification21.8%
(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 2023200
(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)))