
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 10 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((((x * log(y)) + z) + t) + a) + ((b - 0.5d0) * log(c))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((((x * Math.log(y)) + z) + t) + a) + ((b - 0.5) * Math.log(c))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((((x * math.log(y)) + z) + t) + a) + ((b - 0.5) * math.log(c))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(Float64(Float64(x * log(y)) + z) + t) + a) + Float64(Float64(b - 0.5) * log(c))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((((x * log(y)) + z) + t) + a) + ((b - 0.5) * log(c))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision] + a), $MachinePrecision] + N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(\left(\left(x \cdot \log y + z\right) + t\right) + a\right) + \left(b - 0.5\right) \cdot \log c\right) + y \cdot i
\end{array}
(FPCore (x y z t a b c i) :precision binary64 (+ (+ (* (- b 0.5) (log c)) (+ a (+ (+ (* x (log y)) z) t))) (* y i)))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((b - 0.5) * log(c)) + (a + (((x * log(y)) + z) + t))) + (y * i);
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = (((b - 0.5d0) * log(c)) + (a + (((x * log(y)) + z) + t))) + (y * i)
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return (((b - 0.5) * Math.log(c)) + (a + (((x * Math.log(y)) + z) + t))) + (y * i);
}
def code(x, y, z, t, a, b, c, i): return (((b - 0.5) * math.log(c)) + (a + (((x * math.log(y)) + z) + t))) + (y * i)
function code(x, y, z, t, a, b, c, i) return Float64(Float64(Float64(Float64(b - 0.5) * log(c)) + Float64(a + Float64(Float64(Float64(x * log(y)) + z) + t))) + Float64(y * i)) end
function tmp = code(x, y, z, t, a, b, c, i) tmp = (((b - 0.5) * log(c)) + (a + (((x * log(y)) + z) + t))) + (y * i); end
code[x_, y_, z_, t_, a_, b_, c_, i_] := N[(N[(N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision] + N[(a + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y * i), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(b - 0.5\right) \cdot \log c + \left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)\right) + y \cdot i
\end{array}
Initial program 99.9%
Final simplification99.9%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- b 0.5) (log c))))
(if (<= t_1 -4e+109)
(+ (* y i) (+ t_1 (+ a (+ z t))))
(if (<= t_1 1e+138)
(+ (* y i) (+ a (+ (+ (* x (log y)) z) t)))
(+ (* y i) (+ t_1 (+ z a)))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * log(c);
double tmp;
if (t_1 <= -4e+109) {
tmp = (y * i) + (t_1 + (a + (z + t)));
} else if (t_1 <= 1e+138) {
tmp = (y * i) + (a + (((x * log(y)) + z) + t));
} else {
tmp = (y * i) + (t_1 + (z + a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: tmp
t_1 = (b - 0.5d0) * log(c)
if (t_1 <= (-4d+109)) then
tmp = (y * i) + (t_1 + (a + (z + t)))
else if (t_1 <= 1d+138) then
tmp = (y * i) + (a + (((x * log(y)) + z) + t))
else
tmp = (y * i) + (t_1 + (z + a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * Math.log(c);
double tmp;
if (t_1 <= -4e+109) {
tmp = (y * i) + (t_1 + (a + (z + t)));
} else if (t_1 <= 1e+138) {
tmp = (y * i) + (a + (((x * Math.log(y)) + z) + t));
} else {
tmp = (y * i) + (t_1 + (z + a));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (b - 0.5) * math.log(c) tmp = 0 if t_1 <= -4e+109: tmp = (y * i) + (t_1 + (a + (z + t))) elif t_1 <= 1e+138: tmp = (y * i) + (a + (((x * math.log(y)) + z) + t)) else: tmp = (y * i) + (t_1 + (z + a)) return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(b - 0.5) * log(c)) tmp = 0.0 if (t_1 <= -4e+109) tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(a + Float64(z + t)))); elseif (t_1 <= 1e+138) tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(Float64(x * log(y)) + z) + t))); else tmp = Float64(Float64(y * i) + Float64(t_1 + Float64(z + a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (b - 0.5) * log(c); tmp = 0.0; if (t_1 <= -4e+109) tmp = (y * i) + (t_1 + (a + (z + t))); elseif (t_1 <= 1e+138) tmp = (y * i) + (a + (((x * log(y)) + z) + t)); else tmp = (y * i) + (t_1 + (z + a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+109], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(a + N[(z + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+138], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+109}:\\
\;\;\;\;y \cdot i + \left(t\_1 + \left(a + \left(z + t\right)\right)\right)\\
\mathbf{elif}\;t\_1 \leq 10^{+138}:\\
\;\;\;\;y \cdot i + \left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(t\_1 + \left(z + a\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -3.99999999999999993e109Initial program 99.9%
Taylor expanded in x around 0
Simplified92.2%
if -3.99999999999999993e109 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1e138Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
Simplified76.3%
Taylor expanded in b around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6474.8%
Simplified74.8%
Taylor expanded in b around 0
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6498.4%
Simplified98.4%
if 1e138 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.7%
Taylor expanded in z around inf
Simplified82.0%
Final simplification95.2%
(FPCore (x y z t a b c i)
:precision binary64
(let* ((t_1 (* (- b 0.5) (log c))) (t_2 (+ (* y i) (+ t_1 (+ z a)))))
(if (<= t_1 -4e+109)
t_2
(if (<= t_1 1e+138) (+ (* y i) (+ a (+ (+ (* x (log y)) z) t))) t_2))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * log(c);
double t_2 = (y * i) + (t_1 + (z + a));
double tmp;
if (t_1 <= -4e+109) {
tmp = t_2;
} else if (t_1 <= 1e+138) {
tmp = (y * i) + (a + (((x * log(y)) + z) + t));
} else {
tmp = t_2;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (b - 0.5d0) * log(c)
t_2 = (y * i) + (t_1 + (z + a))
if (t_1 <= (-4d+109)) then
tmp = t_2
else if (t_1 <= 1d+138) then
tmp = (y * i) + (a + (((x * log(y)) + z) + t))
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double t_1 = (b - 0.5) * Math.log(c);
double t_2 = (y * i) + (t_1 + (z + a));
double tmp;
if (t_1 <= -4e+109) {
tmp = t_2;
} else if (t_1 <= 1e+138) {
tmp = (y * i) + (a + (((x * Math.log(y)) + z) + t));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): t_1 = (b - 0.5) * math.log(c) t_2 = (y * i) + (t_1 + (z + a)) tmp = 0 if t_1 <= -4e+109: tmp = t_2 elif t_1 <= 1e+138: tmp = (y * i) + (a + (((x * math.log(y)) + z) + t)) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b, c, i) t_1 = Float64(Float64(b - 0.5) * log(c)) t_2 = Float64(Float64(y * i) + Float64(t_1 + Float64(z + a))) tmp = 0.0 if (t_1 <= -4e+109) tmp = t_2; elseif (t_1 <= 1e+138) tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(Float64(x * log(y)) + z) + t))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) t_1 = (b - 0.5) * log(c); t_2 = (y * i) + (t_1 + (z + a)); tmp = 0.0; if (t_1 <= -4e+109) tmp = t_2; elseif (t_1 <= 1e+138) tmp = (y * i) + (a + (((x * log(y)) + z) + t)); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := Block[{t$95$1 = N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(y * i), $MachinePrecision] + N[(t$95$1 + N[(z + a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -4e+109], t$95$2, If[LessEqual[t$95$1, 1e+138], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(b - 0.5\right) \cdot \log c\\
t_2 := y \cdot i + \left(t\_1 + \left(z + a\right)\right)\\
\mathbf{if}\;t\_1 \leq -4 \cdot 10^{+109}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 10^{+138}:\\
\;\;\;\;y \cdot i + \left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < -3.99999999999999993e109 or 1e138 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.8%
Taylor expanded in z around inf
Simplified80.5%
if -3.99999999999999993e109 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1e138Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
Simplified76.3%
Taylor expanded in b around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6474.8%
Simplified74.8%
Taylor expanded in b around 0
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6498.4%
Simplified98.4%
Final simplification93.3%
(FPCore (x y z t a b c i) :precision binary64 (if (<= (* (- b 0.5) (log c)) 1e+138) (+ (* y i) (+ a (+ (+ (* x (log y)) z) t))) (+ (* y i) (+ (+ z t) (* b (log c))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((b - 0.5) * log(c)) <= 1e+138) {
tmp = (y * i) + (a + (((x * log(y)) + z) + t));
} else {
tmp = (y * i) + ((z + t) + (b * log(c)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (((b - 0.5d0) * log(c)) <= 1d+138) then
tmp = (y * i) + (a + (((x * log(y)) + z) + t))
else
tmp = (y * i) + ((z + t) + (b * log(c)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (((b - 0.5) * Math.log(c)) <= 1e+138) {
tmp = (y * i) + (a + (((x * Math.log(y)) + z) + t));
} else {
tmp = (y * i) + ((z + t) + (b * Math.log(c)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if ((b - 0.5) * math.log(c)) <= 1e+138: tmp = (y * i) + (a + (((x * math.log(y)) + z) + t)) else: tmp = (y * i) + ((z + t) + (b * math.log(c))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (Float64(Float64(b - 0.5) * log(c)) <= 1e+138) tmp = Float64(Float64(y * i) + Float64(a + Float64(Float64(Float64(x * log(y)) + z) + t))); else tmp = Float64(Float64(y * i) + Float64(Float64(z + t) + Float64(b * log(c)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (((b - 0.5) * log(c)) <= 1e+138) tmp = (y * i) + (a + (((x * log(y)) + z) + t)); else tmp = (y * i) + ((z + t) + (b * log(c))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[N[(N[(b - 0.5), $MachinePrecision] * N[Log[c], $MachinePrecision]), $MachinePrecision], 1e+138], N[(N[(y * i), $MachinePrecision] + N[(a + N[(N[(N[(x * N[Log[y], $MachinePrecision]), $MachinePrecision] + z), $MachinePrecision] + t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * i), $MachinePrecision] + N[(N[(z + t), $MachinePrecision] + N[(b * N[Log[c], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\left(b - 0.5\right) \cdot \log c \leq 10^{+138}:\\
\;\;\;\;y \cdot i + \left(a + \left(\left(x \cdot \log y + z\right) + t\right)\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot i + \left(\left(z + t\right) + b \cdot \log c\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) < 1e138Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
Simplified76.6%
Taylor expanded in b around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6475.3%
Simplified75.3%
Taylor expanded in b around 0
+-lowering-+.f64N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f6494.3%
Simplified94.3%
if 1e138 < (*.f64 (-.f64 b #s(literal 1/2 binary64)) (log.f64 c)) Initial program 99.7%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
Simplified75.6%
Taylor expanded in b around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6475.6%
Simplified75.6%
Taylor expanded in z around inf
Simplified85.0%
Final simplification93.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= y 5.7e-11) (+ (* (log c) (+ b -0.5)) (+ z a)) (* y (+ (/ z y) (+ i (/ a y))))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 5.7e-11) {
tmp = (log(c) * (b + -0.5)) + (z + a);
} else {
tmp = y * ((z / y) + (i + (a / y)));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (y <= 5.7d-11) then
tmp = (log(c) * (b + (-0.5d0))) + (z + a)
else
tmp = y * ((z / y) + (i + (a / y)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (y <= 5.7e-11) {
tmp = (Math.log(c) * (b + -0.5)) + (z + a);
} else {
tmp = y * ((z / y) + (i + (a / y)));
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if y <= 5.7e-11: tmp = (math.log(c) * (b + -0.5)) + (z + a) else: tmp = y * ((z / y) + (i + (a / y))) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (y <= 5.7e-11) tmp = Float64(Float64(log(c) * Float64(b + -0.5)) + Float64(z + a)); else tmp = Float64(y * Float64(Float64(z / y) + Float64(i + Float64(a / y)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (y <= 5.7e-11) tmp = (log(c) * (b + -0.5)) + (z + a); else tmp = y * ((z / y) + (i + (a / y))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[y, 5.7e-11], N[(N[(N[Log[c], $MachinePrecision] * N[(b + -0.5), $MachinePrecision]), $MachinePrecision] + N[(z + a), $MachinePrecision]), $MachinePrecision], N[(y * N[(N[(z / y), $MachinePrecision] + N[(i + N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 5.7 \cdot 10^{-11}:\\
\;\;\;\;\log c \cdot \left(b + -0.5\right) + \left(z + a\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \left(\frac{z}{y} + \left(i + \frac{a}{y}\right)\right)\\
\end{array}
\end{array}
if y < 5.6999999999999997e-11Initial program 99.8%
Taylor expanded in z around inf
Simplified62.5%
Taylor expanded in y around 0
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
+-lowering-+.f6461.5%
Simplified61.5%
if 5.6999999999999997e-11 < y Initial program 99.9%
Taylor expanded in z around inf
Simplified73.5%
Taylor expanded in y around inf
*-lowering-*.f64N/A
+-commutativeN/A
+-commutativeN/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
associate-/l*N/A
*-lowering-*.f64N/A
log-lowering-log.f64N/A
/-lowering-/.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f64N/A
+-lowering-+.f64N/A
/-lowering-/.f6473.5%
Simplified73.5%
Taylor expanded in z around inf
/-lowering-/.f6466.1%
Simplified66.1%
Final simplification63.9%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -4e+74) (+ (* y i) (+ z t)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -4e+74) {
tmp = (y * i) + (z + t);
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-4d+74)) then
tmp = (y * i) + (z + t)
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -4e+74) {
tmp = (y * i) + (z + t);
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -4e+74: tmp = (y * i) + (z + t) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -4e+74) tmp = Float64(Float64(y * i) + Float64(z + t)); else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -4e+74) tmp = (y * i) + (z + t); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -4e+74], N[(N[(y * i), $MachinePrecision] + N[(z + t), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4 \cdot 10^{+74}:\\
\;\;\;\;y \cdot i + \left(z + t\right)\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -3.99999999999999981e74Initial program 99.9%
Taylor expanded in t around -inf
associate-*r*N/A
sub-negN/A
metadata-evalN/A
distribute-lft-inN/A
associate-*r*N/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
associate-*r*N/A
*-commutativeN/A
associate-*r*N/A
metadata-evalN/A
*-lft-identityN/A
+-lowering-+.f64N/A
Simplified71.8%
Taylor expanded in b around inf
*-commutativeN/A
*-lowering-*.f64N/A
log-lowering-log.f6471.8%
Simplified71.8%
Taylor expanded in z around inf
Simplified78.5%
Taylor expanded in b around 0
+-lowering-+.f6470.0%
Simplified70.0%
if -3.99999999999999981e74 < z Initial program 99.9%
Taylor expanded in a around inf
Simplified44.4%
Final simplification50.1%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.2e+71) (+ z (* y i)) (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.2e+71) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-2.2d+71)) then
tmp = z + (y * i)
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.2e+71) {
tmp = z + (y * i);
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.2e+71: tmp = z + (y * i) else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.2e+71) tmp = Float64(z + Float64(y * i)); else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -2.2e+71) tmp = z + (y * i); else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.2e+71], N[(z + N[(y * i), $MachinePrecision]), $MachinePrecision], N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{+71}:\\
\;\;\;\;z + y \cdot i\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.19999999999999995e71Initial program 99.9%
Taylor expanded in z around inf
Simplified56.9%
if -2.19999999999999995e71 < z Initial program 99.9%
Taylor expanded in a around inf
Simplified44.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.8e+182) z (+ a (* y i))))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.8e+182) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-2.8d+182)) then
tmp = z
else
tmp = a + (y * i)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.8e+182) {
tmp = z;
} else {
tmp = a + (y * i);
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.8e+182: tmp = z else: tmp = a + (y * i) return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.8e+182) tmp = z; else tmp = Float64(a + Float64(y * i)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -2.8e+182) tmp = z; else tmp = a + (y * i); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.8e+182], z, N[(a + N[(y * i), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.8 \cdot 10^{+182}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a + y \cdot i\\
\end{array}
\end{array}
if z < -2.80000000000000006e182Initial program 99.8%
Taylor expanded in z around inf
Simplified46.3%
if -2.80000000000000006e182 < z Initial program 99.9%
Taylor expanded in a around inf
Simplified42.2%
(FPCore (x y z t a b c i) :precision binary64 (if (<= z -2.05e+70) z a))
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.05e+70) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
real(8) :: tmp
if (z <= (-2.05d+70)) then
tmp = z
else
tmp = a
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
double tmp;
if (z <= -2.05e+70) {
tmp = z;
} else {
tmp = a;
}
return tmp;
}
def code(x, y, z, t, a, b, c, i): tmp = 0 if z <= -2.05e+70: tmp = z else: tmp = a return tmp
function code(x, y, z, t, a, b, c, i) tmp = 0.0 if (z <= -2.05e+70) tmp = z; else tmp = a; end return tmp end
function tmp_2 = code(x, y, z, t, a, b, c, i) tmp = 0.0; if (z <= -2.05e+70) tmp = z; else tmp = a; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := If[LessEqual[z, -2.05e+70], z, a]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.05 \cdot 10^{+70}:\\
\;\;\;\;z\\
\mathbf{else}:\\
\;\;\;\;a\\
\end{array}
\end{array}
if z < -2.0500000000000001e70Initial program 99.9%
Taylor expanded in z around inf
Simplified38.4%
if -2.0500000000000001e70 < z Initial program 99.9%
Taylor expanded in a around inf
Simplified23.4%
(FPCore (x y z t a b c i) :precision binary64 a)
double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
real(8) function code(x, y, z, t, a, b, c, i)
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), intent (in) :: c
real(8), intent (in) :: i
code = a
end function
public static double code(double x, double y, double z, double t, double a, double b, double c, double i) {
return a;
}
def code(x, y, z, t, a, b, c, i): return a
function code(x, y, z, t, a, b, c, i) return a end
function tmp = code(x, y, z, t, a, b, c, i) tmp = a; end
code[x_, y_, z_, t_, a_, b_, c_, i_] := a
\begin{array}{l}
\\
a
\end{array}
Initial program 99.9%
Taylor expanded in a around inf
Simplified20.6%
herbie shell --seed 2024138
(FPCore (x y z t a b c i)
:name "Numeric.SpecFunctions:logBeta from math-functions-0.1.5.2, B"
:precision binary64
(+ (+ (+ (+ (+ (* x (log y)) z) t) a) (* (- b 0.5) (log c))) (* y i)))