
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - 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 * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - 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 * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
(FPCore (x y z t a b) :precision binary64 (* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))
double code(double x, double y, double z, double t, double a, double b) {
return x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - 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 * exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
}
def code(x, y, z, t, a, b): return x * math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b))))
function code(x, y, z, t, a, b) return Float64(x * exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b))))) end
function tmp = code(x, y, z, t, a, b) tmp = x * exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); end
code[x_, y_, z_, t_, a_, b_] := N[(x * N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}
\end{array}
Initial program 93.9%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b)))))) (if (or (<= t_1 0.0) (not (<= t_1 1.0))) (* x (* (- t) y)) (* x 1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b))));
double tmp;
if ((t_1 <= 0.0) || !(t_1 <= 1.0)) {
tmp = x * (-t * y);
} else {
tmp = x * 1.0;
}
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 = exp(((y * (log(z) - t)) + (a * (log((1.0d0 - z)) - b))))
if ((t_1 <= 0.0d0) .or. (.not. (t_1 <= 1.0d0))) then
tmp = x * (-t * y)
else
tmp = x * 1.0d0
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 = Math.exp(((y * (Math.log(z) - t)) + (a * (Math.log((1.0 - z)) - b))));
double tmp;
if ((t_1 <= 0.0) || !(t_1 <= 1.0)) {
tmp = x * (-t * y);
} else {
tmp = x * 1.0;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.exp(((y * (math.log(z) - t)) + (a * (math.log((1.0 - z)) - b)))) tmp = 0 if (t_1 <= 0.0) or not (t_1 <= 1.0): tmp = x * (-t * y) else: tmp = x * 1.0 return tmp
function code(x, y, z, t, a, b) t_1 = exp(Float64(Float64(y * Float64(log(z) - t)) + Float64(a * Float64(log(Float64(1.0 - z)) - b)))) tmp = 0.0 if ((t_1 <= 0.0) || !(t_1 <= 1.0)) tmp = Float64(x * Float64(Float64(-t) * y)); else tmp = Float64(x * 1.0); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = exp(((y * (log(z) - t)) + (a * (log((1.0 - z)) - b)))); tmp = 0.0; if ((t_1 <= 0.0) || ~((t_1 <= 1.0))) tmp = x * (-t * y); else tmp = x * 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Exp[N[(N[(y * N[(N[Log[z], $MachinePrecision] - t), $MachinePrecision]), $MachinePrecision] + N[(a * N[(N[Log[N[(1.0 - z), $MachinePrecision]], $MachinePrecision] - b), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[t$95$1, 0.0], N[Not[LessEqual[t$95$1, 1.0]], $MachinePrecision]], N[(x * N[((-t) * y), $MachinePrecision]), $MachinePrecision], N[(x * 1.0), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := e^{y \cdot \left(\log z - t\right) + a \cdot \left(\log \left(1 - z\right) - b\right)}\\
\mathbf{if}\;t\_1 \leq 0 \lor \neg \left(t\_1 \leq 1\right):\\
\;\;\;\;x \cdot \left(\left(-t\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot 1\\
\end{array}
\end{array}
if (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 0.0 or 1 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) Initial program 95.8%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6473.2
Applied rewrites73.2%
Taylor expanded in t around 0
Applied rewrites32.7%
Taylor expanded in y around 0
Applied rewrites14.7%
Taylor expanded in t around inf
Applied rewrites16.4%
if 0.0 < (exp.f64 (+.f64 (*.f64 y (-.f64 (log.f64 z) t)) (*.f64 a (-.f64 (log.f64 (-.f64 #s(literal 1 binary64) z)) b)))) < 1Initial program 85.2%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6462.0
Applied rewrites62.0%
Taylor expanded in t around 0
Applied rewrites84.4%
Taylor expanded in y around 0
Applied rewrites83.8%
Final simplification28.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.6e-107) (not (<= y 2.75e-9))) (* x (pow (/ z (exp t)) y)) (* x (exp (* (- (- z) b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.6e-107) || !(y <= 2.75e-9)) {
tmp = x * pow((z / exp(t)), y);
} else {
tmp = x * exp(((-z - b) * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-6.6d-107)) .or. (.not. (y <= 2.75d-9))) then
tmp = x * ((z / exp(t)) ** y)
else
tmp = x * exp(((-z - b) * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.6e-107) || !(y <= 2.75e-9)) {
tmp = x * Math.pow((z / Math.exp(t)), y);
} else {
tmp = x * Math.exp(((-z - b) * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.6e-107) or not (y <= 2.75e-9): tmp = x * math.pow((z / math.exp(t)), y) else: tmp = x * math.exp(((-z - b) * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.6e-107) || !(y <= 2.75e-9)) tmp = Float64(x * (Float64(z / exp(t)) ^ y)); else tmp = Float64(x * exp(Float64(Float64(Float64(-z) - b) * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.6e-107) || ~((y <= 2.75e-9))) tmp = x * ((z / exp(t)) ^ y); else tmp = x * exp(((-z - b) * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.6e-107], N[Not[LessEqual[y, 2.75e-9]], $MachinePrecision]], N[(x * N[Power[N[(z / N[Exp[t], $MachinePrecision]), $MachinePrecision], y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{-107} \lor \neg \left(y \leq 2.75 \cdot 10^{-9}\right):\\
\;\;\;\;x \cdot {\left(\frac{z}{e^{t}}\right)}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\
\end{array}
\end{array}
if y < -6.60000000000000007e-107 or 2.7499999999999998e-9 < y Initial program 94.6%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6488.1
Applied rewrites88.1%
if -6.60000000000000007e-107 < y < 2.7499999999999998e-9Initial program 92.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6489.3
Applied rewrites89.3%
Taylor expanded in z around 0
Applied rewrites89.3%
Final simplification88.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.85e+25) (not (<= t 5.1e+22))) (* x (exp (* (- t) y))) (* x (exp (* (- (- z) b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.85e+25) || !(t <= 5.1e+22)) {
tmp = x * exp((-t * y));
} else {
tmp = x * exp(((-z - b) * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.85d+25)) .or. (.not. (t <= 5.1d+22))) then
tmp = x * exp((-t * y))
else
tmp = x * exp(((-z - b) * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.85e+25) || !(t <= 5.1e+22)) {
tmp = x * Math.exp((-t * y));
} else {
tmp = x * Math.exp(((-z - b) * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.85e+25) or not (t <= 5.1e+22): tmp = x * math.exp((-t * y)) else: tmp = x * math.exp(((-z - b) * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.85e+25) || !(t <= 5.1e+22)) tmp = Float64(x * exp(Float64(Float64(-t) * y))); else tmp = Float64(x * exp(Float64(Float64(Float64(-z) - b) * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.85e+25) || ~((t <= 5.1e+22))) tmp = x * exp((-t * y)); else tmp = x * exp(((-z - b) * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.85e+25], N[Not[LessEqual[t, 5.1e+22]], $MachinePrecision]], N[(x * N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[(N[((-z) - b), $MachinePrecision] * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+25} \lor \neg \left(t \leq 5.1 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(\left(-z\right) - b\right) \cdot a}\\
\end{array}
\end{array}
if t < -1.8499999999999999e25 or 5.1000000000000002e22 < t Initial program 94.7%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6484.5
Applied rewrites84.5%
if -1.8499999999999999e25 < t < 5.1000000000000002e22Initial program 93.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6475.4
Applied rewrites75.4%
Taylor expanded in z around 0
Applied rewrites75.4%
Final simplification79.4%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -1.85e+25) (not (<= t 5.1e+22))) (* x (exp (* (- t) y))) (* x (exp (* (- b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.85e+25) || !(t <= 5.1e+22)) {
tmp = x * exp((-t * y));
} else {
tmp = x * exp((-b * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((t <= (-1.85d+25)) .or. (.not. (t <= 5.1d+22))) then
tmp = x * exp((-t * y))
else
tmp = x * exp((-b * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -1.85e+25) || !(t <= 5.1e+22)) {
tmp = x * Math.exp((-t * y));
} else {
tmp = x * Math.exp((-b * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -1.85e+25) or not (t <= 5.1e+22): tmp = x * math.exp((-t * y)) else: tmp = x * math.exp((-b * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -1.85e+25) || !(t <= 5.1e+22)) tmp = Float64(x * exp(Float64(Float64(-t) * y))); else tmp = Float64(x * exp(Float64(Float64(-b) * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -1.85e+25) || ~((t <= 5.1e+22))) tmp = x * exp((-t * y)); else tmp = x * exp((-b * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -1.85e+25], N[Not[LessEqual[t, 5.1e+22]], $MachinePrecision]], N[(x * N[Exp[N[((-t) * y), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.85 \cdot 10^{+25} \lor \neg \left(t \leq 5.1 \cdot 10^{+22}\right):\\
\;\;\;\;x \cdot e^{\left(-t\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
\end{array}
\end{array}
if t < -1.8499999999999999e25 or 5.1000000000000002e22 < t Initial program 94.7%
Taylor expanded in t around inf
associate-*r*N/A
mul-1-negN/A
lower-*.f64N/A
lower-neg.f6484.5
Applied rewrites84.5%
if -1.8499999999999999e25 < t < 5.1000000000000002e22Initial program 93.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6475.4
Applied rewrites75.4%
Taylor expanded in z around 0
Applied rewrites66.6%
Final simplification74.5%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e+73) (not (<= y 145000.0))) (* x (pow z y)) (* x (exp (* (- b) a)))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+73) || !(y <= 145000.0)) {
tmp = x * pow(z, y);
} else {
tmp = x * exp((-b * a));
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if ((y <= (-1.55d+73)) .or. (.not. (y <= 145000.0d0))) then
tmp = x * (z ** y)
else
tmp = x * exp((-b * a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+73) || !(y <= 145000.0)) {
tmp = x * Math.pow(z, y);
} else {
tmp = x * Math.exp((-b * a));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.55e+73) or not (y <= 145000.0): tmp = x * math.pow(z, y) else: tmp = x * math.exp((-b * a)) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e+73) || !(y <= 145000.0)) tmp = Float64(x * (z ^ y)); else tmp = Float64(x * exp(Float64(Float64(-b) * a))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.55e+73) || ~((y <= 145000.0))) tmp = x * (z ^ y); else tmp = x * exp((-b * a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e+73], N[Not[LessEqual[y, 145000.0]], $MachinePrecision]], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision], N[(x * N[Exp[N[((-b) * a), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+73} \lor \neg \left(y \leq 145000\right):\\
\;\;\;\;x \cdot {z}^{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot e^{\left(-b\right) \cdot a}\\
\end{array}
\end{array}
if y < -1.55e73 or 145000 < y Initial program 93.4%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6493.5
Applied rewrites93.5%
Taylor expanded in t around 0
Applied rewrites71.2%
if -1.55e73 < y < 145000Initial program 94.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
sub-negN/A
lower-log1p.f64N/A
lower-neg.f6481.2
Applied rewrites81.2%
Taylor expanded in z around 0
Applied rewrites74.2%
Final simplification72.9%
(FPCore (x y z t a b) :precision binary64 (if (<= t -6.4e+34) (* x (* (- t) y)) (* x (pow z y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (t <= -6.4e+34) {
tmp = x * (-t * y);
} else {
tmp = x * pow(z, 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 (t <= (-6.4d+34)) then
tmp = x * (-t * y)
else
tmp = x * (z ** 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 (t <= -6.4e+34) {
tmp = x * (-t * y);
} else {
tmp = x * Math.pow(z, y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if t <= -6.4e+34: tmp = x * (-t * y) else: tmp = x * math.pow(z, y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (t <= -6.4e+34) tmp = Float64(x * Float64(Float64(-t) * y)); else tmp = Float64(x * (z ^ y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (t <= -6.4e+34) tmp = x * (-t * y); else tmp = x * (z ^ y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[t, -6.4e+34], N[(x * N[((-t) * y), $MachinePrecision]), $MachinePrecision], N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.4 \cdot 10^{+34}:\\
\;\;\;\;x \cdot \left(\left(-t\right) \cdot y\right)\\
\mathbf{else}:\\
\;\;\;\;x \cdot {z}^{y}\\
\end{array}
\end{array}
if t < -6.3999999999999997e34Initial program 93.5%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6482.4
Applied rewrites82.4%
Taylor expanded in t around 0
Applied rewrites10.2%
Taylor expanded in y around 0
Applied rewrites25.2%
Taylor expanded in t around inf
Applied rewrites19.1%
if -6.3999999999999997e34 < t Initial program 94.0%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6467.7
Applied rewrites67.7%
Taylor expanded in t around 0
Applied rewrites60.6%
(FPCore (x y z t a b) :precision binary64 (* x 1.0))
double code(double x, double y, double z, double t, double a, double b) {
return x * 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 = x * 1.0d0
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x * 1.0;
}
def code(x, y, z, t, a, b): return x * 1.0
function code(x, y, z, t, a, b) return Float64(x * 1.0) end
function tmp = code(x, y, z, t, a, b) tmp = x * 1.0; end
code[x_, y_, z_, t_, a_, b_] := N[(x * 1.0), $MachinePrecision]
\begin{array}{l}
\\
x \cdot 1
\end{array}
Initial program 93.9%
Taylor expanded in a around 0
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
exp-diffN/A
rem-exp-logN/A
lower-/.f64N/A
lower-exp.f6471.2
Applied rewrites71.2%
Taylor expanded in t around 0
Applied rewrites48.7%
Taylor expanded in y around 0
Applied rewrites18.3%
herbie shell --seed 2024318
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaApprox from math-functions-0.1.5.2, B"
:precision binary64
(* x (exp (+ (* y (- (log z) t)) (* a (- (log (- 1.0 z)) b))))))