
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
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 - 1.0d0) * log(a))) - b))) / y
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 - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 14 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
}
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 - 1.0d0) * log(a))) - b))) / y
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 - 1.0) * Math.log(a))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + ((t - 1.0) * math.log(a))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(Float64(t - 1.0) * log(a))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \left(t - 1\right) \cdot \log a\right) - b}}{y}
\end{array}
(FPCore (x y z t a b) :precision binary64 (/ (* x (exp (- (+ (* y (log z)) (* (log a) (+ t -1.0))) b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x * exp((((y * log(z)) + (log(a) * (t + -1.0))) - b))) / y;
}
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)) + (log(a) * (t + (-1.0d0)))) - b))) / y
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)) + (Math.log(a) * (t + -1.0))) - b))) / y;
}
def code(x, y, z, t, a, b): return (x * math.exp((((y * math.log(z)) + (math.log(a) * (t + -1.0))) - b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) + Float64(log(a) * Float64(t + -1.0))) - b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x * exp((((y * log(z)) + (log(a) * (t + -1.0))) - b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] + N[(N[Log[a], $MachinePrecision] * N[(t + -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot e^{\left(y \cdot \log z + \log a \cdot \left(t + -1\right)\right) - b}}{y}
\end{array}
Initial program 98.9%
Final simplification98.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.6e+69) (not (<= y 3.9e+37))) (/ (* x (exp (- (- (* y (log z)) (log a)) b))) y) (/ (* x (exp (- (* (log a) (+ t -1.0)) b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.6e+69) || !(y <= 3.9e+37)) {
tmp = (x * exp((((y * log(z)) - log(a)) - b))) / y;
} else {
tmp = (x * exp(((log(a) * (t + -1.0)) - b))) / 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 <= (-6.6d+69)) .or. (.not. (y <= 3.9d+37))) then
tmp = (x * exp((((y * log(z)) - log(a)) - b))) / y
else
tmp = (x * exp(((log(a) * (t + (-1.0d0))) - b))) / 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 <= -6.6e+69) || !(y <= 3.9e+37)) {
tmp = (x * Math.exp((((y * Math.log(z)) - Math.log(a)) - b))) / y;
} else {
tmp = (x * Math.exp(((Math.log(a) * (t + -1.0)) - b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.6e+69) or not (y <= 3.9e+37): tmp = (x * math.exp((((y * math.log(z)) - math.log(a)) - b))) / y else: tmp = (x * math.exp(((math.log(a) * (t + -1.0)) - b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.6e+69) || !(y <= 3.9e+37)) tmp = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) - log(a)) - b))) / y); else tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t + -1.0)) - b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.6e+69) || ~((y <= 3.9e+37))) tmp = (x * exp((((y * log(z)) - log(a)) - b))) / y; else tmp = (x * exp(((log(a) * (t + -1.0)) - b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.6e+69], N[Not[LessEqual[y, 3.9e+37]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision] - N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t + -1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.6 \cdot 10^{+69} \lor \neg \left(y \leq 3.9 \cdot 10^{+37}\right):\\
\;\;\;\;\frac{x \cdot e^{\left(y \cdot \log z - \log a\right) - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t + -1\right) - b}}{y}\\
\end{array}
\end{array}
if y < -6.5999999999999997e69 or 3.8999999999999999e37 < y Initial program 100.0%
Taylor expanded in t around 0 94.0%
+-commutative94.0%
mul-1-neg94.0%
unsub-neg94.0%
Simplified94.0%
if -6.5999999999999997e69 < y < 3.8999999999999999e37Initial program 98.0%
*-commutative98.0%
associate-/l*89.5%
associate--l+89.5%
fma-define89.5%
sub-neg89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in y around 0 95.2%
Final simplification94.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.8e+69) (not (<= y 5.5e+37))) (/ (/ (* x (pow z y)) a) y) (/ (* x (exp (- (* (log a) (+ t -1.0)) b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.8e+69) || !(y <= 5.5e+37)) {
tmp = ((x * pow(z, y)) / a) / y;
} else {
tmp = (x * exp(((log(a) * (t + -1.0)) - b))) / 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 <= (-6.8d+69)) .or. (.not. (y <= 5.5d+37))) then
tmp = ((x * (z ** y)) / a) / y
else
tmp = (x * exp(((log(a) * (t + (-1.0d0))) - b))) / 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 <= -6.8e+69) || !(y <= 5.5e+37)) {
tmp = ((x * Math.pow(z, y)) / a) / y;
} else {
tmp = (x * Math.exp(((Math.log(a) * (t + -1.0)) - b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.8e+69) or not (y <= 5.5e+37): tmp = ((x * math.pow(z, y)) / a) / y else: tmp = (x * math.exp(((math.log(a) * (t + -1.0)) - b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.8e+69) || !(y <= 5.5e+37)) tmp = Float64(Float64(Float64(x * (z ^ y)) / a) / y); else tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * Float64(t + -1.0)) - b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.8e+69) || ~((y <= 5.5e+37))) tmp = ((x * (z ^ y)) / a) / y; else tmp = (x * exp(((log(a) * (t + -1.0)) - b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.8e+69], N[Not[LessEqual[y, 5.5e+37]], $MachinePrecision]], N[(N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t + -1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.8 \cdot 10^{+69} \lor \neg \left(y \leq 5.5 \cdot 10^{+37}\right):\\
\;\;\;\;\frac{\frac{x \cdot {z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot \left(t + -1\right) - b}}{y}\\
\end{array}
\end{array}
if y < -6.79999999999999973e69 or 5.50000000000000016e37 < y Initial program 100.0%
Taylor expanded in t around 0 94.0%
+-commutative94.0%
mul-1-neg94.0%
unsub-neg94.0%
Simplified94.0%
Taylor expanded in b around 0 86.2%
div-exp86.2%
*-commutative86.2%
exp-to-pow86.2%
rem-exp-log86.2%
associate-*r/86.2%
Simplified86.2%
if -6.79999999999999973e69 < y < 5.50000000000000016e37Initial program 98.0%
*-commutative98.0%
associate-/l*89.5%
associate--l+89.5%
fma-define89.5%
sub-neg89.5%
metadata-eval89.5%
Simplified89.5%
Taylor expanded in y around 0 95.2%
Final simplification91.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -9e+69) (not (<= y 5.5e+25))) (/ (/ (* x (pow z y)) a) y) (/ (* x (/ (pow a (+ t -1.0)) (exp b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -9e+69) || !(y <= 5.5e+25)) {
tmp = ((x * pow(z, y)) / a) / y;
} else {
tmp = (x * (pow(a, (t + -1.0)) / exp(b))) / 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 <= (-9d+69)) .or. (.not. (y <= 5.5d+25))) then
tmp = ((x * (z ** y)) / a) / y
else
tmp = (x * ((a ** (t + (-1.0d0))) / exp(b))) / 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 <= -9e+69) || !(y <= 5.5e+25)) {
tmp = ((x * Math.pow(z, y)) / a) / y;
} else {
tmp = (x * (Math.pow(a, (t + -1.0)) / Math.exp(b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -9e+69) or not (y <= 5.5e+25): tmp = ((x * math.pow(z, y)) / a) / y else: tmp = (x * (math.pow(a, (t + -1.0)) / math.exp(b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -9e+69) || !(y <= 5.5e+25)) tmp = Float64(Float64(Float64(x * (z ^ y)) / a) / y); else tmp = Float64(Float64(x * Float64((a ^ Float64(t + -1.0)) / exp(b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -9e+69) || ~((y <= 5.5e+25))) tmp = ((x * (z ^ y)) / a) / y; else tmp = (x * ((a ^ (t + -1.0)) / exp(b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -9e+69], N[Not[LessEqual[y, 5.5e+25]], $MachinePrecision]], N[(N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[(N[Power[a, N[(t + -1.0), $MachinePrecision]], $MachinePrecision] / N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -9 \cdot 10^{+69} \lor \neg \left(y \leq 5.5 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{\frac{x \cdot {z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot \frac{{a}^{\left(t + -1\right)}}{e^{b}}}{y}\\
\end{array}
\end{array}
if y < -8.9999999999999999e69 or 5.50000000000000018e25 < y Initial program 100.0%
Taylor expanded in t around 0 92.6%
+-commutative92.6%
mul-1-neg92.6%
unsub-neg92.6%
Simplified92.6%
Taylor expanded in b around 0 85.1%
div-exp85.1%
*-commutative85.1%
exp-to-pow85.1%
rem-exp-log85.1%
associate-*r/85.1%
Simplified85.1%
if -8.9999999999999999e69 < y < 5.50000000000000018e25Initial program 97.9%
Taylor expanded in y around 0 95.7%
div-exp83.3%
exp-to-pow84.3%
sub-neg84.3%
metadata-eval84.3%
Simplified84.3%
Final simplification84.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -6.5e+69) (not (<= y 3.8e+25))) (/ (/ (* x (pow z y)) a) y) (* x (/ (pow a (+ t -1.0)) (* y (exp b))))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -6.5e+69) || !(y <= 3.8e+25)) {
tmp = ((x * pow(z, y)) / a) / y;
} else {
tmp = x * (pow(a, (t + -1.0)) / (y * exp(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 <= (-6.5d+69)) .or. (.not. (y <= 3.8d+25))) then
tmp = ((x * (z ** y)) / a) / y
else
tmp = x * ((a ** (t + (-1.0d0))) / (y * exp(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 <= -6.5e+69) || !(y <= 3.8e+25)) {
tmp = ((x * Math.pow(z, y)) / a) / y;
} else {
tmp = x * (Math.pow(a, (t + -1.0)) / (y * Math.exp(b)));
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -6.5e+69) or not (y <= 3.8e+25): tmp = ((x * math.pow(z, y)) / a) / y else: tmp = x * (math.pow(a, (t + -1.0)) / (y * math.exp(b))) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -6.5e+69) || !(y <= 3.8e+25)) tmp = Float64(Float64(Float64(x * (z ^ y)) / a) / y); else tmp = Float64(x * Float64((a ^ Float64(t + -1.0)) / Float64(y * exp(b)))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -6.5e+69) || ~((y <= 3.8e+25))) tmp = ((x * (z ^ y)) / a) / y; else tmp = x * ((a ^ (t + -1.0)) / (y * exp(b))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -6.5e+69], N[Not[LessEqual[y, 3.8e+25]], $MachinePrecision]], N[(N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], N[(x * N[(N[Power[a, N[(t + -1.0), $MachinePrecision]], $MachinePrecision] / N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.5 \cdot 10^{+69} \lor \neg \left(y \leq 3.8 \cdot 10^{+25}\right):\\
\;\;\;\;\frac{\frac{x \cdot {z}^{y}}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{{a}^{\left(t + -1\right)}}{y \cdot e^{b}}\\
\end{array}
\end{array}
if y < -6.5000000000000001e69 or 3.8e25 < y Initial program 100.0%
Taylor expanded in t around 0 92.6%
+-commutative92.6%
mul-1-neg92.6%
unsub-neg92.6%
Simplified92.6%
Taylor expanded in b around 0 85.1%
div-exp85.1%
*-commutative85.1%
exp-to-pow85.1%
rem-exp-log85.1%
associate-*r/85.1%
Simplified85.1%
if -6.5000000000000001e69 < y < 3.8e25Initial program 97.9%
associate-/l*96.1%
associate--l+96.1%
exp-sum85.1%
associate-/l*85.1%
*-commutative85.1%
exp-to-pow85.1%
exp-diff73.5%
*-commutative73.5%
exp-to-pow74.4%
sub-neg74.4%
metadata-eval74.4%
Simplified74.4%
Taylor expanded in y around 0 81.4%
exp-to-pow82.3%
sub-neg82.3%
metadata-eval82.3%
Simplified82.3%
Final simplification83.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* x (/ (pow a (+ t -1.0)) y))) (t_2 (/ (/ (* x (pow z y)) a) y)))
(if (<= y -6.5e+69)
t_2
(if (<= y -6.8e-84)
t_1
(if (<= y 9e-274)
(/ (/ x (* a (exp b))) y)
(if (<= y 5.8e-205)
t_1
(if (<= y 2.65e+37) (* x (/ (/ (exp (- b)) y) a)) t_2)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x * (pow(a, (t + -1.0)) / y);
double t_2 = ((x * pow(z, y)) / a) / y;
double tmp;
if (y <= -6.5e+69) {
tmp = t_2;
} else if (y <= -6.8e-84) {
tmp = t_1;
} else if (y <= 9e-274) {
tmp = (x / (a * exp(b))) / y;
} else if (y <= 5.8e-205) {
tmp = t_1;
} else if (y <= 2.65e+37) {
tmp = x * ((exp(-b) / y) / a);
} else {
tmp = t_2;
}
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 = x * ((a ** (t + (-1.0d0))) / y)
t_2 = ((x * (z ** y)) / a) / y
if (y <= (-6.5d+69)) then
tmp = t_2
else if (y <= (-6.8d-84)) then
tmp = t_1
else if (y <= 9d-274) then
tmp = (x / (a * exp(b))) / y
else if (y <= 5.8d-205) then
tmp = t_1
else if (y <= 2.65d+37) then
tmp = x * ((exp(-b) / y) / a)
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 t_1 = x * (Math.pow(a, (t + -1.0)) / y);
double t_2 = ((x * Math.pow(z, y)) / a) / y;
double tmp;
if (y <= -6.5e+69) {
tmp = t_2;
} else if (y <= -6.8e-84) {
tmp = t_1;
} else if (y <= 9e-274) {
tmp = (x / (a * Math.exp(b))) / y;
} else if (y <= 5.8e-205) {
tmp = t_1;
} else if (y <= 2.65e+37) {
tmp = x * ((Math.exp(-b) / y) / a);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x * (math.pow(a, (t + -1.0)) / y) t_2 = ((x * math.pow(z, y)) / a) / y tmp = 0 if y <= -6.5e+69: tmp = t_2 elif y <= -6.8e-84: tmp = t_1 elif y <= 9e-274: tmp = (x / (a * math.exp(b))) / y elif y <= 5.8e-205: tmp = t_1 elif y <= 2.65e+37: tmp = x * ((math.exp(-b) / y) / a) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x * Float64((a ^ Float64(t + -1.0)) / y)) t_2 = Float64(Float64(Float64(x * (z ^ y)) / a) / y) tmp = 0.0 if (y <= -6.5e+69) tmp = t_2; elseif (y <= -6.8e-84) tmp = t_1; elseif (y <= 9e-274) tmp = Float64(Float64(x / Float64(a * exp(b))) / y); elseif (y <= 5.8e-205) tmp = t_1; elseif (y <= 2.65e+37) tmp = Float64(x * Float64(Float64(exp(Float64(-b)) / y) / a)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x * ((a ^ (t + -1.0)) / y); t_2 = ((x * (z ^ y)) / a) / y; tmp = 0.0; if (y <= -6.5e+69) tmp = t_2; elseif (y <= -6.8e-84) tmp = t_1; elseif (y <= 9e-274) tmp = (x / (a * exp(b))) / y; elseif (y <= 5.8e-205) tmp = t_1; elseif (y <= 2.65e+37) tmp = x * ((exp(-b) / y) / a); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x * N[(N[Power[a, N[(t + -1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[y, -6.5e+69], t$95$2, If[LessEqual[y, -6.8e-84], t$95$1, If[LessEqual[y, 9e-274], N[(N[(x / N[(a * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 5.8e-205], t$95$1, If[LessEqual[y, 2.65e+37], N[(x * N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \frac{{a}^{\left(t + -1\right)}}{y}\\
t_2 := \frac{\frac{x \cdot {z}^{y}}{a}}{y}\\
\mathbf{if}\;y \leq -6.5 \cdot 10^{+69}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;y \leq -6.8 \cdot 10^{-84}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9 \cdot 10^{-274}:\\
\;\;\;\;\frac{\frac{x}{a \cdot e^{b}}}{y}\\
\mathbf{elif}\;y \leq 5.8 \cdot 10^{-205}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.65 \cdot 10^{+37}:\\
\;\;\;\;x \cdot \frac{\frac{e^{-b}}{y}}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if y < -6.5000000000000001e69 or 2.6500000000000001e37 < y Initial program 100.0%
Taylor expanded in t around 0 94.0%
+-commutative94.0%
mul-1-neg94.0%
unsub-neg94.0%
Simplified94.0%
Taylor expanded in b around 0 86.2%
div-exp86.2%
*-commutative86.2%
exp-to-pow86.2%
rem-exp-log86.2%
associate-*r/86.2%
Simplified86.2%
if -6.5000000000000001e69 < y < -6.80000000000000042e-84 or 8.99999999999999982e-274 < y < 5.80000000000000036e-205Initial program 98.8%
associate-/l*98.8%
associate--l+98.8%
exp-sum82.9%
associate-/l*82.9%
*-commutative82.9%
exp-to-pow82.9%
exp-diff76.2%
*-commutative76.2%
exp-to-pow77.2%
sub-neg77.2%
metadata-eval77.2%
Simplified77.2%
Taylor expanded in y around 0 87.2%
exp-to-pow88.0%
sub-neg88.0%
metadata-eval88.0%
Simplified88.0%
Taylor expanded in b around 0 74.5%
associate-/l*74.5%
remove-double-neg74.5%
log-rec74.5%
distribute-lft-neg-in74.5%
mul-1-neg74.5%
mul-1-neg74.5%
distribute-lft-neg-in74.5%
log-rec74.5%
remove-double-neg74.5%
exp-to-pow75.3%
sub-neg75.3%
metadata-eval75.3%
+-commutative75.3%
Simplified75.3%
if -6.80000000000000042e-84 < y < 8.99999999999999982e-274Initial program 96.1%
add-cube-cbrt96.1%
pow396.1%
Applied egg-rr85.8%
Taylor expanded in y around 0 80.7%
*-commutative80.7%
associate-/l*84.6%
exp-to-pow85.9%
sub-neg85.9%
metadata-eval85.9%
Simplified85.9%
Taylor expanded in t around 0 81.1%
if 5.80000000000000036e-205 < y < 2.6500000000000001e37Initial program 99.4%
associate-/l*99.4%
associate--l+99.4%
exp-sum77.7%
associate-/l*77.7%
*-commutative77.7%
exp-to-pow77.7%
exp-diff60.3%
*-commutative60.3%
exp-to-pow60.8%
sub-neg60.8%
metadata-eval60.8%
Simplified60.8%
Taylor expanded in y around 0 75.6%
exp-to-pow76.1%
sub-neg76.1%
metadata-eval76.1%
Simplified76.1%
Taylor expanded in t around 0 74.6%
clear-num74.6%
associate-/r/74.7%
*-commutative74.7%
associate-/r*74.7%
*-commutative74.7%
associate-/r*74.7%
rec-exp74.7%
Applied egg-rr74.7%
Final simplification81.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= t -8.2e+35) (not (<= t 0.0001))) (* x (/ (pow a (+ t -1.0)) y)) (/ (/ x (* a (exp b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((t <= -8.2e+35) || !(t <= 0.0001)) {
tmp = x * (pow(a, (t + -1.0)) / y);
} else {
tmp = (x / (a * exp(b))) / 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 <= (-8.2d+35)) .or. (.not. (t <= 0.0001d0))) then
tmp = x * ((a ** (t + (-1.0d0))) / y)
else
tmp = (x / (a * exp(b))) / 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 <= -8.2e+35) || !(t <= 0.0001)) {
tmp = x * (Math.pow(a, (t + -1.0)) / y);
} else {
tmp = (x / (a * Math.exp(b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (t <= -8.2e+35) or not (t <= 0.0001): tmp = x * (math.pow(a, (t + -1.0)) / y) else: tmp = (x / (a * math.exp(b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((t <= -8.2e+35) || !(t <= 0.0001)) tmp = Float64(x * Float64((a ^ Float64(t + -1.0)) / y)); else tmp = Float64(Float64(x / Float64(a * exp(b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((t <= -8.2e+35) || ~((t <= 0.0001))) tmp = x * ((a ^ (t + -1.0)) / y); else tmp = (x / (a * exp(b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[t, -8.2e+35], N[Not[LessEqual[t, 0.0001]], $MachinePrecision]], N[(x * N[(N[Power[a, N[(t + -1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], N[(N[(x / N[(a * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{+35} \lor \neg \left(t \leq 0.0001\right):\\
\;\;\;\;x \cdot \frac{{a}^{\left(t + -1\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a \cdot e^{b}}}{y}\\
\end{array}
\end{array}
if t < -8.1999999999999997e35 or 1.00000000000000005e-4 < t Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
exp-sum70.9%
associate-/l*70.9%
*-commutative70.9%
exp-to-pow70.9%
exp-diff55.6%
*-commutative55.6%
exp-to-pow55.6%
sub-neg55.6%
metadata-eval55.6%
Simplified55.6%
Taylor expanded in y around 0 66.9%
exp-to-pow66.9%
sub-neg66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in b around 0 79.0%
associate-/l*79.0%
remove-double-neg79.0%
log-rec79.0%
distribute-lft-neg-in79.0%
mul-1-neg79.0%
mul-1-neg79.0%
distribute-lft-neg-in79.0%
log-rec79.0%
remove-double-neg79.0%
exp-to-pow79.0%
sub-neg79.0%
metadata-eval79.0%
+-commutative79.0%
Simplified79.0%
if -8.1999999999999997e35 < t < 1.00000000000000005e-4Initial program 98.0%
add-cube-cbrt98.0%
pow398.0%
Applied egg-rr81.6%
Taylor expanded in y around 0 61.3%
*-commutative61.3%
associate-/l*67.8%
exp-to-pow68.6%
sub-neg68.6%
metadata-eval68.6%
Simplified68.6%
Taylor expanded in t around 0 69.0%
Final simplification73.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= b -1.7)
(/ x (* a (* y (exp b))))
(if (<= b 0.00019)
(/ (* x (pow a (+ t -1.0))) y)
(/ (/ x (* a (exp b))) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (b <= -1.7) {
tmp = x / (a * (y * exp(b)));
} else if (b <= 0.00019) {
tmp = (x * pow(a, (t + -1.0))) / y;
} else {
tmp = (x / (a * exp(b))) / 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 <= (-1.7d0)) then
tmp = x / (a * (y * exp(b)))
else if (b <= 0.00019d0) then
tmp = (x * (a ** (t + (-1.0d0)))) / y
else
tmp = (x / (a * exp(b))) / 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 <= -1.7) {
tmp = x / (a * (y * Math.exp(b)));
} else if (b <= 0.00019) {
tmp = (x * Math.pow(a, (t + -1.0))) / y;
} else {
tmp = (x / (a * Math.exp(b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if b <= -1.7: tmp = x / (a * (y * math.exp(b))) elif b <= 0.00019: tmp = (x * math.pow(a, (t + -1.0))) / y else: tmp = (x / (a * math.exp(b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (b <= -1.7) tmp = Float64(x / Float64(a * Float64(y * exp(b)))); elseif (b <= 0.00019) tmp = Float64(Float64(x * (a ^ Float64(t + -1.0))) / y); else tmp = Float64(Float64(x / Float64(a * exp(b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (b <= -1.7) tmp = x / (a * (y * exp(b))); elseif (b <= 0.00019) tmp = (x * (a ^ (t + -1.0))) / y; else tmp = (x / (a * exp(b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[b, -1.7], N[(x / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[b, 0.00019], N[(N[(x * N[Power[a, N[(t + -1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x / N[(a * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.7:\\
\;\;\;\;\frac{x}{a \cdot \left(y \cdot e^{b}\right)}\\
\mathbf{elif}\;b \leq 0.00019:\\
\;\;\;\;\frac{x \cdot {a}^{\left(t + -1\right)}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x}{a \cdot e^{b}}}{y}\\
\end{array}
\end{array}
if b < -1.69999999999999996Initial program 100.0%
associate-/l*100.0%
associate--l+100.0%
exp-sum69.1%
associate-/l*69.1%
*-commutative69.1%
exp-to-pow69.1%
exp-diff55.9%
*-commutative55.9%
exp-to-pow55.9%
sub-neg55.9%
metadata-eval55.9%
Simplified55.9%
Taylor expanded in y around 0 64.9%
exp-to-pow64.9%
sub-neg64.9%
metadata-eval64.9%
Simplified64.9%
Taylor expanded in t around 0 78.3%
if -1.69999999999999996 < b < 1.9000000000000001e-4Initial program 97.9%
add-cube-cbrt97.9%
pow397.9%
Applied egg-rr86.0%
Taylor expanded in y around 0 70.6%
*-commutative70.6%
associate-/l*70.6%
exp-to-pow71.4%
sub-neg71.4%
metadata-eval71.4%
Simplified71.4%
Taylor expanded in b around 0 70.4%
exp-to-pow71.2%
sub-neg71.2%
metadata-eval71.2%
+-commutative71.2%
Simplified71.2%
if 1.9000000000000001e-4 < b Initial program 99.8%
add-cube-cbrt99.8%
pow399.8%
Applied egg-rr52.3%
Taylor expanded in y around 0 62.0%
*-commutative62.0%
associate-/l*63.6%
exp-to-pow63.6%
sub-neg63.6%
metadata-eval63.6%
Simplified63.6%
Taylor expanded in t around 0 73.5%
Final simplification73.7%
(FPCore (x y z t a b) :precision binary64 (/ (/ x (* a (exp b))) y))
double code(double x, double y, double z, double t, double a, double b) {
return (x / (a * exp(b))) / y;
}
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 / (a * exp(b))) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (x / (a * Math.exp(b))) / y;
}
def code(x, y, z, t, a, b): return (x / (a * math.exp(b))) / y
function code(x, y, z, t, a, b) return Float64(Float64(x / Float64(a * exp(b))) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (x / (a * exp(b))) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(x / N[(a * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{x}{a \cdot e^{b}}}{y}
\end{array}
Initial program 98.9%
add-cube-cbrt98.9%
pow398.9%
Applied egg-rr69.7%
Taylor expanded in y around 0 63.8%
*-commutative63.8%
associate-/l*67.4%
exp-to-pow67.8%
sub-neg67.8%
metadata-eval67.8%
Simplified67.8%
Taylor expanded in t around 0 57.3%
(FPCore (x y z t a b) :precision binary64 (/ x (* a (* y (exp b)))))
double code(double x, double y, double z, double t, double a, double b) {
return x / (a * (y * exp(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 / (a * (y * exp(b)))
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (a * (y * Math.exp(b)));
}
def code(x, y, z, t, a, b): return x / (a * (y * math.exp(b)))
function code(x, y, z, t, a, b) return Float64(x / Float64(a * Float64(y * exp(b)))) end
function tmp = code(x, y, z, t, a, b) tmp = x / (a * (y * exp(b))); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(a * N[(y * N[Exp[b], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a \cdot \left(y \cdot e^{b}\right)}
\end{array}
Initial program 98.9%
associate-/l*97.9%
associate--l+97.9%
exp-sum76.4%
associate-/l*75.6%
*-commutative75.6%
exp-to-pow75.6%
exp-diff67.4%
*-commutative67.4%
exp-to-pow67.9%
sub-neg67.9%
metadata-eval67.9%
Simplified67.9%
Taylor expanded in y around 0 66.4%
exp-to-pow66.8%
sub-neg66.8%
metadata-eval66.8%
Simplified66.8%
Taylor expanded in t around 0 57.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ 1.0 (* y a))) (t_2 (* (/ x y) 0.5)))
(if (<= x 430.0)
(/
(+
(/ x y)
(*
b
(-
(*
b
(-
(- (/ x y) t_2)
(*
b
(-
(+ (* (/ x y) -0.5) (* (/ x y) 0.16666666666666666))
(- t_2 (/ x y))))))
(/ x y))))
a)
(*
x
(+
t_1
(*
b
(+
(* b (+ (* -0.16666666666666666 (/ b (* y a))) (* 0.5 t_1)))
(/ -1.0 (* y a)))))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (y * a);
double t_2 = (x / y) * 0.5;
double tmp;
if (x <= 430.0) {
tmp = ((x / y) + (b * ((b * (((x / y) - t_2) - (b * ((((x / y) * -0.5) + ((x / y) * 0.16666666666666666)) - (t_2 - (x / y)))))) - (x / y)))) / a;
} else {
tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * 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) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = 1.0d0 / (y * a)
t_2 = (x / y) * 0.5d0
if (x <= 430.0d0) then
tmp = ((x / y) + (b * ((b * (((x / y) - t_2) - (b * ((((x / y) * (-0.5d0)) + ((x / y) * 0.16666666666666666d0)) - (t_2 - (x / y)))))) - (x / y)))) / a
else
tmp = x * (t_1 + (b * ((b * (((-0.16666666666666666d0) * (b / (y * a))) + (0.5d0 * t_1))) + ((-1.0d0) / (y * a)))))
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 = 1.0 / (y * a);
double t_2 = (x / y) * 0.5;
double tmp;
if (x <= 430.0) {
tmp = ((x / y) + (b * ((b * (((x / y) - t_2) - (b * ((((x / y) * -0.5) + ((x / y) * 0.16666666666666666)) - (t_2 - (x / y)))))) - (x / y)))) / a;
} else {
tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * a)))));
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 / (y * a) t_2 = (x / y) * 0.5 tmp = 0 if x <= 430.0: tmp = ((x / y) + (b * ((b * (((x / y) - t_2) - (b * ((((x / y) * -0.5) + ((x / y) * 0.16666666666666666)) - (t_2 - (x / y)))))) - (x / y)))) / a else: tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * a))))) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 / Float64(y * a)) t_2 = Float64(Float64(x / y) * 0.5) tmp = 0.0 if (x <= 430.0) tmp = Float64(Float64(Float64(x / y) + Float64(b * Float64(Float64(b * Float64(Float64(Float64(x / y) - t_2) - Float64(b * Float64(Float64(Float64(Float64(x / y) * -0.5) + Float64(Float64(x / y) * 0.16666666666666666)) - Float64(t_2 - Float64(x / y)))))) - Float64(x / y)))) / a); else tmp = Float64(x * Float64(t_1 + Float64(b * Float64(Float64(b * Float64(Float64(-0.16666666666666666 * Float64(b / Float64(y * a))) + Float64(0.5 * t_1))) + Float64(-1.0 / Float64(y * a)))))); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 / (y * a); t_2 = (x / y) * 0.5; tmp = 0.0; if (x <= 430.0) tmp = ((x / y) + (b * ((b * (((x / y) - t_2) - (b * ((((x / y) * -0.5) + ((x / y) * 0.16666666666666666)) - (t_2 - (x / y)))))) - (x / y)))) / a; else tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * a))))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 / N[(y * a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x / y), $MachinePrecision] * 0.5), $MachinePrecision]}, If[LessEqual[x, 430.0], N[(N[(N[(x / y), $MachinePrecision] + N[(b * N[(N[(b * N[(N[(N[(x / y), $MachinePrecision] - t$95$2), $MachinePrecision] - N[(b * N[(N[(N[(N[(x / y), $MachinePrecision] * -0.5), $MachinePrecision] + N[(N[(x / y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] - N[(t$95$2 - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / a), $MachinePrecision], N[(x * N[(t$95$1 + N[(b * N[(N[(b * N[(N[(-0.16666666666666666 * N[(b / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{y \cdot a}\\
t_2 := \frac{x}{y} \cdot 0.5\\
\mathbf{if}\;x \leq 430:\\
\;\;\;\;\frac{\frac{x}{y} + b \cdot \left(b \cdot \left(\left(\frac{x}{y} - t\_2\right) - b \cdot \left(\left(\frac{x}{y} \cdot -0.5 + \frac{x}{y} \cdot 0.16666666666666666\right) - \left(t\_2 - \frac{x}{y}\right)\right)\right) - \frac{x}{y}\right)}{a}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(t\_1 + b \cdot \left(b \cdot \left(-0.16666666666666666 \cdot \frac{b}{y \cdot a} + 0.5 \cdot t\_1\right) + \frac{-1}{y \cdot a}\right)\right)\\
\end{array}
\end{array}
if x < 430Initial program 98.9%
associate-/l*97.7%
associate--l+97.7%
exp-sum75.9%
associate-/l*75.4%
*-commutative75.4%
exp-to-pow75.4%
exp-diff66.5%
*-commutative66.5%
exp-to-pow66.9%
sub-neg66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in y around 0 68.4%
exp-to-pow68.8%
sub-neg68.8%
metadata-eval68.8%
Simplified68.8%
Taylor expanded in t around 0 58.7%
Taylor expanded in b around 0 28.3%
Taylor expanded in a around 0 38.2%
if 430 < x Initial program 98.8%
associate-/l*98.8%
associate--l+98.8%
exp-sum78.4%
associate-/l*76.6%
*-commutative76.6%
exp-to-pow76.6%
exp-diff71.0%
*-commutative71.0%
exp-to-pow71.7%
sub-neg71.7%
metadata-eval71.7%
Simplified71.7%
Taylor expanded in y around 0 58.8%
exp-to-pow59.4%
sub-neg59.4%
metadata-eval59.4%
Simplified59.4%
Taylor expanded in t around 0 51.2%
Taylor expanded in b around 0 27.1%
Taylor expanded in x around 0 40.2%
Final simplification38.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ 1.0 (* y a))))
(if (<= b -1.2e-11)
(*
x
(+
t_1
(*
b
(+
(* b (+ (* -0.16666666666666666 (/ b (* y a))) (* 0.5 t_1)))
(/ -1.0 (* y a))))))
(/ x (* y a)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = 1.0 / (y * a);
double tmp;
if (b <= -1.2e-11) {
tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * a)))));
} else {
tmp = x / (y * 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) :: t_1
real(8) :: tmp
t_1 = 1.0d0 / (y * a)
if (b <= (-1.2d-11)) then
tmp = x * (t_1 + (b * ((b * (((-0.16666666666666666d0) * (b / (y * a))) + (0.5d0 * t_1))) + ((-1.0d0) / (y * a)))))
else
tmp = x / (y * a)
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 = 1.0 / (y * a);
double tmp;
if (b <= -1.2e-11) {
tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * a)))));
} else {
tmp = x / (y * a);
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = 1.0 / (y * a) tmp = 0 if b <= -1.2e-11: tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * a))))) else: tmp = x / (y * a) return tmp
function code(x, y, z, t, a, b) t_1 = Float64(1.0 / Float64(y * a)) tmp = 0.0 if (b <= -1.2e-11) tmp = Float64(x * Float64(t_1 + Float64(b * Float64(Float64(b * Float64(Float64(-0.16666666666666666 * Float64(b / Float64(y * a))) + Float64(0.5 * t_1))) + Float64(-1.0 / Float64(y * a)))))); else tmp = Float64(x / Float64(y * a)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = 1.0 / (y * a); tmp = 0.0; if (b <= -1.2e-11) tmp = x * (t_1 + (b * ((b * ((-0.16666666666666666 * (b / (y * a))) + (0.5 * t_1))) + (-1.0 / (y * a))))); else tmp = x / (y * a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(1.0 / N[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -1.2e-11], N[(x * N[(t$95$1 + N[(b * N[(N[(b * N[(N[(-0.16666666666666666 * N[(b / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(0.5 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(-1.0 / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x / N[(y * a), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{1}{y \cdot a}\\
\mathbf{if}\;b \leq -1.2 \cdot 10^{-11}:\\
\;\;\;\;x \cdot \left(t\_1 + b \cdot \left(b \cdot \left(-0.16666666666666666 \cdot \frac{b}{y \cdot a} + 0.5 \cdot t\_1\right) + \frac{-1}{y \cdot a}\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y \cdot a}\\
\end{array}
\end{array}
if b < -1.2000000000000001e-11Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
exp-sum69.3%
associate-/l*69.3%
*-commutative69.3%
exp-to-pow69.3%
exp-diff56.8%
*-commutative56.8%
exp-to-pow56.9%
sub-neg56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in y around 0 66.8%
exp-to-pow66.9%
sub-neg66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in t around 0 75.4%
Taylor expanded in b around 0 42.8%
Taylor expanded in x around 0 59.4%
if -1.2000000000000001e-11 < b Initial program 98.5%
associate-/l*97.1%
associate--l+97.1%
exp-sum79.2%
associate-/l*78.1%
*-commutative78.1%
exp-to-pow78.1%
exp-diff71.6%
*-commutative71.6%
exp-to-pow72.2%
sub-neg72.2%
metadata-eval72.2%
Simplified72.2%
Taylor expanded in y around 0 66.2%
exp-to-pow66.8%
sub-neg66.8%
metadata-eval66.8%
Simplified66.8%
Taylor expanded in t around 0 50.0%
Taylor expanded in b around 0 32.2%
Final simplification39.8%
(FPCore (x y z t a b) :precision binary64 (let* ((t_1 (/ x (* y a)))) (if (<= b -2.8e-12) (- t_1 (* x (/ b (* y a)))) t_1)))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = x / (y * a);
double tmp;
if (b <= -2.8e-12) {
tmp = t_1 - (x * (b / (y * a)));
} 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 = x / (y * a)
if (b <= (-2.8d-12)) then
tmp = t_1 - (x * (b / (y * a)))
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 = x / (y * a);
double tmp;
if (b <= -2.8e-12) {
tmp = t_1 - (x * (b / (y * a)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = x / (y * a) tmp = 0 if b <= -2.8e-12: tmp = t_1 - (x * (b / (y * a))) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(x / Float64(y * a)) tmp = 0.0 if (b <= -2.8e-12) tmp = Float64(t_1 - Float64(x * Float64(b / Float64(y * a)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = x / (y * a); tmp = 0.0; if (b <= -2.8e-12) tmp = t_1 - (x * (b / (y * a))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(x / N[(y * a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[b, -2.8e-12], N[(t$95$1 - N[(x * N[(b / N[(y * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x}{y \cdot a}\\
\mathbf{if}\;b \leq -2.8 \cdot 10^{-12}:\\
\;\;\;\;t\_1 - x \cdot \frac{b}{y \cdot a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.8000000000000002e-12Initial program 99.9%
associate-/l*99.9%
associate--l+99.9%
exp-sum69.3%
associate-/l*69.3%
*-commutative69.3%
exp-to-pow69.3%
exp-diff56.8%
*-commutative56.8%
exp-to-pow56.9%
sub-neg56.9%
metadata-eval56.9%
Simplified56.9%
Taylor expanded in y around 0 66.8%
exp-to-pow66.9%
sub-neg66.9%
metadata-eval66.9%
Simplified66.9%
Taylor expanded in t around 0 75.4%
Taylor expanded in b around 0 36.6%
+-commutative36.6%
mul-1-neg36.6%
unsub-neg36.6%
*-commutative36.6%
associate-/l*36.8%
Simplified36.8%
if -2.8000000000000002e-12 < b Initial program 98.5%
associate-/l*97.1%
associate--l+97.1%
exp-sum79.2%
associate-/l*78.1%
*-commutative78.1%
exp-to-pow78.1%
exp-diff71.6%
*-commutative71.6%
exp-to-pow72.2%
sub-neg72.2%
metadata-eval72.2%
Simplified72.2%
Taylor expanded in y around 0 66.2%
exp-to-pow66.8%
sub-neg66.8%
metadata-eval66.8%
Simplified66.8%
Taylor expanded in t around 0 50.0%
Taylor expanded in b around 0 32.2%
Final simplification33.5%
(FPCore (x y z t a b) :precision binary64 (/ x (* y a)))
double code(double x, double y, double z, double t, double a, double b) {
return x / (y * a);
}
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)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (y * a);
}
def code(x, y, z, t, a, b): return x / (y * a)
function code(x, y, z, t, a, b) return Float64(x / Float64(y * a)) end
function tmp = code(x, y, z, t, a, b) tmp = x / (y * a); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(y * a), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{y \cdot a}
\end{array}
Initial program 98.9%
associate-/l*97.9%
associate--l+97.9%
exp-sum76.4%
associate-/l*75.6%
*-commutative75.6%
exp-to-pow75.6%
exp-diff67.4%
*-commutative67.4%
exp-to-pow67.9%
sub-neg67.9%
metadata-eval67.9%
Simplified67.9%
Taylor expanded in y around 0 66.4%
exp-to-pow66.8%
sub-neg66.8%
metadata-eval66.8%
Simplified66.8%
Taylor expanded in t around 0 57.1%
Taylor expanded in b around 0 29.2%
Final simplification29.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow a (- t 1.0)))
(t_2 (/ (* x (/ t_1 y)) (- (+ b 1.0) (* y (log z))))))
(if (< t -0.8845848504127471)
t_2
(if (< t 852031.2288374073)
(/ (* (/ x y) t_1) (exp (- b (* (log z) y))))
t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = pow(a, (t - 1.0));
double t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * log(z)));
double tmp;
if (t < -0.8845848504127471) {
tmp = t_2;
} else if (t < 852031.2288374073) {
tmp = ((x / y) * t_1) / exp((b - (log(z) * y)));
} else {
tmp = t_2;
}
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 = a ** (t - 1.0d0)
t_2 = (x * (t_1 / y)) / ((b + 1.0d0) - (y * log(z)))
if (t < (-0.8845848504127471d0)) then
tmp = t_2
else if (t < 852031.2288374073d0) then
tmp = ((x / y) * t_1) / exp((b - (log(z) * y)))
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 t_1 = Math.pow(a, (t - 1.0));
double t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * Math.log(z)));
double tmp;
if (t < -0.8845848504127471) {
tmp = t_2;
} else if (t < 852031.2288374073) {
tmp = ((x / y) * t_1) / Math.exp((b - (Math.log(z) * y)));
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow(a, (t - 1.0)) t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * math.log(z))) tmp = 0 if t < -0.8845848504127471: tmp = t_2 elif t < 852031.2288374073: tmp = ((x / y) * t_1) / math.exp((b - (math.log(z) * y))) else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = a ^ Float64(t - 1.0) t_2 = Float64(Float64(x * Float64(t_1 / y)) / Float64(Float64(b + 1.0) - Float64(y * log(z)))) tmp = 0.0 if (t < -0.8845848504127471) tmp = t_2; elseif (t < 852031.2288374073) tmp = Float64(Float64(Float64(x / y) * t_1) / exp(Float64(b - Float64(log(z) * y)))); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a ^ (t - 1.0); t_2 = (x * (t_1 / y)) / ((b + 1.0) - (y * log(z))); tmp = 0.0; if (t < -0.8845848504127471) tmp = t_2; elseif (t < 852031.2288374073) tmp = ((x / y) * t_1) / exp((b - (log(z) * y))); else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[(x * N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision] / N[(N[(b + 1.0), $MachinePrecision] - N[(y * N[Log[z], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[Less[t, -0.8845848504127471], t$95$2, If[Less[t, 852031.2288374073], N[(N[(N[(x / y), $MachinePrecision] * t$95$1), $MachinePrecision] / N[Exp[N[(b - N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {a}^{\left(t - 1\right)}\\
t_2 := \frac{x \cdot \frac{t\_1}{y}}{\left(b + 1\right) - y \cdot \log z}\\
\mathbf{if}\;t < -0.8845848504127471:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t < 852031.2288374073:\\
\;\;\;\;\frac{\frac{x}{y} \cdot t\_1}{e^{b - \log z \cdot y}}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
herbie shell --seed 2024111
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
:precision binary64
:alt
(if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1.0))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z))))))
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))