
(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 18 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 (- 1.0 (log t))) (fma (+ a -0.5) b (+ x y))))
double code(double x, double y, double z, double t, double a, double b) {
return (z * (1.0 - log(t))) + fma((a + -0.5), b, (x + y));
}
function code(x, y, z, t, a, b) return Float64(Float64(z * Float64(1.0 - log(t))) + fma(Float64(a + -0.5), b, Float64(x + y))) end
code[x_, y_, z_, t_, a_, b_] := N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(a + -0.5), $MachinePrecision] * b + N[(x + y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
z \cdot \left(1 - \log t\right) + \mathsf{fma}\left(a + -0.5, b, x + y\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%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -2e+83)
(+ x (+ y (* (+ a -0.5) b)))
(if (<= t_1 2.5e+54)
(+ (* z (- 1.0 (log t))) (+ x y))
(+ x (+ y (+ (* -0.5 b) (* a b))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -2e+83) {
tmp = x + (y + ((a + -0.5) * b));
} else if (t_1 <= 2.5e+54) {
tmp = (z * (1.0 - log(t))) + (x + y);
} else {
tmp = x + (y + ((-0.5 * b) + (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) :: t_1
real(8) :: tmp
t_1 = b * (a - 0.5d0)
if (t_1 <= (-2d+83)) then
tmp = x + (y + ((a + (-0.5d0)) * b))
else if (t_1 <= 2.5d+54) then
tmp = (z * (1.0d0 - log(t))) + (x + y)
else
tmp = x + (y + (((-0.5d0) * b) + (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 t_1 = b * (a - 0.5);
double tmp;
if (t_1 <= -2e+83) {
tmp = x + (y + ((a + -0.5) * b));
} else if (t_1 <= 2.5e+54) {
tmp = (z * (1.0 - Math.log(t))) + (x + y);
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -2e+83: tmp = x + (y + ((a + -0.5) * b)) elif t_1 <= 2.5e+54: tmp = (z * (1.0 - math.log(t))) + (x + y) else: tmp = x + (y + ((-0.5 * b) + (a * 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 <= -2e+83) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); elseif (t_1 <= 2.5e+54) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(x + y)); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * 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 <= -2e+83) tmp = x + (y + ((a + -0.5) * b)); elseif (t_1 <= 2.5e+54) tmp = (z * (1.0 - log(t))) + (x + y); else tmp = x + (y + ((-0.5 * b) + (a * 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[LessEqual[t$95$1, -2e+83], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2.5e+54], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(x + y), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+83}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 2.5 \cdot 10^{+54}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(x + y\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.00000000000000006e83Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 88.4%
distribute-rgt-in88.4%
distribute-rgt-in88.4%
+-commutative88.4%
distribute-rgt-in88.4%
Simplified88.4%
if -2.00000000000000006e83 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 2.50000000000000003e54Initial 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 95.5%
if 2.50000000000000003e54 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.2%
Final simplification92.3%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* z (log t))) (t_2 (* b (- a 0.5)))) (if (<= (+ x y) -5e-28) (+ (- (+ z x) t_1) t_2) (- (+ y (+ z t_2)) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = z * log(t);
double t_2 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e-28) {
tmp = ((z + x) - t_1) + t_2;
} else {
tmp = (y + (z + t_2)) - 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) :: t_2
real(8) :: tmp
t_1 = z * log(t)
t_2 = b * (a - 0.5d0)
if ((x + y) <= (-5d-28)) then
tmp = ((z + x) - t_1) + t_2
else
tmp = (y + (z + t_2)) - 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 * Math.log(t);
double t_2 = b * (a - 0.5);
double tmp;
if ((x + y) <= -5e-28) {
tmp = ((z + x) - t_1) + t_2;
} else {
tmp = (y + (z + t_2)) - t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = z * math.log(t) t_2 = b * (a - 0.5) tmp = 0 if (x + y) <= -5e-28: tmp = ((z + x) - t_1) + t_2 else: tmp = (y + (z + t_2)) - t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(z * log(t)) t_2 = Float64(b * Float64(a - 0.5)) tmp = 0.0 if (Float64(x + y) <= -5e-28) tmp = Float64(Float64(Float64(z + x) - t_1) + t_2); else tmp = Float64(Float64(y + Float64(z + t_2)) - t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = z * log(t); t_2 = b * (a - 0.5); tmp = 0.0; if ((x + y) <= -5e-28) tmp = ((z + x) - t_1) + t_2; else tmp = (y + (z + t_2)) - t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(x + y), $MachinePrecision], -5e-28], N[(N[(N[(z + x), $MachinePrecision] - t$95$1), $MachinePrecision] + t$95$2), $MachinePrecision], N[(N[(y + N[(z + t$95$2), $MachinePrecision]), $MachinePrecision] - t$95$1), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot \log t\\
t_2 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;x + y \leq -5 \cdot 10^{-28}:\\
\;\;\;\;\left(\left(z + x\right) - t\_1\right) + t\_2\\
\mathbf{else}:\\
\;\;\;\;\left(y + \left(z + t\_2\right)\right) - t\_1\\
\end{array}
\end{array}
if (+.f64 x y) < -5.0000000000000002e-28Initial program 99.9%
Taylor expanded in y around 0 79.6%
+-commutative79.6%
Simplified79.6%
if -5.0000000000000002e-28 < (+.f64 x y) Initial program 99.8%
Taylor expanded in x around 0 78.3%
Final simplification78.8%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) 5e+46) (+ (- (+ z x) (* z (log t))) (* b (- a 0.5))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= 5e+46) {
tmp = ((z + x) - (z * log(t))) + (b * (a - 0.5));
} else {
tmp = x + (y + ((a + -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+46) then
tmp = ((z + x) - (z * log(t))) + (b * (a - 0.5d0))
else
tmp = x + (y + ((a + (-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+46) {
tmp = ((z + x) - (z * Math.log(t))) + (b * (a - 0.5));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= 5e+46: tmp = ((z + x) - (z * math.log(t))) + (b * (a - 0.5)) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= 5e+46) tmp = Float64(Float64(Float64(z + x) - Float64(z * log(t))) + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= 5e+46) tmp = ((z + x) - (z * log(t))) + (b * (a - 0.5)); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], 5e+46], N[(N[(N[(z + x), $MachinePrecision] - N[(z * N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq 5 \cdot 10^{+46}:\\
\;\;\;\;\left(\left(z + x\right) - z \cdot \log t\right) + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if (+.f64 x y) < 5.0000000000000002e46Initial program 99.8%
Taylor expanded in y around 0 85.6%
+-commutative85.6%
Simplified85.6%
if 5.0000000000000002e46 < (+.f64 x y) Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 85.7%
distribute-rgt-in85.7%
distribute-rgt-in85.7%
+-commutative85.7%
distribute-rgt-in85.7%
Simplified85.7%
Final simplification85.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -4.4e+173) (not (<= z 2.7e+222))) (+ (* z (- 1.0 (log t))) x) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -4.4e+173) || !(z <= 2.7e+222)) {
tmp = (z * (1.0 - log(t))) + x;
} else {
tmp = x + (y + ((-0.5 * b) + (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 ((z <= (-4.4d+173)) .or. (.not. (z <= 2.7d+222))) then
tmp = (z * (1.0d0 - log(t))) + x
else
tmp = x + (y + (((-0.5d0) * b) + (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 ((z <= -4.4e+173) || !(z <= 2.7e+222)) {
tmp = (z * (1.0 - Math.log(t))) + x;
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -4.4e+173) or not (z <= 2.7e+222): tmp = (z * (1.0 - math.log(t))) + x else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -4.4e+173) || !(z <= 2.7e+222)) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + x); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -4.4e+173) || ~((z <= 2.7e+222))) tmp = (z * (1.0 - log(t))) + x; else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -4.4e+173], N[Not[LessEqual[z, 2.7e+222]], $MachinePrecision]], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{+173} \lor \neg \left(z \leq 2.7 \cdot 10^{+222}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right) + x\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -4.4e173 or 2.70000000000000013e222 < z Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 87.2%
if -4.4e173 < z < 2.70000000000000013e222Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 89.7%
Final simplification89.3%
(FPCore (x y z t a b) :precision binary64 (- (+ x (+ y (+ z (+ (* -0.5 b) (* a b))))) (* z (log t))))
double code(double x, double y, double z, double t, double a, double b) {
return (x + (y + (z + ((-0.5 * b) + (a * b))))) - (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) + (a * b))))) - (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) + (a * b))))) - (z * Math.log(t));
}
def code(x, y, z, t, a, b): return (x + (y + (z + ((-0.5 * b) + (a * b))))) - (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(a * b))))) - Float64(z * log(t))) end
function tmp = code(x, y, z, t, a, b) tmp = (x + (y + (z + ((-0.5 * b) + (a * b))))) - (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[(a * b), $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 + a \cdot b\right)\right)\right)\right) - z \cdot \log t
\end{array}
Initial program 99.8%
Taylor expanded in a around 0 99.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= z -7.8e+184) (not (<= z 1.25e+222))) (* z (- 1.0 (log t))) (+ x (+ y (+ (* -0.5 b) (* a b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((z <= -7.8e+184) || !(z <= 1.25e+222)) {
tmp = z * (1.0 - log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (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 ((z <= (-7.8d+184)) .or. (.not. (z <= 1.25d+222))) then
tmp = z * (1.0d0 - log(t))
else
tmp = x + (y + (((-0.5d0) * b) + (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 ((z <= -7.8e+184) || !(z <= 1.25e+222)) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((-0.5 * b) + (a * b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (z <= -7.8e+184) or not (z <= 1.25e+222): tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((-0.5 * b) + (a * b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((z <= -7.8e+184) || !(z <= 1.25e+222)) tmp = Float64(z * Float64(1.0 - log(t))); else tmp = Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((z <= -7.8e+184) || ~((z <= 1.25e+222))) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((-0.5 * b) + (a * b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[z, -7.8e+184], N[Not[LessEqual[z, 1.25e+222]], $MachinePrecision]], N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.8 \cdot 10^{+184} \lor \neg \left(z \leq 1.25 \cdot 10^{+222}\right):\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)\\
\end{array}
\end{array}
if z < -7.79999999999999942e184 or 1.25000000000000006e222 < z Initial program 99.5%
+-commutative99.5%
associate--l+99.5%
associate-+r+99.5%
+-commutative99.5%
*-lft-identity99.5%
metadata-eval99.5%
*-commutative99.5%
distribute-rgt-out--99.6%
metadata-eval99.6%
fma-define99.6%
sub-neg99.6%
metadata-eval99.6%
Simplified99.6%
Taylor expanded in x around inf 87.2%
Taylor expanded in z around inf 80.5%
if -7.79999999999999942e184 < z < 1.25000000000000006e222Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 89.7%
Final simplification88.0%
(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 (or (<= (- a 0.5) -10000.0) (not (<= (- a 0.5) -0.49999999998))) (+ x (+ y (* a b))) (+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -10000.0) || !((a - 0.5) <= -0.49999999998)) {
tmp = x + (y + (a * b));
} 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) :: tmp
if (((a - 0.5d0) <= (-10000.0d0)) .or. (.not. ((a - 0.5d0) <= (-0.49999999998d0)))) then
tmp = x + (y + (a * b))
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 tmp;
if (((a - 0.5) <= -10000.0) || !((a - 0.5) <= -0.49999999998)) {
tmp = x + (y + (a * b));
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a - 0.5) <= -10000.0) or not ((a - 0.5) <= -0.49999999998): tmp = x + (y + (a * b)) else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a - 0.5) <= -10000.0) || !(Float64(a - 0.5) <= -0.49999999998)) tmp = Float64(x + Float64(y + Float64(a * b))); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a - 0.5) <= -10000.0) || ~(((a - 0.5) <= -0.49999999998))) tmp = x + (y + (a * b)); else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -10000.0], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], -0.49999999998]], $MachinePrecision]], N[(x + N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -10000 \lor \neg \left(a - 0.5 \leq -0.49999999998\right):\\
\;\;\;\;x + \left(y + a \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -1e4 or -0.49999999998 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 80.5%
Taylor expanded in a around inf 79.7%
*-commutative79.7%
Simplified79.7%
if -1e4 < (-.f64 a #s(literal 1/2 binary64)) < -0.49999999998Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 72.0%
Taylor expanded in a around 0 71.4%
*-commutative71.4%
Simplified71.4%
Final simplification75.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= (- a 0.5) -5e+80) (not (<= (- a 0.5) 2e+41))) (+ y (* a b)) (+ x (+ y (* -0.5 b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((a - 0.5) <= -5e+80) || !((a - 0.5) <= 2e+41)) {
tmp = y + (a * b);
} 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) :: tmp
if (((a - 0.5d0) <= (-5d+80)) .or. (.not. ((a - 0.5d0) <= 2d+41))) then
tmp = y + (a * b)
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 tmp;
if (((a - 0.5) <= -5e+80) || !((a - 0.5) <= 2e+41)) {
tmp = y + (a * b);
} else {
tmp = x + (y + (-0.5 * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if ((a - 0.5) <= -5e+80) or not ((a - 0.5) <= 2e+41): tmp = y + (a * b) else: tmp = x + (y + (-0.5 * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((Float64(a - 0.5) <= -5e+80) || !(Float64(a - 0.5) <= 2e+41)) tmp = Float64(y + Float64(a * b)); else tmp = Float64(x + Float64(y + Float64(-0.5 * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (((a - 0.5) <= -5e+80) || ~(((a - 0.5) <= 2e+41))) tmp = y + (a * b); else tmp = x + (y + (-0.5 * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[N[(a - 0.5), $MachinePrecision], -5e+80], N[Not[LessEqual[N[(a - 0.5), $MachinePrecision], 2e+41]], $MachinePrecision]], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(-0.5 * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a - 0.5 \leq -5 \cdot 10^{+80} \lor \neg \left(a - 0.5 \leq 2 \cdot 10^{+41}\right):\\
\;\;\;\;y + a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + -0.5 \cdot b\right)\\
\end{array}
\end{array}
if (-.f64 a #s(literal 1/2 binary64)) < -4.99999999999999961e80 or 2.00000000000000001e41 < (-.f64 a #s(literal 1/2 binary64)) Initial program 99.9%
Taylor expanded in x around 0 73.8%
Taylor expanded in z around 0 60.8%
Taylor expanded in a around inf 60.8%
if -4.99999999999999961e80 < (-.f64 a #s(literal 1/2 binary64)) < 2.00000000000000001e41Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 70.4%
Taylor expanded in a around 0 67.5%
*-commutative67.5%
Simplified67.5%
Final simplification64.9%
(FPCore (x y z t a b) :precision binary64 (if (<= (+ x y) -2e+160) x (if (<= (+ x y) 100.0) (* b (- a 0.5)) (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((x + y) <= -2e+160) {
tmp = x;
} else if ((x + y) <= 100.0) {
tmp = b * (a - 0.5);
} else {
tmp = y + (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 ((x + y) <= (-2d+160)) then
tmp = x
else if ((x + y) <= 100.0d0) then
tmp = b * (a - 0.5d0)
else
tmp = y + (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 ((x + y) <= -2e+160) {
tmp = x;
} else if ((x + y) <= 100.0) {
tmp = b * (a - 0.5);
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (x + y) <= -2e+160: tmp = x elif (x + y) <= 100.0: tmp = b * (a - 0.5) else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (Float64(x + y) <= -2e+160) tmp = x; elseif (Float64(x + y) <= 100.0) tmp = Float64(b * Float64(a - 0.5)); else tmp = Float64(y + Float64(a * b)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((x + y) <= -2e+160) tmp = x; elseif ((x + y) <= 100.0) tmp = b * (a - 0.5); else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[(x + y), $MachinePrecision], -2e+160], x, If[LessEqual[N[(x + y), $MachinePrecision], 100.0], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x + y \leq -2 \cdot 10^{+160}:\\
\;\;\;\;x\\
\mathbf{elif}\;x + y \leq 100:\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if (+.f64 x y) < -2.00000000000000001e160Initial 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.0%
Taylor expanded in z around 0 41.5%
if -2.00000000000000001e160 < (+.f64 x y) < 100Initial program 99.7%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 68.1%
Taylor expanded in b around inf 51.8%
if 100 < (+.f64 x y) Initial program 99.9%
Taylor expanded in x around 0 67.4%
Taylor expanded in z around 0 49.8%
Taylor expanded in a around inf 40.6%
Final simplification45.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -5.3e+51) (not (<= b 2.4e+80))) (* b (- a 0.5)) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -5.3e+51) || !(b <= 2.4e+80)) {
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 <= (-5.3d+51)) .or. (.not. (b <= 2.4d+80))) 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 <= -5.3e+51) || !(b <= 2.4e+80)) {
tmp = b * (a - 0.5);
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -5.3e+51) or not (b <= 2.4e+80): tmp = b * (a - 0.5) else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -5.3e+51) || !(b <= 2.4e+80)) 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 <= -5.3e+51) || ~((b <= 2.4e+80))) 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, -5.3e+51], N[Not[LessEqual[b, 2.4e+80]], $MachinePrecision]], N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -5.3 \cdot 10^{+51} \lor \neg \left(b \leq 2.4 \cdot 10^{+80}\right):\\
\;\;\;\;b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -5.2999999999999997e51 or 2.39999999999999979e80 < b Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.7%
Taylor expanded in b around inf 73.2%
if -5.2999999999999997e51 < b < 2.39999999999999979e80Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 66.8%
Taylor expanded in b around 0 56.4%
Final simplification63.0%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -6.5e+134) (not (<= b 1.7e+142))) (* a b) (+ x y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -6.5e+134) || !(b <= 1.7e+142)) {
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 <= (-6.5d+134)) .or. (.not. (b <= 1.7d+142))) 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 <= -6.5e+134) || !(b <= 1.7e+142)) {
tmp = a * b;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -6.5e+134) or not (b <= 1.7e+142): tmp = a * b else: tmp = x + y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -6.5e+134) || !(b <= 1.7e+142)) 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 <= -6.5e+134) || ~((b <= 1.7e+142))) tmp = a * b; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -6.5e+134], N[Not[LessEqual[b, 1.7e+142]], $MachinePrecision]], N[(a * b), $MachinePrecision], N[(x + y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -6.5 \cdot 10^{+134} \lor \neg \left(b \leq 1.7 \cdot 10^{+142}\right):\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if b < -6.5e134 or 1.6999999999999999e142 < b Initial program 99.9%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 90.8%
Taylor expanded in a around inf 49.0%
*-commutative49.0%
Simplified49.0%
if -6.5e134 < b < 1.6999999999999999e142Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 70.7%
Taylor expanded in b around 0 53.1%
Final simplification52.0%
(FPCore (x y z t a b) :precision binary64 (if (<= y -2.2e-248) x (if (<= y 6.1e+100) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -2.2e-248) {
tmp = x;
} else if (y <= 6.1e+100) {
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 <= (-2.2d-248)) then
tmp = x
else if (y <= 6.1d+100) 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 <= -2.2e-248) {
tmp = x;
} else if (y <= 6.1e+100) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -2.2e-248: tmp = x elif y <= 6.1e+100: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -2.2e-248) tmp = x; elseif (y <= 6.1e+100) 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 <= -2.2e-248) tmp = x; elseif (y <= 6.1e+100) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -2.2e-248], x, If[LessEqual[y, 6.1e+100], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2.2 \cdot 10^{-248}:\\
\;\;\;\;x\\
\mathbf{elif}\;y \leq 6.1 \cdot 10^{+100}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < -2.19999999999999999e-248Initial 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 48.1%
Taylor expanded in z around 0 26.7%
if -2.19999999999999999e-248 < y < 6.0999999999999999e100Initial program 99.8%
Taylor expanded in a around 0 99.8%
Taylor expanded in z around 0 68.9%
Taylor expanded in a around inf 27.6%
*-commutative27.6%
Simplified27.6%
if 6.0999999999999999e100 < y Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in y around inf 56.6%
Final simplification30.8%
(FPCore (x y z t a b) :precision binary64 (+ x (+ y (+ (* -0.5 b) (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (a * 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 + (((-0.5d0) * b) + (a * b)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x + (y + ((-0.5 * b) + (a * b)));
}
def code(x, y, z, t, a, b): return x + (y + ((-0.5 * b) + (a * b)))
function code(x, y, z, t, a, b) return Float64(x + Float64(y + Float64(Float64(-0.5 * b) + Float64(a * b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x + (y + ((-0.5 * b) + (a * b))); end
code[x_, y_, z_, t_, a_, b_] := N[(x + N[(y + N[(N[(-0.5 * b), $MachinePrecision] + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(-0.5 \cdot b + a \cdot b\right)\right)
\end{array}
Initial program 99.8%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 76.2%
(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(x + Float64(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[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y + \left(a + -0.5\right) \cdot b\right)
\end{array}
Initial program 99.8%
Taylor expanded in a around 0 99.9%
Taylor expanded in z around 0 76.2%
distribute-rgt-in76.2%
distribute-rgt-in76.2%
+-commutative76.2%
distribute-rgt-in76.2%
Simplified76.2%
Final simplification76.2%
(FPCore (x y z t a b) :precision binary64 (if (<= y 7e+38) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 7e+38) {
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 <= 7d+38) 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 <= 7e+38) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 7e+38: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 7e+38) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 7e+38) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 7e+38], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 7 \cdot 10^{+38}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 7.00000000000000003e38Initial 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 52.9%
Taylor expanded in z around 0 26.8%
if 7.00000000000000003e38 < y Initial program 100.0%
Taylor expanded in a around 0 100.0%
Taylor expanded in y around inf 46.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 49.0%
Taylor expanded in z around 0 25.6%
(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 2024139
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (+ (+ (+ x y) (/ (* (- 1 (pow (log t) 2)) z) (+ 1 (log t)))) (* (- a 1/2) b)))
(+ (- (+ (+ x y) z) (* z (log t))) (* (- a 0.5) b)))