
(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 12 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 (+ y (- (+ x (* (+ a -0.5) b)) (* z (+ (log t) -1.0)))))
double code(double x, double y, double z, double t, double a, double b) {
return y + ((x + ((a + -0.5) * b)) - (z * (log(t) + -1.0)));
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = y + ((x + ((a + (-0.5d0)) * b)) - (z * (log(t) + (-1.0d0))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return y + ((x + ((a + -0.5) * b)) - (z * (Math.log(t) + -1.0)));
}
def code(x, y, z, t, a, b): return y + ((x + ((a + -0.5) * b)) - (z * (math.log(t) + -1.0)))
function code(x, y, z, t, a, b) return Float64(y + Float64(Float64(x + Float64(Float64(a + -0.5) * b)) - Float64(z * Float64(log(t) + -1.0)))) end
function tmp = code(x, y, z, t, a, b) tmp = y + ((x + ((a + -0.5) * b)) - (z * (log(t) + -1.0))); end
code[x_, y_, z_, t_, a_, b_] := N[(y + N[(N[(x + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision] - N[(z * N[(N[Log[t], $MachinePrecision] + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y + \left(\left(x + \left(a + -0.5\right) \cdot b\right) - z \cdot \left(\log t + -1\right)\right)
\end{array}
Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* b (- a 0.5))))
(if (<= t_1 -2e+25)
(+ x (+ y (* (+ a -0.5) b)))
(if (<= t_1 2e+58)
(+ (* z (- 1.0 (log t))) (+ y x))
(+ x (* b (+ a (+ -0.5 (/ y 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+25) {
tmp = x + (y + ((a + -0.5) * b));
} else if (t_1 <= 2e+58) {
tmp = (z * (1.0 - log(t))) + (y + x);
} else {
tmp = x + (b * (a + (-0.5 + (y / 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+25)) then
tmp = x + (y + ((a + (-0.5d0)) * b))
else if (t_1 <= 2d+58) then
tmp = (z * (1.0d0 - log(t))) + (y + x)
else
tmp = x + (b * (a + ((-0.5d0) + (y / 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+25) {
tmp = x + (y + ((a + -0.5) * b));
} else if (t_1 <= 2e+58) {
tmp = (z * (1.0 - Math.log(t))) + (y + x);
} else {
tmp = x + (b * (a + (-0.5 + (y / b))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = b * (a - 0.5) tmp = 0 if t_1 <= -2e+25: tmp = x + (y + ((a + -0.5) * b)) elif t_1 <= 2e+58: tmp = (z * (1.0 - math.log(t))) + (y + x) else: tmp = x + (b * (a + (-0.5 + (y / 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+25) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); elseif (t_1 <= 2e+58) tmp = Float64(Float64(z * Float64(1.0 - log(t))) + Float64(y + x)); else tmp = Float64(x + Float64(b * Float64(a + Float64(-0.5 + Float64(y / 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+25) tmp = x + (y + ((a + -0.5) * b)); elseif (t_1 <= 2e+58) tmp = (z * (1.0 - log(t))) + (y + x); else tmp = x + (b * (a + (-0.5 + (y / 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+25], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 2e+58], N[(N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(y + x), $MachinePrecision]), $MachinePrecision], N[(x + N[(b * N[(a + N[(-0.5 + N[(y / b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := b \cdot \left(a - 0.5\right)\\
\mathbf{if}\;t\_1 \leq -2 \cdot 10^{+25}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+58}:\\
\;\;\;\;z \cdot \left(1 - \log t\right) + \left(y + x\right)\\
\mathbf{else}:\\
\;\;\;\;x + b \cdot \left(a + \left(-0.5 + \frac{y}{b}\right)\right)\\
\end{array}
\end{array}
if (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < -2.00000000000000018e25Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified100.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6492.5%
Simplified92.5%
if -2.00000000000000018e25 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) < 1.99999999999999989e58Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in b around 0
sub-negN/A
+-lowering-+.f64N/A
+-lowering-+.f64N/A
distribute-rgt-neg-inN/A
neg-sub0N/A
associate-+l-N/A
neg-sub0N/A
log-recN/A
+-commutativeN/A
log-recN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6494.0%
Simplified94.0%
if 1.99999999999999989e58 < (*.f64 (-.f64 a #s(literal 1/2 binary64)) b) Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified100.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6496.6%
Simplified96.6%
Taylor expanded in b around inf
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
*-lowering-*.f64N/A
+-commutativeN/A
associate--l+N/A
+-commutativeN/A
associate--l+N/A
+-lowering-+.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f64N/A
/-lowering-/.f6495.0%
Simplified95.0%
Final simplification93.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (+ y (* z (- 1.0 (log t))))))
(if (<= z -1.65e+207)
t_1
(if (<= z 1.7e+200) (+ x (+ y (* (+ a -0.5) b))) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = y + (z * (1.0 - log(t)));
double tmp;
if (z <= -1.65e+207) {
tmp = t_1;
} else if (z <= 1.7e+200) {
tmp = x + (y + ((a + -0.5) * b));
} 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 = y + (z * (1.0d0 - log(t)))
if (z <= (-1.65d+207)) then
tmp = t_1
else if (z <= 1.7d+200) then
tmp = x + (y + ((a + (-0.5d0)) * b))
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 = y + (z * (1.0 - Math.log(t)));
double tmp;
if (z <= -1.65e+207) {
tmp = t_1;
} else if (z <= 1.7e+200) {
tmp = x + (y + ((a + -0.5) * b));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = y + (z * (1.0 - math.log(t))) tmp = 0 if z <= -1.65e+207: tmp = t_1 elif z <= 1.7e+200: tmp = x + (y + ((a + -0.5) * b)) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(y + Float64(z * Float64(1.0 - log(t)))) tmp = 0.0 if (z <= -1.65e+207) tmp = t_1; elseif (z <= 1.7e+200) tmp = Float64(x + Float64(y + Float64(Float64(a + -0.5) * b))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = y + (z * (1.0 - log(t))); tmp = 0.0; if (z <= -1.65e+207) tmp = t_1; elseif (z <= 1.7e+200) tmp = x + (y + ((a + -0.5) * b)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(y + N[(z * N[(1.0 - N[Log[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.65e+207], t$95$1, If[LessEqual[z, 1.7e+200], N[(x + N[(y + N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y + z \cdot \left(1 - \log t\right)\\
\mathbf{if}\;z \leq -1.65 \cdot 10^{+207}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.7 \cdot 10^{+200}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.65e207 or 1.69999999999999985e200 < z Initial program 99.7%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.8%
Taylor expanded in z around inf
sub-negN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6471.2%
Simplified71.2%
if -1.65e207 < z < 1.69999999999999985e200Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified100.0%
Taylor expanded in z around 0
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6489.3%
Simplified89.3%
Final simplification86.4%
(FPCore (x y z t a b) :precision binary64 (if (<= z -4.8e+208) (* z (- 1.0 (log t))) (+ x (+ y (* (+ a -0.5) b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (z <= -4.8e+208) {
tmp = z * (1.0 - log(t));
} 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 (z <= (-4.8d+208)) then
tmp = z * (1.0d0 - log(t))
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 (z <= -4.8e+208) {
tmp = z * (1.0 - Math.log(t));
} else {
tmp = x + (y + ((a + -0.5) * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if z <= -4.8e+208: tmp = z * (1.0 - math.log(t)) else: tmp = x + (y + ((a + -0.5) * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (z <= -4.8e+208) tmp = Float64(z * Float64(1.0 - log(t))); 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 (z <= -4.8e+208) tmp = z * (1.0 - log(t)); else tmp = x + (y + ((a + -0.5) * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[z, -4.8e+208], N[(z * N[(1.0 - N[Log[t], $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}\;z \leq -4.8 \cdot 10^{+208}:\\
\;\;\;\;z \cdot \left(1 - \log t\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + \left(a + -0.5\right) \cdot b\right)\\
\end{array}
\end{array}
if z < -4.79999999999999973e208Initial program 99.8%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in z around inf
sub-negN/A
mul-1-negN/A
*-lowering-*.f64N/A
mul-1-negN/A
sub-negN/A
--lowering--.f64N/A
log-lowering-log.f6462.6%
Simplified62.6%
if -4.79999999999999973e208 < z Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6485.6%
Simplified85.6%
Final simplification83.7%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (* (+ a -0.5) b))) (if (<= b -850000000000.0) t_1 (if (<= b 2.25e+49) (+ y x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (a + -0.5) * b;
double tmp;
if (b <= -850000000000.0) {
tmp = t_1;
} else if (b <= 2.25e+49) {
tmp = y + x;
} 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 = (a + (-0.5d0)) * b
if (b <= (-850000000000.0d0)) then
tmp = t_1
else if (b <= 2.25d+49) then
tmp = y + x
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 = (a + -0.5) * b;
double tmp;
if (b <= -850000000000.0) {
tmp = t_1;
} else if (b <= 2.25e+49) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (a + -0.5) * b tmp = 0 if b <= -850000000000.0: tmp = t_1 elif b <= 2.25e+49: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(a + -0.5) * b) tmp = 0.0 if (b <= -850000000000.0) tmp = t_1; elseif (b <= 2.25e+49) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (a + -0.5) * b; tmp = 0.0; if (b <= -850000000000.0) tmp = t_1; elseif (b <= 2.25e+49) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(a + -0.5), $MachinePrecision] * b), $MachinePrecision]}, If[LessEqual[b, -850000000000.0], t$95$1, If[LessEqual[b, 2.25e+49], N[(y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(a + -0.5\right) \cdot b\\
\mathbf{if}\;b \leq -850000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.25 \cdot 10^{+49}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -8.5e11 or 2.24999999999999991e49 < b Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified100.0%
Taylor expanded in b around inf
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6478.3%
Simplified78.3%
if -8.5e11 < b < 2.24999999999999991e49Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified62.3%
Final simplification68.9%
(FPCore (x y z t a b) :precision binary64 (if (<= b -29000000000000.0) (* a b) (if (<= b 1.7e+102) (+ y x) (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -29000000000000.0) {
tmp = a * b;
} else if (b <= 1.7e+102) {
tmp = y + 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 (b <= (-29000000000000.0d0)) then
tmp = a * b
else if (b <= 1.7d+102) then
tmp = y + 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 (b <= -29000000000000.0) {
tmp = a * b;
} else if (b <= 1.7e+102) {
tmp = y + x;
} else {
tmp = a * b;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -29000000000000.0: tmp = a * b elif b <= 1.7e+102: tmp = y + x else: tmp = a * b return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -29000000000000.0) tmp = Float64(a * b); elseif (b <= 1.7e+102) tmp = Float64(y + x); else tmp = Float64(a * b); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -29000000000000.0) tmp = a * b; elseif (b <= 1.7e+102) tmp = y + x; else tmp = a * b; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -29000000000000.0], N[(a * b), $MachinePrecision], If[LessEqual[b, 1.7e+102], N[(y + x), $MachinePrecision], N[(a * b), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -29000000000000:\\
\;\;\;\;a \cdot b\\
\mathbf{elif}\;b \leq 1.7 \cdot 10^{+102}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;a \cdot b\\
\end{array}
\end{array}
if b < -2.9e13 or 1.7e102 < b Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified100.0%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6453.1%
Simplified53.1%
if -2.9e13 < b < 1.7e102Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified61.4%
Final simplification58.2%
(FPCore (x y z t a b) :precision binary64 (if (<= x -8.4e+37) x (if (<= x 1.75e-245) (* a b) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= -8.4e+37) {
tmp = x;
} else if (x <= 1.75e-245) {
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 (x <= (-8.4d+37)) then
tmp = x
else if (x <= 1.75d-245) 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 (x <= -8.4e+37) {
tmp = x;
} else if (x <= 1.75e-245) {
tmp = a * b;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= -8.4e+37: tmp = x elif x <= 1.75e-245: tmp = a * b else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= -8.4e+37) tmp = x; elseif (x <= 1.75e-245) 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 (x <= -8.4e+37) tmp = x; elseif (x <= 1.75e-245) tmp = a * b; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, -8.4e+37], x, If[LessEqual[x, 1.75e-245], N[(a * b), $MachinePrecision], y]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.4 \cdot 10^{+37}:\\
\;\;\;\;x\\
\mathbf{elif}\;x \leq 1.75 \cdot 10^{-245}:\\
\;\;\;\;a \cdot b\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -8.4000000000000004e37Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified45.5%
if -8.4000000000000004e37 < x < 1.75000000000000008e-245Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6431.2%
Simplified31.2%
if 1.75000000000000008e-245 < x Initial program 100.0%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified100.0%
Taylor expanded in y around inf
Simplified25.9%
Final simplification31.9%
(FPCore (x y z t a b) :precision binary64 (if (<= y 1.55e-28) (+ x (* b (- a 0.5))) (+ x (+ y (* a b)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 1.55e-28) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + (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 (y <= 1.55d-28) then
tmp = x + (b * (a - 0.5d0))
else
tmp = x + (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 (y <= 1.55e-28) {
tmp = x + (b * (a - 0.5));
} else {
tmp = x + (y + (a * b));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 1.55e-28: tmp = x + (b * (a - 0.5)) else: tmp = x + (y + (a * b)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 1.55e-28) tmp = Float64(x + Float64(b * Float64(a - 0.5))); else tmp = Float64(x + Float64(y + Float64(a * b))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 1.55e-28) tmp = x + (b * (a - 0.5)); else tmp = x + (y + (a * b)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 1.55e-28], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 1.55 \cdot 10^{-28}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(y + a \cdot b\right)\\
\end{array}
\end{array}
if y < 1.54999999999999996e-28Initial program 99.9%
Taylor expanded in x around inf
Simplified62.1%
if 1.54999999999999996e-28 < y Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6493.4%
Simplified93.4%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6490.8%
Simplified90.8%
Final simplification70.3%
(FPCore (x y z t a b) :precision binary64 (if (<= y 3.5e+53) (+ x (* b (- a 0.5))) (+ y (* a b))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 3.5e+53) {
tmp = x + (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 (y <= 3.5d+53) then
tmp = x + (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 (y <= 3.5e+53) {
tmp = x + (b * (a - 0.5));
} else {
tmp = y + (a * b);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 3.5e+53: tmp = x + (b * (a - 0.5)) else: tmp = y + (a * b) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 3.5e+53) tmp = Float64(x + 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 (y <= 3.5e+53) tmp = x + (b * (a - 0.5)); else tmp = y + (a * b); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 3.5e+53], N[(x + N[(b * N[(a - 0.5), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + N[(a * b), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.5 \cdot 10^{+53}:\\
\;\;\;\;x + b \cdot \left(a - 0.5\right)\\
\mathbf{else}:\\
\;\;\;\;y + a \cdot b\\
\end{array}
\end{array}
if y < 3.50000000000000019e53Initial program 99.9%
Taylor expanded in x around inf
Simplified63.2%
if 3.50000000000000019e53 < y Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in a around inf
*-commutativeN/A
*-lowering-*.f6477.0%
Simplified77.0%
Final simplification66.1%
(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.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in z around 0
+-lowering-+.f64N/A
+-commutativeN/A
+-lowering-+.f64N/A
*-lowering-*.f64N/A
sub-negN/A
metadata-evalN/A
+-lowering-+.f6481.8%
Simplified81.8%
Final simplification81.8%
(FPCore (x y z t a b) :precision binary64 (if (<= y 2.7e+53) x y))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= 2.7e+53) {
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 <= 2.7d+53) 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 <= 2.7e+53) {
tmp = x;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= 2.7e+53: tmp = x else: tmp = y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= 2.7e+53) tmp = x; else tmp = y; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= 2.7e+53) tmp = x; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, 2.7e+53], x, y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.7 \cdot 10^{+53}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 2.70000000000000019e53Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified23.6%
if 2.70000000000000019e53 < y Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in y around inf
Simplified51.7%
(FPCore (x y z t a b) :precision binary64 x)
double code(double x, double y, double z, double t, double a, double b) {
return x;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
code = x
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x;
}
def code(x, y, z, t, a, b): return x
function code(x, y, z, t, a, b) return x end
function tmp = code(x, y, z, t, a, b) tmp = x; end
code[x_, y_, z_, t_, a_, b_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 99.9%
sub-negN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
associate-+l+N/A
+-lowering-+.f64N/A
+-commutativeN/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
associate-+r+N/A
+-commutativeN/A
associate-+r+N/A
unsub-negN/A
associate-+l-N/A
Simplified99.9%
Taylor expanded in x around inf
Simplified21.5%
(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 2024192
(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)))