
(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 (+ (* z (log (/ E t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * log((((double) M_E) / t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * log(Float64(exp(1) / t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[Log[N[(E / t), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \log \left(\frac{e}{t}\right) + \mathsf{fma}\left(a + -0.5, b, x + y\right)
\end{array}
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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
add-log-exp99.9%
exp-diff99.9%
add-exp-log99.9%
Applied egg-rr99.9%
Final simplification99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -4e+146)
(+ (+ x y) t_1)
(if (<= t_1 2e+160)
(- (+ x (+ y (+ z (* -0.5 b)))) (* z (log t)))
(+ (+ z (+ 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 (t_1 <= -4e+146) {
tmp = (x + y) + t_1;
} else if (t_1 <= 2e+160) {
tmp = (x + (y + (z + (-0.5 * b)))) - (z * log(t));
} else {
tmp = (z + (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 (t_1 <= (-4d+146)) then
tmp = (x + y) + t_1
else if (t_1 <= 2d+160) then
tmp = (x + (y + (z + ((-0.5d0) * b)))) - (z * log(t))
else
tmp = (z + (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 (t_1 <= -4e+146) {
tmp = (x + y) + t_1;
} else if (t_1 <= 2e+160) {
tmp = (x + (y + (z + (-0.5 * b)))) - (z * Math.log(t));
} else {
tmp = (z + (x + y)) + t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -4e+146: tmp = (x + y) + t_1 elif t_1 <= 2e+160: tmp = (x + (y + (z + (-0.5 * b)))) - (z * math.log(t)) else: tmp = (z + (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 (t_1 <= -4e+146) tmp = Float64(Float64(x + y) + t_1); elseif (t_1 <= 2e+160) tmp = Float64(Float64(x + Float64(y + Float64(z + Float64(-0.5 * b)))) - Float64(z * log(t))); else tmp = Float64(Float64(z + Float64(x + 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 (t_1 <= -4e+146) tmp = (x + y) + t_1; elseif (t_1 <= 2e+160) tmp = (x + (y + (z + (-0.5 * b)))) - (z * log(t)); else tmp = (z + (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[t$95$1, -4e+146], N[(N[(x + y), $MachinePrecision] + t$95$1), $MachinePrecision], If[LessEqual[t$95$1, 2e+160], N[(N[(x + N[(y + N[(z + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+146}:\\
\;\;\;\;\left(x + y\right) + t_1\\
\mathbf{elif}\;t_1 \leq 2 \cdot 10^{+160}:\\
\;\;\;\;\left(x + \left(y + \left(z + -0.5 \cdot b\right)\right)\right) - z \cdot \log t\\
\mathbf{else}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + t_1\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -3.99999999999999973e146Initial program 99.9%
Taylor expanded in z around 0 91.1%
if -3.99999999999999973e146 < (*.f64 (-.f64 a 1/2) b) < 2.00000000000000001e160Initial program 99.9%
Taylor expanded in a around 0 94.9%
if 2.00000000000000001e160 < (*.f64 (-.f64 a 1/2) b) Initial program 99.9%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 95.7%
associate-+r+95.7%
+-commutative95.7%
Simplified95.7%
Final simplification94.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= (+ x y) -6e-41)
(+ (+ z (+ x y)) t_1)
(- (+ 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 ((x + y) <= -6e-41) {
tmp = (z + (x + y)) + t_1;
} 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 ((x + y) <= (-6d-41)) then
tmp = (z + (x + y)) + t_1
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 ((x + y) <= -6e-41) {
tmp = (z + (x + y)) + t_1;
} 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 (x + y) <= -6e-41: tmp = (z + (x + y)) + t_1 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 (Float64(x + y) <= -6e-41) tmp = Float64(Float64(z + Float64(x + y)) + t_1); 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 ((x + y) <= -6e-41) tmp = (z + (x + y)) + t_1; 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[N[(x + y), $MachinePrecision], -6e-41], N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + t$95$1), $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}\;x + y \leq -6 \cdot 10^{-41}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + t_1\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + t_1\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if (+.f64 x y) < -5.99999999999999978e-41Initial program 100.0%
add-cube-cbrt99.7%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 88.0%
associate-+r+88.0%
+-commutative88.0%
Simplified88.0%
if -5.99999999999999978e-41 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 84.8%
Final simplification86.0%
(FPCore (x y z t a b)
:precision binary64
(if (<= z -7.8e+166)
(+ x (+ y (* z (- 1.0 (log t)))))
(if (<= z 9.2e+117)
(+ (+ z (+ x y)) (* b (- a 0.5)))
(- (+ y (+ z (* -0.5 b))) (* z (log t))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -7.8e+166) {
tmp = x + (y + (z * (1.0 - log(t))));
} else if (z <= 9.2e+117) {
tmp = (z + (x + y)) + (b * (a - 0.5));
} else {
tmp = (y + (z + (-0.5 * b))) - (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) :: tmp
if (z <= (-7.8d+166)) then
tmp = x + (y + (z * (1.0d0 - log(t))))
else if (z <= 9.2d+117) then
tmp = (z + (x + y)) + (b * (a - 0.5d0))
else
tmp = (y + (z + ((-0.5d0) * b))) - (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 tmp;
if (z <= -7.8e+166) {
tmp = x + (y + (z * (1.0 - Math.log(t))));
} else if (z <= 9.2e+117) {
tmp = (z + (x + y)) + (b * (a - 0.5));
} else {
tmp = (y + (z + (-0.5 * b))) - (z * Math.log(t));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -7.8e+166: tmp = x + (y + (z * (1.0 - math.log(t)))) elif z <= 9.2e+117: tmp = (z + (x + y)) + (b * (a - 0.5)) else: tmp = (y + (z + (-0.5 * b))) - (z * math.log(t)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -7.8e+166) tmp = Float64(x + Float64(y + Float64(z * Float64(1.0 - log(t))))); elseif (z <= 9.2e+117) tmp = Float64(Float64(z + Float64(x + y)) + Float64(b * Float64(a - 0.5))); else tmp = Float64(Float64(y + Float64(z + Float64(-0.5 * b))) - Float64(z * log(t))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (z <= -7.8e+166) tmp = x + (y + (z * (1.0 - log(t)))); elseif (z <= 9.2e+117) tmp = (z + (x + y)) + (b * (a - 0.5)); else tmp = (y + (z + (-0.5 * b))) - (z * log(t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -7.8e+166], N[(x + N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 9.2e+117], N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y + N[(z + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+166}:\\
\;\;\;\;x + \left(y + z \cdot \left(1 - \log t\right)\right)\\
\mathbf{elif}\;z \leq 9.2 \cdot 10^{+117}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + -0.5 \cdot b\right)\right) - z \cdot \log t\\
\end{array}
\end{array}
if z < -7.79999999999999983e166Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 83.2%
if -7.79999999999999983e166 < z < 9.19999999999999951e117Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 95.3%
associate-+r+95.3%
+-commutative95.3%
Simplified95.3%
if 9.19999999999999951e117 < z Initial program 99.7%
Taylor expanded in a around 0 79.4%
Taylor expanded in x around 0 70.3%
Final simplification91.1%
(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.9%
Final simplification99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.08e+166) (not (<= z 9.5e+151))) (+ x (+ y (* z (- 1.0 (log t))))) (+ (+ z (+ x y)) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.08e+166) || !(z <= 9.5e+151)) {
tmp = x + (y + (z * (1.0 - log(t))));
} else {
tmp = (z + (x + y)) + (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.08d+166)) .or. (.not. (z <= 9.5d+151))) then
tmp = x + (y + (z * (1.0d0 - log(t))))
else
tmp = (z + (x + y)) + (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.08e+166) || !(z <= 9.5e+151)) {
tmp = x + (y + (z * (1.0 - Math.log(t))));
} else {
tmp = (z + (x + y)) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.08e+166) or not (z <= 9.5e+151): tmp = x + (y + (z * (1.0 - math.log(t)))) else: tmp = (z + (x + y)) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.08e+166) || !(z <= 9.5e+151)) tmp = Float64(x + Float64(y + Float64(z * Float64(1.0 - log(t))))); else tmp = Float64(Float64(z + Float64(x + y)) + 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.08e+166) || ~((z <= 9.5e+151))) tmp = x + (y + (z * (1.0 - log(t)))); else tmp = (z + (x + y)) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.08e+166], N[Not[LessEqual[z, 9.5e+151]], $MachinePrecision]], N[(x + N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.08 \cdot 10^{+166} \lor \neg \left(z \leq 9.5 \cdot 10^{+151}\right):\\
\;\;\;\;x + \left(y + z \cdot \left(1 - \log t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.08e166 or 9.5000000000000001e151 < z Initial program 99.7%
+-commutative99.7%
associate--l+99.7%
associate-+r+99.7%
+-commutative99.7%
*-lft-identity99.7%
metadata-eval99.7%
*-commutative99.7%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 80.2%
if -1.08e166 < z < 9.5000000000000001e151Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 94.5%
associate-+r+94.5%
+-commutative94.5%
Simplified94.5%
Final simplification91.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.15e+170) (not (<= z 8.2e+153))) (+ y (* z (- 1.0 (log t)))) (+ (+ z (+ x y)) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.15e+170) || !(z <= 8.2e+153)) {
tmp = y + (z * (1.0 - log(t)));
} else {
tmp = (z + (x + y)) + (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.15d+170)) .or. (.not. (z <= 8.2d+153))) then
tmp = y + (z * (1.0d0 - log(t)))
else
tmp = (z + (x + y)) + (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.15e+170) || !(z <= 8.2e+153)) {
tmp = y + (z * (1.0 - Math.log(t)));
} else {
tmp = (z + (x + y)) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.15e+170) or not (z <= 8.2e+153): tmp = y + (z * (1.0 - math.log(t))) else: tmp = (z + (x + y)) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.15e+170) || !(z <= 8.2e+153)) tmp = Float64(y + Float64(z * Float64(1.0 - log(t)))); else tmp = Float64(Float64(z + Float64(x + y)) + 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.15e+170) || ~((z <= 8.2e+153))) tmp = y + (z * (1.0 - log(t))); else tmp = (z + (x + y)) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.15e+170], N[Not[LessEqual[z, 8.2e+153]], $MachinePrecision]], N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.15 \cdot 10^{+170} \lor \neg \left(z \leq 8.2 \cdot 10^{+153}\right):\\
\;\;\;\;y + z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.15e170 or 8.20000000000000033e153 < z Initial program 99.7%
+-commutative99.7%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 79.4%
Taylor expanded in x around 0 71.3%
if -1.15e170 < z < 8.20000000000000033e153Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 94.1%
associate-+r+94.1%
+-commutative94.1%
Simplified94.1%
Final simplification89.8%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -1.75e+202) (not (<= z 1.95e+154))) (* z (- 1.0 (log t))) (+ (+ z (+ x y)) (* b (- a 0.5)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -1.75e+202) || !(z <= 1.95e+154)) {
tmp = z * (1.0 - log(t));
} else {
tmp = (z + (x + y)) + (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.75d+202)) .or. (.not. (z <= 1.95d+154))) then
tmp = z * (1.0d0 - log(t))
else
tmp = (z + (x + y)) + (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.75e+202) || !(z <= 1.95e+154)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = (z + (x + y)) + (b * (a - 0.5));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -1.75e+202) or not (z <= 1.95e+154): tmp = z * (1.0 - math.log(t)) else: tmp = (z + (x + y)) + (b * (a - 0.5)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -1.75e+202) || !(z <= 1.95e+154)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(Float64(z + Float64(x + y)) + 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.75e+202) || ~((z <= 1.95e+154))) tmp = z * (1.0 - log(t)); else tmp = (z + (x + y)) + (b * (a - 0.5)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -1.75e+202], N[Not[LessEqual[z, 1.95e+154]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.75 \cdot 10^{+202} \lor \neg \left(z \leq 1.95 \cdot 10^{+154}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + b \cdot \left(a - 0.5\right)\\
\end{array}
\end{array}
if z < -1.74999999999999994e202 or 1.9500000000000001e154 < z Initial program 99.6%
Taylor expanded in a around 0 80.6%
Taylor expanded in z around inf 68.2%
if -1.74999999999999994e202 < z < 1.9500000000000001e154Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 93.0%
associate-+r+93.0%
+-commutative93.0%
Simplified93.0%
Final simplification88.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* z (- 1.0 (log t)))))
(if (<= z -1.05e+166)
(+ x t_1)
(if (<= z 6.8e+152) (+ (+ z (+ x y)) (* b (- a 0.5))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * (1.0 - log(t));
double tmp;
if (z <= -1.05e+166) {
tmp = x + t_1;
} else if (z <= 6.8e+152) {
tmp = (z + (x + y)) + (b * (a - 0.5));
} else {
tmp = 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 = z * (1.0d0 - log(t))
if (z <= (-1.05d+166)) then
tmp = x + t_1
else if (z <= 6.8d+152) then
tmp = (z + (x + y)) + (b * (a - 0.5d0))
else
tmp = 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 = z * (1.0 - Math.log(t));
double tmp;
if (z <= -1.05e+166) {
tmp = x + t_1;
} else if (z <= 6.8e+152) {
tmp = (z + (x + y)) + (b * (a - 0.5));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * (1.0 - math.log(t)) tmp = 0 if z <= -1.05e+166: tmp = x + t_1 elif z <= 6.8e+152: tmp = (z + (x + y)) + (b * (a - 0.5)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * Float64(1.0 - log(t))) tmp = 0.0 if (z <= -1.05e+166) tmp = Float64(x + t_1); elseif (z <= 6.8e+152) tmp = Float64(Float64(z + Float64(x + y)) + Float64(b * Float64(a - 0.5))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * (1.0 - log(t)); tmp = 0.0; if (z <= -1.05e+166) tmp = x + t_1; elseif (z <= 6.8e+152) tmp = (z + (x + y)) + (b * (a - 0.5)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.05e+166], N[(x + t$95$1), $MachinePrecision], If[LessEqual[z, 6.8e+152], N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.05 \cdot 10^{+166}:\\
\;\;\;\;x + t_1\\
\mathbf{elif}\;z \leq 6.8 \cdot 10^{+152}:\\
\;\;\;\;\left(z + \left(x + y\right)\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if z < -1.05e166Initial program 99.6%
+-commutative99.6%
associate--l+99.6%
associate-+r+99.6%
+-commutative99.6%
*-lft-identity99.6%
metadata-eval99.6%
*-commutative99.6%
distribute-rgt-out--99.7%
metadata-eval99.7%
fma-def99.7%
sub-neg99.7%
metadata-eval99.7%
Simplified99.7%
Taylor expanded in b around 0 83.2%
Taylor expanded in y around 0 70.5%
if -1.05e166 < z < 6.80000000000000041e152Initial program 100.0%
add-cube-cbrt99.9%
pow399.9%
Applied egg-rr99.9%
Taylor expanded in z around 0 94.5%
associate-+r+94.5%
+-commutative94.5%
Simplified94.5%
if 6.80000000000000041e152 < z Initial program 99.7%
Taylor expanded in a around 0 80.1%
Taylor expanded in z around inf 67.7%
Final simplification89.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (or (<= t_1 -4e+146) (not (<= t_1 1e+219)))
t_1
(+ x (+ y (* -0.5 b))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -4e+146) || !(t_1 <= 1e+219)) {
tmp = t_1;
} else {
tmp = x + (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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if ((t_1 <= (-4d+146)) .or. (.not. (t_1 <= 1d+219))) then
tmp = t_1
else
tmp = x + (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 t_1 = b * (a - 0.5);
double tmp;
if ((t_1 <= -4e+146) || !(t_1 <= 1e+219)) {
tmp = t_1;
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if (t_1 <= -4e+146) or not (t_1 <= 1e+219): tmp = t_1 else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if ((t_1 <= -4e+146) || !(t_1 <= 1e+219)) tmp = t_1; else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); 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 <= -4e+146) || ~((t_1 <= 1e+219))) tmp = t_1; else tmp = x + (y + (-0.5 * b)); 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, -4e+146], N[Not[LessEqual[t$95$1, 1e+219]], $MachinePrecision]], t$95$1, N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t_1 \leq -4 \cdot 10^{+146} \lor \neg \left(t_1 \leq 10^{+219}\right):\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a 1/2) b) < -3.99999999999999973e146 or 9.99999999999999965e218 < (*.f64 (-.f64 a 1/2) b) 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 89.1%
if -3.99999999999999973e146 < (*.f64 (-.f64 a 1/2) b) < 9.99999999999999965e218Initial program 99.9%
Taylor expanded in a around 0 94.1%
Taylor expanded in z around 0 71.5%
Final simplification77.4%
(FPCore (x y z t a b)
:precision binary64
(if (<= a -1.7e+62)
(* a b)
(if (<= a -4.2e-160)
x
(if (<= a 5.2e-277) y (if (<= a 1.6e+17) x (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (a <= -1.7e+62) {
tmp = a * b;
} else if (a <= -4.2e-160) {
tmp = x;
} else if (a <= 5.2e-277) {
tmp = y;
} else if (a <= 1.6e+17) {
tmp = x;
} else {
tmp = a * 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 (a <= (-1.7d+62)) then
tmp = a * b
else if (a <= (-4.2d-160)) then
tmp = x
else if (a <= 5.2d-277) then
tmp = y
else if (a <= 1.6d+17) then
tmp = x
else
tmp = a * 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 (a <= -1.7e+62) {
tmp = a * b;
} else if (a <= -4.2e-160) {
tmp = x;
} else if (a <= 5.2e-277) {
tmp = y;
} else if (a <= 1.6e+17) {
tmp = x;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if a <= -1.7e+62: tmp = a * b elif a <= -4.2e-160: tmp = x elif a <= 5.2e-277: tmp = y elif a <= 1.6e+17: tmp = x else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (a <= -1.7e+62) tmp = Float64(a * b); elseif (a <= -4.2e-160) tmp = x; elseif (a <= 5.2e-277) tmp = y; elseif (a <= 1.6e+17) tmp = x; else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (a <= -1.7e+62) tmp = a * b; elseif (a <= -4.2e-160) tmp = x; elseif (a <= 5.2e-277) tmp = y; elseif (a <= 1.6e+17) tmp = x; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[a, -1.7e+62], N[(a * b), $MachinePrecision], If[LessEqual[a, -4.2e-160], x, If[LessEqual[a, 5.2e-277], y, If[LessEqual[a, 1.6e+17], x, N[(a * b), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq -1.7 \cdot 10^{+62}:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;a \leq -4.2 \cdot 10^{-160}:\\
\;\;\;\;x\\
\mathbf{elif}\;a \leq 5.2 \cdot 10^{-277}:\\
\;\;\;\;y\\
\mathbf{elif}\;a \leq 1.6 \cdot 10^{+17}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if a < -1.70000000000000007e62 or 1.6e17 < a 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in a around inf 53.0%
*-commutative53.0%
Simplified53.0%
if -1.70000000000000007e62 < a < -4.2000000000000001e-160 or 5.2e-277 < a < 1.6e17Initial 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--99.9%
metadata-eval99.9%
fma-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 25.8%
if -4.2000000000000001e-160 < a < 5.2e-277Initial 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.8%
metadata-eval99.8%
fma-def99.8%
sub-neg99.8%
metadata-eval99.8%
Simplified99.8%
Taylor expanded in y around inf 28.2%
Final simplification39.3%
(FPCore (x y z t a b) :precision binary64 (+ (+ z (+ x y)) (* b (- a 0.5))))
double code(double x, double y, double z, double t, double a, double b) {
return (z + (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 = (z + (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 (z + (x + y)) + (b * (a - 0.5));
}
def code(x, y, z, t, a, b): return (z + (x + y)) + (b * (a - 0.5))
function code(x, y, z, t, a, b) return Float64(Float64(z + Float64(x + y)) + Float64(b * Float64(a - 0.5))) end
function tmp = code(x, y, z, t, a, b) tmp = (z + (x + y)) + (b * (a - 0.5)); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z + N[(x + y), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(z + \left(x + y\right)\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
add-cube-cbrt99.6%
pow399.7%
Applied egg-rr99.7%
Taylor expanded in z around 0 83.1%
associate-+r+83.1%
+-commutative83.1%
Simplified83.1%
Final simplification83.1%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -8e+77) (not (<= b 6e+36))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -8e+77) || !(b <= 6e+36)) {
tmp = b * (a - 0.5);
} 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) :: tmp
if ((b <= (-8d+77)) .or. (.not. (b <= 6d+36))) then
tmp = b * (a - 0.5d0)
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 tmp;
if ((b <= -8e+77) || !(b <= 6e+36)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -8e+77) or not (b <= 6e+36): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -8e+77) || !(b <= 6e+36)) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -8e+77) || ~((b <= 6e+36))) tmp = b * (a - 0.5); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -8e+77], N[Not[LessEqual[b, 6e+36]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -8 \cdot 10^{+77} \lor \neg \left(b \leq 6 \cdot 10^{+36}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -7.99999999999999986e77 or 6e36 < b 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around inf 76.5%
if -7.99999999999999986e77 < b < 6e36Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 87.4%
Taylor expanded in z around 0 64.2%
Final simplification69.0%
(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(Float64(x + 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[(N[(x + y), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x + y\right) + b \cdot \left(a - 0.5\right)
\end{array}
Initial program 99.9%
Taylor expanded in z around 0 82.3%
Final simplification82.3%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -3.1e+127) (not (<= b 9e+119))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -3.1e+127) || !(b <= 9e+119)) {
tmp = a * b;
} 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) :: tmp
if ((b <= (-3.1d+127)) .or. (.not. (b <= 9d+119))) then
tmp = a * b
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 tmp;
if ((b <= -3.1e+127) || !(b <= 9e+119)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -3.1e+127) or not (b <= 9e+119): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -3.1e+127) || !(b <= 9e+119)) tmp = Float64(a * b); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -3.1e+127) || ~((b <= 9e+119))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -3.1e+127], N[Not[LessEqual[b, 9e+119]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -3.1 \cdot 10^{+127} \lor \neg \left(b \leq 9 \cdot 10^{+119}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -3.1000000000000002e127 or 9.00000000000000039e119 < b 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-def100.0%
sub-neg100.0%
metadata-eval100.0%
Simplified100.0%
Taylor expanded in a around inf 62.6%
*-commutative62.6%
Simplified62.6%
if -3.1000000000000002e127 < b < 9.00000000000000039e119Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in b around 0 82.4%
Taylor expanded in z around 0 59.9%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (<= y 5.1e+69) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 5.1e+69) {
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 <= 5.1d+69) 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 <= 5.1e+69) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 5.1e+69: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 5.1e+69) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 5.1e+69) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 5.1e+69], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.1 \cdot 10^{+69}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 5.09999999999999999e69Initial 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 25.0%
if 5.09999999999999999e69 < 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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in y around inf 52.0%
Final simplification30.9%
(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%
+-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-def99.9%
sub-neg99.9%
metadata-eval99.9%
Simplified99.9%
Taylor expanded in x around inf 22.4%
Final simplification22.4%
(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 2023333
(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)))