
(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}
(FPCore (x y z t a b) :precision binary64 (- (+ x (+ y (+ z (+ (* -0.5 b) (* b a))))) (* z (log t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (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 = (x + (y + (z + (((-0.5d0) * b) + (b * a))))) - (z * log(t))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * Math.log(t));
}
def code(x, y, z, t, a, b): return (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * math.log(t))
function code(x, y, z, t, a, b) return Float64(Float64(x + Float64(y + Float64(z + Float64(Float64(-0.5 * b) + Float64(b * a))))) - Float64(z * log(t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (y + (z + ((-0.5 * b) + (b * a))))) - (z * log(t)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x + N[(y + N[(z + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + \left(y + \left(z + \left(-0.5 \cdot b + b \cdot a\right)\right)\right)\right) - z \cdot \log t
\end{array}
Initial program 99.8%
+-commutative99.8%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in a around 0 99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -5e+81) (not (<= t_1 1e+83)))
(+ x (+ y (+ (* -0.5 b) (* b a))))
(+ 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 <= -5e+81) || !(t_1 <= 1e+83)) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} 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 <= (-5d+81)) .or. (.not. (t_1 <= 1d+83))) then
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
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 <= -5e+81) || !(t_1 <= 1e+83)) {
tmp = x + (y + ((-0.5 * b) + (b * a)));
} 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 <= -5e+81) or not (t_1 <= 1e+83): tmp = x + (y + ((-0.5 * b) + (b * a))) 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 <= -5e+81) || !(t_1 <= 1e+83)) tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); else tmp = Float64(x + Float64(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 <= -5e+81) || ~((t_1 <= 1e+83))) tmp = x + (y + ((-0.5 * b) + (b * a))); 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, -5e+81], N[Not[LessEqual[t$95$1, 1e+83]], $MachinePrecision]], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $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^{+81} \lor \neg \left(t\_1 \leq 10^{+83}\right):\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + z \cdot \left(1 - \log t\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -4.9999999999999998e81 or 1.00000000000000003e83 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 86.4%
if -4.9999999999999998e81 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.00000000000000003e83Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around 0 92.9%
Final simplification89.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4e+30) (not (<= z 3e+229))) (+ (* b (- a 0.5)) (* z (- 1.0 (log t)))) (+ x (+ y (+ (* -0.5 b) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4e+30) || !(z <= 3e+229)) {
tmp = (b * (a - 0.5)) + (z * (1.0 - log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-4d+30)) .or. (.not. (z <= 3d+229))) then
tmp = (b * (a - 0.5d0)) + (z * (1.0d0 - log(t)))
else
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4e+30) || !(z <= 3e+229)) {
tmp = (b * (a - 0.5)) + (z * (1.0 - Math.log(t)));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4e+30) or not (z <= 3e+229): tmp = (b * (a - 0.5)) + (z * (1.0 - math.log(t))) else: tmp = x + (y + ((-0.5 * b) + (b * a))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4e+30) || !(z <= 3e+229)) tmp = Float64(Float64(b * Float64(a - 0.5)) + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4e+30) || ~((z <= 3e+229))) tmp = (b * (a - 0.5)) + (z * (1.0 - log(t))); else tmp = x + (y + ((-0.5 * b) + (b * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4e+30], N[Not[LessEqual[z, 3e+229]], $MachinePrecision]], N[(N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision] + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+30} \lor \neg \left(z \leq 3 \cdot 10^{+229}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right) + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\end{array}
\end{array}
if z < -4.0000000000000001e30 or 2.99999999999999998e229 < z Initial program 99.6%
Taylor expanded in z around inf 86.4%
*-commutative86.4%
*-un-lft-identity86.4%
distribute-rgt-out--86.4%
*-commutative86.4%
Applied egg-rr86.4%
if -4.0000000000000001e30 < z < 2.99999999999999998e229Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 91.6%
Final simplification90.1%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= y 1.75e+112) (+ x (+ t_1 (* z (- 1.0 (log t))))) (+ x (+ y t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (y <= 1.75e+112) {
tmp = x + (t_1 + (z * (1.0 - log(t))));
} else {
tmp = x + (y + t_1);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (y <= 1.75d+112) then
tmp = x + (t_1 + (z * (1.0d0 - log(t))))
else
tmp = x + (y + t_1)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (y <= 1.75e+112) {
tmp = x + (t_1 + (z * (1.0 - Math.log(t))));
} else {
tmp = x + (y + t_1);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if y <= 1.75e+112: tmp = x + (t_1 + (z * (1.0 - math.log(t)))) else: tmp = x + (y + t_1) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (y <= 1.75e+112) tmp = Float64(x + Float64(t_1 + Float64(z * Float64(1.0 - log(t))))); else tmp = Float64(x + Float64(y + t_1)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (y <= 1.75e+112) tmp = x + (t_1 + (z * (1.0 - log(t)))); else tmp = x + (y + t_1); 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[y, 1.75e+112], N[(x + N[(t$95$1 + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;y \leq 1.75 \cdot 10^{+112}:\\
\;\;\;\;x + \left(t\_1 + z \cdot \left(1 - \log t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + t\_1\right)\\
\end{array}
\end{array}
if y < 1.74999999999999998e112Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 84.1%
if 1.74999999999999998e112 < y Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 85.0%
Final simplification84.3%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= y 7.8e+100)
(+ x (+ t_1 (* z (- 1.0 (log t)))))
(- (+ y (+ 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 (y <= 7.8e+100) {
tmp = x + (t_1 + (z * (1.0 - log(t))));
} else {
tmp = (y + (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 (y <= 7.8d+100) then
tmp = x + (t_1 + (z * (1.0d0 - log(t))))
else
tmp = (y + (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 (y <= 7.8e+100) {
tmp = x + (t_1 + (z * (1.0 - Math.log(t))));
} else {
tmp = (y + (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 y <= 7.8e+100: tmp = x + (t_1 + (z * (1.0 - math.log(t)))) else: tmp = (y + (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 (y <= 7.8e+100) tmp = Float64(x + Float64(t_1 + Float64(z * Float64(1.0 - log(t))))); else tmp = Float64(Float64(y + Float64(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 (y <= 7.8e+100) tmp = x + (t_1 + (z * (1.0 - log(t)))); else tmp = (y + (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[y, 7.8e+100], N[(x + N[(t$95$1 + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(z + t$95$1), $MachinePrecision]), $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}\;y \leq 7.8 \cdot 10^{+100}:\\
\;\;\;\;x + \left(t\_1 + z \cdot \left(1 - \log t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + t\_1\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if y < 7.8e100Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around 0 84.3%
if 7.8e100 < y Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in x around 0 98.4%
Final simplification86.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.66e+177) (not (<= z 3.8e+178))) (- (+ x z) (* z (log t))) (+ x (+ y (+ (* -0.5 b) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.66e+177) || !(z <= 3.8e+178)) {
tmp = (x + z) - (z * log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.66d+177)) .or. (.not. (z <= 3.8d+178))) then
tmp = (x + z) - (z * log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.66e+177) || !(z <= 3.8e+178)) {
tmp = (x + z) - (z * Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.66e+177) or not (z <= 3.8e+178): tmp = (x + z) - (z * math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (b * a))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.66e+177) || !(z <= 3.8e+178)) tmp = Float64(Float64(x + z) - Float64(z * log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.66e+177) || ~((z <= 3.8e+178))) tmp = (x + z) - (z * log(t)); else tmp = x + (y + ((-0.5 * b) + (b * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.66e+177], N[Not[LessEqual[z, 3.8e+178]], $MachinePrecision]], N[(N[(x + z), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.66 \cdot 10^{+177} \lor \neg \left(z \leq 3.8 \cdot 10^{+178}\right):\\
\;\;\;\;\left(x + z\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\end{array}
\end{array}
if z < -1.65999999999999994e177 or 3.79999999999999998e178 < z Initial program 99.5%
+-commutative99.5%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
associate--l+99.6%
associate-+l+99.6%
Simplified99.6%
Taylor expanded in y around 0 85.8%
Taylor expanded in b around 0 71.1%
+-commutative71.1%
Simplified71.1%
if -1.65999999999999994e177 < z < 3.79999999999999998e178Initial program 100.0%
+-commutative100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 90.7%
Final simplification85.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.55e+229) (not (<= z 1.25e+230))) (* z (- 1.0 (log t))) (+ x (+ y (+ (* -0.5 b) (* b a))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.55e+229) || !(z <= 1.25e+230)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((z <= (-1.55d+229)) .or. (.not. (z <= 1.25d+230))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (b * a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.55e+229) || !(z <= 1.25e+230)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (b * a)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.55e+229) or not (z <= 1.25e+230): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (b * a))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.55e+229) || !(z <= 1.25e+230)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -1.55e+229) || ~((z <= 1.25e+230))) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((-0.5 * b) + (b * a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.55e+229], N[Not[LessEqual[z, 1.25e+230]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{+229} \lor \neg \left(z \leq 1.25 \cdot 10^{+230}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)\\
\end{array}
\end{array}
if z < -1.55000000000000007e229 or 1.2500000000000001e230 < z Initial program 99.4%
+-commutative99.4%
fma-define99.5%
sub-neg99.5%
metadata-eval99.5%
associate--l+99.5%
associate-+l+99.5%
Simplified99.5%
Taylor expanded in a around 0 99.5%
Taylor expanded in z around inf 76.1%
if -1.55000000000000007e229 < z < 1.2500000000000001e230Initial program 99.9%
+-commutative99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.9%
associate-+l+99.9%
Simplified99.9%
Taylor expanded in a around 0 100.0%
Taylor expanded in z around 0 87.8%
Final simplification85.7%
(FPCore (x y z t a b) :precision binary64 (+ (- (+ z (+ x y)) (* z (log t))) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * log(t))) + (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 = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5d0))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((z + (x + y)) - (z * Math.log(t))) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return ((z + (x + y)) - (z * math.log(t))) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(Float64(z + Float64(x + y)) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = ((z + (x + y)) - (z * log(t))) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(z + \left(x + y\right)\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.8%
Final simplification99.8%
(FPCore (x y z t a b) :precision binary64 (if (<= x -3.1e+144) x (if (<= x 4.2e-274) (* b (- a 0.5)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -3.1e+144) {
tmp = x;
} else if (x <= 4.2e-274) {
tmp = b * (a - 0.5);
} 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 (x <= (-3.1d+144)) then
tmp = x
else if (x <= 4.2d-274) then
tmp = b * (a - 0.5d0)
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 (x <= -3.1e+144) {
tmp = x;
} else if (x <= 4.2e-274) {
tmp = b * (a - 0.5);
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -3.1e+144: tmp = x elif x <= 4.2e-274: tmp = b * (a - 0.5) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -3.1e+144) tmp = x; elseif (x <= 4.2e-274) tmp = Float64(b * Float64(a - 0.5)); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -3.1e+144) tmp = x; elseif (x <= 4.2e-274) tmp = b * (a - 0.5); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -3.1e+144], x, If[LessEqual[x, 4.2e-274], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{+144}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-274}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -3.1000000000000002e144Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 57.6%
if -3.1000000000000002e144 < x < 4.19999999999999988e-274Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 40.9%
if 4.19999999999999988e-274 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 27.2%
Final simplification36.1%
(FPCore (x y z t a b) :precision binary64 (if (<= x -72.0) (+ x (* b a)) (if (<= x 2e-273) (* b (- a 0.5)) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -72.0) {
tmp = x + (b * a);
} else if (x <= 2e-273) {
tmp = b * (a - 0.5);
} 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 (x <= (-72.0d0)) then
tmp = x + (b * a)
else if (x <= 2d-273) then
tmp = b * (a - 0.5d0)
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 (x <= -72.0) {
tmp = x + (b * a);
} else if (x <= 2e-273) {
tmp = b * (a - 0.5);
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -72.0: tmp = x + (b * a) elif x <= 2e-273: tmp = b * (a - 0.5) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -72.0) tmp = Float64(x + Float64(b * a)); elseif (x <= 2e-273) tmp = Float64(b * Float64(a - 0.5)); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -72.0) tmp = x + (b * a); elseif (x <= 2e-273) tmp = b * (a - 0.5); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -72.0], N[(x + N[(b * a), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 2e-273], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -72:\\
\;\;\;\;x + b \cdot a\\
\mathbf{elif}\;x \leq 2 \cdot 10^{-273}:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -72Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around 0 81.2%
Taylor expanded in a around inf 58.3%
*-commutative58.3%
Simplified58.3%
if -72 < x < 2e-273Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in b around inf 42.8%
if 2e-273 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.9%
associate-+r+99.9%
+-commutative99.9%
*-lft-identity99.9%
metadata-eval99.9%
*-commutative99.9%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 27.2%
Final simplification38.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.2e+32) x (if (<= x -4.8e-213) (* b a) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.2e+32) {
tmp = x;
} else if (x <= -4.8e-213) {
tmp = b * a;
} 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 (x <= (-8.2d+32)) then
tmp = x
else if (x <= (-4.8d-213)) then
tmp = b * a
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 (x <= -8.2e+32) {
tmp = x;
} else if (x <= -4.8e-213) {
tmp = b * a;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.2e+32: tmp = x elif x <= -4.8e-213: tmp = b * a else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.2e+32) tmp = x; elseif (x <= -4.8e-213) tmp = Float64(b * a); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -8.2e+32) tmp = x; elseif (x <= -4.8e-213) tmp = b * a; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.2e+32], x, If[LessEqual[x, -4.8e-213], N[(b * a), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.2 \cdot 10^{+32}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq -4.8 \cdot 10^{-213}:\\
\;\;\;\;b \cdot a\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -8.19999999999999961e32Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 46.0%
if -8.19999999999999961e32 < x < -4.79999999999999991e-213Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 25.5%
*-commutative25.5%
Simplified25.5%
if -4.79999999999999991e-213 < x Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 25.7%
Final simplification29.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.4e+164) (+ x (* b (- a 0.5))) y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.4e+164) {
tmp = x + (b * (a - 0.5));
} 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.4d+164) then
tmp = x + (b * (a - 0.5d0))
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.4e+164) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.4e+164: tmp = x + (b * (a - 0.5)) else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.4e+164) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.4e+164) tmp = x + (b * (a - 0.5)); else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.4e+164], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.4 \cdot 10^{+164}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.40000000000000011e164Initial program 99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 83.8%
Taylor expanded in z around 0 58.0%
if 2.40000000000000011e164 < y Initial program 100.0%
+-commutative100.0%
associate--l+100.0%
associate-+r+100.0%
+-commutative100.0%
*-lft-identity100.0%
metadata-eval100.0%
*-commutative100.0%
distribute-rgt-out--100.0%
metadata-eval100.0%
fma-define100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in y around inf 72.2%
Final simplification59.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* b (- a 0.5)))) (if (<= x -6e-21) (+ x t_1) (+ y t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (x <= -6e-21) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (x <= (-6d-21)) then
tmp = x + t_1
else
tmp = y + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (x <= -6e-21) {
tmp = x + t_1;
} else {
tmp = y + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if x <= -6e-21: tmp = x + t_1 else: tmp = y + t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (x <= -6e-21) tmp = Float64(x + t_1); else tmp = Float64(y + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = b * (a - 0.5); tmp = 0.0; if (x <= -6e-21) tmp = x + t_1; else tmp = y + t_1; 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[x, -6e-21], N[(x + t$95$1), $MachinePrecision], N[(y + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x \leq -6 \cdot 10^{-21}:\\
\;\;\;\;x + t\_1\\
\mathbf{else}:\\
\;\;\;\;y + t\_1\\
\end{array}
\end{array}
if x < -5.99999999999999982e-21Initial program 99.8%
+-commutative99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in y around 0 82.7%
Taylor expanded in z around 0 64.8%
if -5.99999999999999982e-21 < x Initial program 99.9%
Taylor expanded in x around inf 69.9%
Taylor expanded in z around 0 58.6%
Taylor expanded in x around 0 63.4%
Final simplification63.8%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (+ (* -0.5 b) (* b a)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (b * a)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x + (y + (((-0.5d0) * b) + (b * a)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (b * a)));
}
def code(x, y, z, t, a, b): return x + (y + ((-0.5 * b) + (b * a)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(b * a)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((-0.5 * b) + (b * a))); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(b * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(-0.5 \cdot b + b \cdot a\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
associate--l+99.8%
associate-+l+99.8%
Simplified99.8%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 75.6%
Final simplification75.6%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (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 = x + (y + (b * (a - 0.5d0)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + (b * (a - 0.5)));
}
def code(x, y, z, t, a, b): return x + (y + (b * (a - 0.5)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(b * Float64(a - 0.5)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + (b * (a - 0.5))); end
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 + \left(y + b \cdot \left(a - 0.5\right)\right)
\end{array}
Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in z around 0 75.6%
Final simplification75.6%
(FPCore (x y z t a b) :precision binary64 (if (<= x -6e-21) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -6e-21) {
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 (x <= (-6d-21)) 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 (x <= -6e-21) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -6e-21: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -6e-21) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= -6e-21) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -6e-21], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6 \cdot 10^{-21}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -5.99999999999999982e-21Initial program 99.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.8%
metadata-eval99.8%
fma-define99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in x around inf 39.8%
if -5.99999999999999982e-21 < x Initial program 99.9%
+-commutative99.9%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 26.2%
Final simplification29.5%
(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.8%
+-commutative99.8%
associate--l+99.8%
associate-+r+99.8%
+-commutative99.8%
*-lft-identity99.8%
metadata-eval99.8%
*-commutative99.8%
distribute-rgt-out--99.9%
metadata-eval99.9%
fma-define99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 19.0%
Final simplification19.0%
(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 2024115
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(+ (+ (+ 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)))