
(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 15 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)) (* (- 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}
Initial program 97.8%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow a (- t 1.0))) (t_2 (* (- t 1.0) (log a))))
(if (<= t_2 -1e+47)
(* (/ t_1 y) x)
(if (<= t_2 -342.0)
(* (/ (pow z y) a) (/ x y))
(if (<= t_2 -205.0)
(* (/ (exp (- b)) y) x)
(if (<= t_2 2000000.0)
(/ (* x (pow z y)) (* a y))
(/ (* t_1 x) y)))))))
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 = (t - 1.0) * log(a);
double tmp;
if (t_2 <= -1e+47) {
tmp = (t_1 / y) * x;
} else if (t_2 <= -342.0) {
tmp = (pow(z, y) / a) * (x / y);
} else if (t_2 <= -205.0) {
tmp = (exp(-b) / y) * x;
} else if (t_2 <= 2000000.0) {
tmp = (x * pow(z, y)) / (a * y);
} else {
tmp = (t_1 * x) / y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a ** (t - 1.0d0)
t_2 = (t - 1.0d0) * log(a)
if (t_2 <= (-1d+47)) then
tmp = (t_1 / y) * x
else if (t_2 <= (-342.0d0)) then
tmp = ((z ** y) / a) * (x / y)
else if (t_2 <= (-205.0d0)) then
tmp = (exp(-b) / y) * x
else if (t_2 <= 2000000.0d0) then
tmp = (x * (z ** y)) / (a * y)
else
tmp = (t_1 * x) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.pow(a, (t - 1.0));
double t_2 = (t - 1.0) * Math.log(a);
double tmp;
if (t_2 <= -1e+47) {
tmp = (t_1 / y) * x;
} else if (t_2 <= -342.0) {
tmp = (Math.pow(z, y) / a) * (x / y);
} else if (t_2 <= -205.0) {
tmp = (Math.exp(-b) / y) * x;
} else if (t_2 <= 2000000.0) {
tmp = (x * Math.pow(z, y)) / (a * y);
} else {
tmp = (t_1 * x) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow(a, (t - 1.0)) t_2 = (t - 1.0) * math.log(a) tmp = 0 if t_2 <= -1e+47: tmp = (t_1 / y) * x elif t_2 <= -342.0: tmp = (math.pow(z, y) / a) * (x / y) elif t_2 <= -205.0: tmp = (math.exp(-b) / y) * x elif t_2 <= 2000000.0: tmp = (x * math.pow(z, y)) / (a * y) else: tmp = (t_1 * x) / y return tmp
function code(x, y, z, t, a, b) t_1 = a ^ Float64(t - 1.0) t_2 = Float64(Float64(t - 1.0) * log(a)) tmp = 0.0 if (t_2 <= -1e+47) tmp = Float64(Float64(t_1 / y) * x); elseif (t_2 <= -342.0) tmp = Float64(Float64((z ^ y) / a) * Float64(x / y)); elseif (t_2 <= -205.0) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); elseif (t_2 <= 2000000.0) tmp = Float64(Float64(x * (z ^ y)) / Float64(a * y)); else tmp = Float64(Float64(t_1 * x) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a ^ (t - 1.0); t_2 = (t - 1.0) * log(a); tmp = 0.0; if (t_2 <= -1e+47) tmp = (t_1 / y) * x; elseif (t_2 <= -342.0) tmp = ((z ^ y) / a) * (x / y); elseif (t_2 <= -205.0) tmp = (exp(-b) / y) * x; elseif (t_2 <= 2000000.0) tmp = (x * (z ^ y)) / (a * y); else tmp = (t_1 * x) / y; 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[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+47], N[(N[(t$95$1 / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, -342.0], N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, -205.0], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 2000000.0], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] / N[(a * y), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * x), $MachinePrecision] / y), $MachinePrecision]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {a}^{\left(t - 1\right)}\\
t_2 := \left(t - 1\right) \cdot \log a\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+47}:\\
\;\;\;\;\frac{t\_1}{y} \cdot x\\
\mathbf{elif}\;t\_2 \leq -342:\\
\;\;\;\;\frac{{z}^{y}}{a} \cdot \frac{x}{y}\\
\mathbf{elif}\;t\_2 \leq -205:\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{elif}\;t\_2 \leq 2000000:\\
\;\;\;\;\frac{x \cdot {z}^{y}}{a \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot x}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e47Initial program 100.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6475.6
Applied rewrites75.6%
Taylor expanded in y around 0
Applied rewrites87.0%
if -1e47 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -342Initial program 93.3%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6465.1
Applied rewrites65.1%
Taylor expanded in t around 0
Applied rewrites76.2%
if -342 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -205Initial program 99.2%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6480.8
Applied rewrites80.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6480.8
Applied rewrites80.8%
if -205 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2e6Initial program 97.3%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6477.3
Applied rewrites77.3%
Taylor expanded in t around 0
Applied rewrites72.4%
Applied rewrites79.5%
if 2e6 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6479.3
Applied rewrites79.3%
Applied rewrites68.0%
Taylor expanded in y around 0
Applied rewrites96.3%
Final simplification84.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (- t 1.0) (log a))))
(if (or (<= t_1 -1e+47) (not (<= t_1 1e+17)))
(/ (* x (exp (- (* (log a) t) b))) y)
(/ (* x (exp (- (fma (log z) y (- (log a))) b))) y))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (t - 1.0) * log(a);
double tmp;
if ((t_1 <= -1e+47) || !(t_1 <= 1e+17)) {
tmp = (x * exp(((log(a) * t) - b))) / y;
} else {
tmp = (x * exp((fma(log(z), y, -log(a)) - b))) / y;
}
return tmp;
}
function code(x, y, z, t, a, b) t_1 = Float64(Float64(t - 1.0) * log(a)) tmp = 0.0 if ((t_1 <= -1e+47) || !(t_1 <= 1e+17)) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y); else tmp = Float64(Float64(x * exp(Float64(fma(log(z), y, Float64(-log(a))) - b))) / y); end return tmp end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+47], N[Not[LessEqual[t$95$1, 1e+17]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[Log[z], $MachinePrecision] * y + (-N[Log[a], $MachinePrecision])), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(t - 1\right) \cdot \log a\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+47} \lor \neg \left(t\_1 \leq 10^{+17}\right):\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\mathsf{fma}\left(\log z, y, -\log a\right) - b}}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e47 or 1e17 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
rem-exp-logN/A
lower-log.f64N/A
rem-exp-log97.1
Applied rewrites97.1%
if -1e47 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 1e17Initial program 96.4%
Taylor expanded in t around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-log.f64N/A
mul-1-negN/A
lower-neg.f64N/A
rem-exp-logN/A
lower-log.f64N/A
rem-exp-log96.4
Applied rewrites96.4%
Final simplification96.7%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow a (- t 1.0))) (t_2 (* (- t 1.0) (log a))))
(if (<= t_2 -1e+47)
(* (/ t_1 y) x)
(if (<= t_2 2000000.0) (/ x (* (/ a (pow z y)) y)) (/ (* t_1 x) y)))))
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 = (t - 1.0) * log(a);
double tmp;
if (t_2 <= -1e+47) {
tmp = (t_1 / y) * x;
} else if (t_2 <= 2000000.0) {
tmp = x / ((a / pow(z, y)) * y);
} else {
tmp = (t_1 * x) / y;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = a ** (t - 1.0d0)
t_2 = (t - 1.0d0) * log(a)
if (t_2 <= (-1d+47)) then
tmp = (t_1 / y) * x
else if (t_2 <= 2000000.0d0) then
tmp = x / ((a / (z ** y)) * y)
else
tmp = (t_1 * x) / y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = Math.pow(a, (t - 1.0));
double t_2 = (t - 1.0) * Math.log(a);
double tmp;
if (t_2 <= -1e+47) {
tmp = (t_1 / y) * x;
} else if (t_2 <= 2000000.0) {
tmp = x / ((a / Math.pow(z, y)) * y);
} else {
tmp = (t_1 * x) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow(a, (t - 1.0)) t_2 = (t - 1.0) * math.log(a) tmp = 0 if t_2 <= -1e+47: tmp = (t_1 / y) * x elif t_2 <= 2000000.0: tmp = x / ((a / math.pow(z, y)) * y) else: tmp = (t_1 * x) / y return tmp
function code(x, y, z, t, a, b) t_1 = a ^ Float64(t - 1.0) t_2 = Float64(Float64(t - 1.0) * log(a)) tmp = 0.0 if (t_2 <= -1e+47) tmp = Float64(Float64(t_1 / y) * x); elseif (t_2 <= 2000000.0) tmp = Float64(x / Float64(Float64(a / (z ^ y)) * y)); else tmp = Float64(Float64(t_1 * x) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a ^ (t - 1.0); t_2 = (t - 1.0) * log(a); tmp = 0.0; if (t_2 <= -1e+47) tmp = (t_1 / y) * x; elseif (t_2 <= 2000000.0) tmp = x / ((a / (z ^ y)) * y); else tmp = (t_1 * x) / y; 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[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e+47], N[(N[(t$95$1 / y), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 2000000.0], N[(x / N[(N[(a / N[Power[z, y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(t$95$1 * x), $MachinePrecision] / y), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {a}^{\left(t - 1\right)}\\
t_2 := \left(t - 1\right) \cdot \log a\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{+47}:\\
\;\;\;\;\frac{t\_1}{y} \cdot x\\
\mathbf{elif}\;t\_2 \leq 2000000:\\
\;\;\;\;\frac{x}{\frac{a}{{z}^{y}} \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{t\_1 \cdot x}{y}\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -1e47Initial program 100.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6475.6
Applied rewrites75.6%
Taylor expanded in y around 0
Applied rewrites87.0%
if -1e47 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 2e6Initial program 96.3%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6468.1
Applied rewrites68.1%
Taylor expanded in t around 0
Applied rewrites69.8%
Applied rewrites74.1%
if 2e6 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) Initial program 100.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6479.3
Applied rewrites79.3%
Applied rewrites68.0%
Taylor expanded in y around 0
Applied rewrites96.3%
Final simplification81.4%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (/ (* x (exp (- (* (log a) t) b))) y)))
(if (<= t -10500.0)
t_1
(if (<= t 2.35e-298)
(/ (* x (/ (exp (- b)) a)) y)
(if (<= t 1.35e+14) (/ x (* (/ a (pow z y)) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (x * exp(((log(a) * t) - b))) / y;
double tmp;
if (t <= -10500.0) {
tmp = t_1;
} else if (t <= 2.35e-298) {
tmp = (x * (exp(-b) / a)) / y;
} else if (t <= 1.35e+14) {
tmp = x / ((a / pow(z, y)) * y);
} 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 * exp(((log(a) * t) - b))) / y
if (t <= (-10500.0d0)) then
tmp = t_1
else if (t <= 2.35d-298) then
tmp = (x * (exp(-b) / a)) / y
else if (t <= 1.35d+14) then
tmp = x / ((a / (z ** y)) * y)
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 * Math.exp(((Math.log(a) * t) - b))) / y;
double tmp;
if (t <= -10500.0) {
tmp = t_1;
} else if (t <= 2.35e-298) {
tmp = (x * (Math.exp(-b) / a)) / y;
} else if (t <= 1.35e+14) {
tmp = x / ((a / Math.pow(z, y)) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (x * math.exp(((math.log(a) * t) - b))) / y tmp = 0 if t <= -10500.0: tmp = t_1 elif t <= 2.35e-298: tmp = (x * (math.exp(-b) / a)) / y elif t <= 1.35e+14: tmp = x / ((a / math.pow(z, y)) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y) tmp = 0.0 if (t <= -10500.0) tmp = t_1; elseif (t <= 2.35e-298) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); elseif (t <= 1.35e+14) tmp = Float64(x / Float64(Float64(a / (z ^ y)) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (x * exp(((log(a) * t) - b))) / y; tmp = 0.0; if (t <= -10500.0) tmp = t_1; elseif (t <= 2.35e-298) tmp = (x * (exp(-b) / a)) / y; elseif (t <= 1.35e+14) tmp = x / ((a / (z ^ y)) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]}, If[LessEqual[t, -10500.0], t$95$1, If[LessEqual[t, 2.35e-298], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 1.35e+14], N[(x / N[(N[(a / N[Power[z, y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{if}\;t \leq -10500:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-298}:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{+14}:\\
\;\;\;\;\frac{x}{\frac{a}{{z}^{y}} \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -10500 or 1.35e14 < t Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
rem-exp-logN/A
lower-log.f64N/A
rem-exp-log94.6
Applied rewrites94.6%
if -10500 < t < 2.35000000000000019e-298Initial program 99.3%
Taylor expanded in y around 0
exp-diffN/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f64N/A
lower-exp.f6477.0
Applied rewrites77.0%
Taylor expanded in t around 0
Applied rewrites77.0%
if 2.35000000000000019e-298 < t < 1.35e14Initial program 92.9%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6483.2
Applied rewrites83.2%
Taylor expanded in t around 0
Applied rewrites84.4%
Applied rewrites88.9%
(FPCore (x y z t a b) :precision binary64 (if (or (<= y -1.55e+82) (not (<= y 2.2e+136))) (/ x (* (/ a (pow z y)) y)) (/ (* x (exp (- (* (- t 1.0) (log a)) b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((y <= -1.55e+82) || !(y <= 2.2e+136)) {
tmp = x / ((a / pow(z, y)) * y);
} else {
tmp = (x * exp((((t - 1.0) * log(a)) - 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 <= (-1.55d+82)) .or. (.not. (y <= 2.2d+136))) then
tmp = x / ((a / (z ** y)) * y)
else
tmp = (x * exp((((t - 1.0d0) * log(a)) - 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 <= -1.55e+82) || !(y <= 2.2e+136)) {
tmp = x / ((a / Math.pow(z, y)) * y);
} else {
tmp = (x * Math.exp((((t - 1.0) * Math.log(a)) - b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (y <= -1.55e+82) or not (y <= 2.2e+136): tmp = x / ((a / math.pow(z, y)) * y) else: tmp = (x * math.exp((((t - 1.0) * math.log(a)) - b))) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((y <= -1.55e+82) || !(y <= 2.2e+136)) tmp = Float64(x / Float64(Float64(a / (z ^ y)) * y)); else tmp = Float64(Float64(x * exp(Float64(Float64(Float64(t - 1.0) * log(a)) - b))) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((y <= -1.55e+82) || ~((y <= 2.2e+136))) tmp = x / ((a / (z ^ y)) * y); else tmp = (x * exp((((t - 1.0) * log(a)) - b))) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[y, -1.55e+82], N[Not[LessEqual[y, 2.2e+136]], $MachinePrecision]], N[(x / N[(N[(a / N[Power[z, y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], N[(N[(x * N[Exp[N[(N[(N[(t - 1.0), $MachinePrecision] * N[Log[a], $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.55 \cdot 10^{+82} \lor \neg \left(y \leq 2.2 \cdot 10^{+136}\right):\\
\;\;\;\;\frac{x}{\frac{a}{{z}^{y}} \cdot y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x \cdot e^{\left(t - 1\right) \cdot \log a - b}}{y}\\
\end{array}
\end{array}
if y < -1.55000000000000016e82 or 2.1999999999999999e136 < y Initial program 100.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6474.1
Applied rewrites74.1%
Taylor expanded in t around 0
Applied rewrites76.8%
Applied rewrites88.5%
if -1.55000000000000016e82 < y < 2.1999999999999999e136Initial program 96.9%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
rem-exp-logN/A
lower-log.f64N/A
rem-exp-log93.8
Applied rewrites93.8%
Final simplification92.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -9.2e-7) (not (<= b 7e+17))) (/ (* x (exp (- (* (log a) t) b))) y) (* (* x (pow z y)) (/ (pow a (- t 1.0)) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -9.2e-7) || !(b <= 7e+17)) {
tmp = (x * exp(((log(a) * t) - b))) / y;
} else {
tmp = (x * pow(z, y)) * (pow(a, (t - 1.0)) / 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 <= (-9.2d-7)) .or. (.not. (b <= 7d+17))) then
tmp = (x * exp(((log(a) * t) - b))) / y
else
tmp = (x * (z ** y)) * ((a ** (t - 1.0d0)) / 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 <= -9.2e-7) || !(b <= 7e+17)) {
tmp = (x * Math.exp(((Math.log(a) * t) - b))) / y;
} else {
tmp = (x * Math.pow(z, y)) * (Math.pow(a, (t - 1.0)) / y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -9.2e-7) or not (b <= 7e+17): tmp = (x * math.exp(((math.log(a) * t) - b))) / y else: tmp = (x * math.pow(z, y)) * (math.pow(a, (t - 1.0)) / y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -9.2e-7) || !(b <= 7e+17)) tmp = Float64(Float64(x * exp(Float64(Float64(log(a) * t) - b))) / y); else tmp = Float64(Float64(x * (z ^ y)) * Float64((a ^ Float64(t - 1.0)) / y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -9.2e-7) || ~((b <= 7e+17))) tmp = (x * exp(((log(a) * t) - b))) / y; else tmp = (x * (z ^ y)) * ((a ^ (t - 1.0)) / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -9.2e-7], N[Not[LessEqual[b, 7e+17]], $MachinePrecision]], N[(N[(x * N[Exp[N[(N[(N[Log[a], $MachinePrecision] * t), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], N[(N[(x * N[Power[z, y], $MachinePrecision]), $MachinePrecision] * N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -9.2 \cdot 10^{-7} \lor \neg \left(b \leq 7 \cdot 10^{+17}\right):\\
\;\;\;\;\frac{x \cdot e^{\log a \cdot t - b}}{y}\\
\mathbf{else}:\\
\;\;\;\;\left(x \cdot {z}^{y}\right) \cdot \frac{{a}^{\left(t - 1\right)}}{y}\\
\end{array}
\end{array}
if b < -9.1999999999999998e-7 or 7e17 < b Initial program 100.0%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
rem-exp-logN/A
lower-log.f64N/A
rem-exp-log89.1
Applied rewrites89.1%
if -9.1999999999999998e-7 < b < 7e17Initial program 95.7%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6490.1
Applied rewrites90.1%
Final simplification89.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (log a) -194.0) (/ (/ x a) y) (* (/ (pow a -1.0) y) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (log(a) <= -194.0) {
tmp = (x / a) / y;
} else {
tmp = (pow(a, -1.0) / y) * x;
}
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 (log(a) <= (-194.0d0)) then
tmp = (x / a) / y
else
tmp = ((a ** (-1.0d0)) / y) * x
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 (Math.log(a) <= -194.0) {
tmp = (x / a) / y;
} else {
tmp = (Math.pow(a, -1.0) / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if math.log(a) <= -194.0: tmp = (x / a) / y else: tmp = (math.pow(a, -1.0) / y) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (log(a) <= -194.0) tmp = Float64(Float64(x / a) / y); else tmp = Float64(Float64((a ^ -1.0) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (log(a) <= -194.0) tmp = (x / a) / y; else tmp = ((a ^ -1.0) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[Log[a], $MachinePrecision], -194.0], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[Power[a, -1.0], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log a \leq -194:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{-1}}{y} \cdot x\\
\end{array}
\end{array}
if (log.f64 a) < -194Initial program 99.6%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6480.7
Applied rewrites80.7%
Applied rewrites70.1%
Taylor expanded in y around 0
Applied rewrites69.5%
Taylor expanded in t around 0
Applied rewrites38.4%
if -194 < (log.f64 a) Initial program 97.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6467.9
Applied rewrites67.9%
Taylor expanded in y around 0
Applied rewrites64.5%
Taylor expanded in t around 0
Applied rewrites33.6%
Final simplification35.1%
(FPCore (x y z t a b) :precision binary64 (if (<= (log a) -153.0) (/ (/ x a) y) (* x (pow (* a y) -1.0))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (log(a) <= -153.0) {
tmp = (x / a) / y;
} else {
tmp = x * pow((a * y), -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) :: tmp
if (log(a) <= (-153.0d0)) then
tmp = (x / a) / y
else
tmp = x * ((a * y) ** (-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 tmp;
if (Math.log(a) <= -153.0) {
tmp = (x / a) / y;
} else {
tmp = x * Math.pow((a * y), -1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if math.log(a) <= -153.0: tmp = (x / a) / y else: tmp = x * math.pow((a * y), -1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (log(a) <= -153.0) tmp = Float64(Float64(x / a) / y); else tmp = Float64(x * (Float64(a * y) ^ -1.0)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (log(a) <= -153.0) tmp = (x / a) / y; else tmp = x * ((a * y) ^ -1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[Log[a], $MachinePrecision], -153.0], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision], N[(x * N[Power[N[(a * y), $MachinePrecision], -1.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log a \leq -153:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;x \cdot {\left(a \cdot y\right)}^{-1}\\
\end{array}
\end{array}
if (log.f64 a) < -153Initial program 99.6%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6480.4
Applied rewrites80.4%
Applied rewrites70.9%
Taylor expanded in y around 0
Applied rewrites70.4%
Taylor expanded in t around 0
Applied rewrites37.0%
if -153 < (log.f64 a) Initial program 96.9%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6467.4
Applied rewrites67.4%
Taylor expanded in t around 0
Applied rewrites50.3%
Taylor expanded in y around 0
Applied rewrites27.9%
Applied rewrites34.1%
Final simplification35.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (pow a (- t 1.0)) y) x)))
(if (<= t -240000.0)
t_1
(if (<= t 2.35e-298)
(/ (* x (/ (exp (- b)) a)) y)
(if (<= t 14800000.0) (/ x (* (/ a (pow z y)) y)) t_1)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t <= -240000.0) {
tmp = t_1;
} else if (t <= 2.35e-298) {
tmp = (x * (exp(-b) / a)) / y;
} else if (t <= 14800000.0) {
tmp = x / ((a / pow(z, y)) * y);
} 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 ** (t - 1.0d0)) / y) * x
if (t <= (-240000.0d0)) then
tmp = t_1
else if (t <= 2.35d-298) then
tmp = (x * (exp(-b) / a)) / y
else if (t <= 14800000.0d0) then
tmp = x / ((a / (z ** y)) * y)
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 = (Math.pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t <= -240000.0) {
tmp = t_1;
} else if (t <= 2.35e-298) {
tmp = (x * (Math.exp(-b) / a)) / y;
} else if (t <= 14800000.0) {
tmp = x / ((a / Math.pow(z, y)) * y);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.pow(a, (t - 1.0)) / y) * x tmp = 0 if t <= -240000.0: tmp = t_1 elif t <= 2.35e-298: tmp = (x * (math.exp(-b) / a)) / y elif t <= 14800000.0: tmp = x / ((a / math.pow(z, y)) * y) else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x) tmp = 0.0 if (t <= -240000.0) tmp = t_1; elseif (t <= 2.35e-298) tmp = Float64(Float64(x * Float64(exp(Float64(-b)) / a)) / y); elseif (t <= 14800000.0) tmp = Float64(x / Float64(Float64(a / (z ^ y)) * y)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = ((a ^ (t - 1.0)) / y) * x; tmp = 0.0; if (t <= -240000.0) tmp = t_1; elseif (t <= 2.35e-298) tmp = (x * (exp(-b) / a)) / y; elseif (t <= 14800000.0) tmp = x / ((a / (z ^ y)) * y); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t, -240000.0], t$95$1, If[LessEqual[t, 2.35e-298], N[(N[(x * N[(N[Exp[(-b)], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t, 14800000.0], N[(x / N[(N[(a / N[Power[z, y], $MachinePrecision]), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\mathbf{if}\;t \leq -240000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 2.35 \cdot 10^{-298}:\\
\;\;\;\;\frac{x \cdot \frac{e^{-b}}{a}}{y}\\
\mathbf{elif}\;t \leq 14800000:\\
\;\;\;\;\frac{x}{\frac{a}{{z}^{y}} \cdot y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -2.4e5 or 1.48e7 < t Initial program 100.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6476.7
Applied rewrites76.7%
Taylor expanded in y around 0
Applied rewrites90.2%
if -2.4e5 < t < 2.35000000000000019e-298Initial program 99.3%
Taylor expanded in y around 0
exp-diffN/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f64N/A
lower-exp.f6477.0
Applied rewrites77.0%
Taylor expanded in t around 0
Applied rewrites77.0%
if 2.35000000000000019e-298 < t < 1.48e7Initial program 92.7%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6482.7
Applied rewrites82.7%
Taylor expanded in t around 0
Applied rewrites83.9%
Applied rewrites88.6%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.1e+31) (not (<= b 3.4e-5))) (* (/ (exp (- b)) y) x) (* (/ (pow a (- t 1.0)) y) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.1e+31) || !(b <= 3.4e-5)) {
tmp = (exp(-b) / y) * x;
} else {
tmp = (pow(a, (t - 1.0)) / y) * x;
}
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.1d+31)) .or. (.not. (b <= 3.4d-5))) then
tmp = (exp(-b) / y) * x
else
tmp = ((a ** (t - 1.0d0)) / y) * x
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.1e+31) || !(b <= 3.4e-5)) {
tmp = (Math.exp(-b) / y) * x;
} else {
tmp = (Math.pow(a, (t - 1.0)) / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.1e+31) or not (b <= 3.4e-5): tmp = (math.exp(-b) / y) * x else: tmp = (math.pow(a, (t - 1.0)) / y) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.1e+31) || !(b <= 3.4e-5)) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); else tmp = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.1e+31) || ~((b <= 3.4e-5))) tmp = (exp(-b) / y) * x; else tmp = ((a ^ (t - 1.0)) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.1e+31], N[Not[LessEqual[b, 3.4e-5]], $MachinePrecision]], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.1 \cdot 10^{+31} \lor \neg \left(b \leq 3.4 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\end{array}
\end{array}
if b < -1.10000000000000005e31 or 3.4e-5 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6479.7
Applied rewrites79.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.7
Applied rewrites79.7%
if -1.10000000000000005e31 < b < 3.4e-5Initial program 95.9%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6488.2
Applied rewrites88.2%
Taylor expanded in y around 0
Applied rewrites80.7%
Final simplification80.2%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -4e+30) (not (<= b 3.4e-5))) (* (/ (exp (- b)) y) x) (pow (/ (* a y) x) -1.0)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -4e+30) || !(b <= 3.4e-5)) {
tmp = (exp(-b) / y) * x;
} else {
tmp = pow(((a * y) / 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) :: tmp
if ((b <= (-4d+30)) .or. (.not. (b <= 3.4d-5))) then
tmp = (exp(-b) / y) * x
else
tmp = ((a * y) / 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 tmp;
if ((b <= -4e+30) || !(b <= 3.4e-5)) {
tmp = (Math.exp(-b) / y) * x;
} else {
tmp = Math.pow(((a * y) / x), -1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -4e+30) or not (b <= 3.4e-5): tmp = (math.exp(-b) / y) * x else: tmp = math.pow(((a * y) / x), -1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -4e+30) || !(b <= 3.4e-5)) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); else tmp = Float64(Float64(a * y) / x) ^ -1.0; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -4e+30) || ~((b <= 3.4e-5))) tmp = (exp(-b) / y) * x; else tmp = ((a * y) / x) ^ -1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -4e+30], N[Not[LessEqual[b, 3.4e-5]], $MachinePrecision]], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], N[Power[N[(N[(a * y), $MachinePrecision] / x), $MachinePrecision], -1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -4 \cdot 10^{+30} \lor \neg \left(b \leq 3.4 \cdot 10^{-5}\right):\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{a \cdot y}{x}\right)}^{-1}\\
\end{array}
\end{array}
if b < -4.0000000000000001e30 or 3.4e-5 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6479.7
Applied rewrites79.7%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6479.7
Applied rewrites79.7%
if -4.0000000000000001e30 < b < 3.4e-5Initial program 95.9%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6488.2
Applied rewrites88.2%
Taylor expanded in t around 0
Applied rewrites65.1%
Taylor expanded in y around 0
Applied rewrites38.9%
Applied rewrites43.6%
Final simplification60.7%
(FPCore (x y z t a b) :precision binary64 (if (or (<= b -1.4e+31) (not (<= b 8e+27))) (* (exp (- b)) (/ x y)) (pow (/ (* a y) x) -1.0)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if ((b <= -1.4e+31) || !(b <= 8e+27)) {
tmp = exp(-b) * (x / y);
} else {
tmp = pow(((a * y) / 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) :: tmp
if ((b <= (-1.4d+31)) .or. (.not. (b <= 8d+27))) then
tmp = exp(-b) * (x / y)
else
tmp = ((a * y) / 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 tmp;
if ((b <= -1.4e+31) || !(b <= 8e+27)) {
tmp = Math.exp(-b) * (x / y);
} else {
tmp = Math.pow(((a * y) / x), -1.0);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if (b <= -1.4e+31) or not (b <= 8e+27): tmp = math.exp(-b) * (x / y) else: tmp = math.pow(((a * y) / x), -1.0) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if ((b <= -1.4e+31) || !(b <= 8e+27)) tmp = Float64(exp(Float64(-b)) * Float64(x / y)); else tmp = Float64(Float64(a * y) / x) ^ -1.0; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if ((b <= -1.4e+31) || ~((b <= 8e+27))) tmp = exp(-b) * (x / y); else tmp = ((a * y) / x) ^ -1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[Or[LessEqual[b, -1.4e+31], N[Not[LessEqual[b, 8e+27]], $MachinePrecision]], N[(N[Exp[(-b)], $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[Power[N[(N[(a * y), $MachinePrecision] / x), $MachinePrecision], -1.0], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;b \leq -1.4 \cdot 10^{+31} \lor \neg \left(b \leq 8 \cdot 10^{+27}\right):\\
\;\;\;\;e^{-b} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{a \cdot y}{x}\right)}^{-1}\\
\end{array}
\end{array}
if b < -1.40000000000000008e31 or 8.0000000000000001e27 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6481.0
Applied rewrites81.0%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6472.2
Applied rewrites72.2%
if -1.40000000000000008e31 < b < 8.0000000000000001e27Initial program 96.1%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6487.4
Applied rewrites87.4%
Taylor expanded in t around 0
Applied rewrites64.0%
Taylor expanded in y around 0
Applied rewrites37.8%
Applied rewrites42.3%
Final simplification55.6%
(FPCore (x y z t a b) :precision binary64 (if (<= (log a) 18.0) (/ (/ x a) y) (/ x (* a y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (log(a) <= 18.0) {
tmp = (x / a) / y;
} else {
tmp = x / (a * 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 (log(a) <= 18.0d0) then
tmp = (x / a) / y
else
tmp = x / (a * y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (Math.log(a) <= 18.0) {
tmp = (x / a) / y;
} else {
tmp = x / (a * y);
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if math.log(a) <= 18.0: tmp = (x / a) / y else: tmp = x / (a * y) return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (log(a) <= 18.0) tmp = Float64(Float64(x / a) / y); else tmp = Float64(x / Float64(a * y)); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (log(a) <= 18.0) tmp = (x / a) / y; else tmp = x / (a * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[Log[a], $MachinePrecision], 18.0], N[(N[(x / a), $MachinePrecision] / y), $MachinePrecision], N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log a \leq 18:\\
\;\;\;\;\frac{\frac{x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{a \cdot y}\\
\end{array}
\end{array}
if (log.f64 a) < 18Initial program 99.5%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6476.6
Applied rewrites76.6%
Applied rewrites69.6%
Taylor expanded in y around 0
Applied rewrites68.3%
Taylor expanded in t around 0
Applied rewrites35.0%
if 18 < (log.f64 a) Initial program 96.3%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6467.7
Applied rewrites67.7%
Taylor expanded in t around 0
Applied rewrites49.3%
Taylor expanded in y around 0
Applied rewrites27.5%
Applied rewrites34.5%
Final simplification34.8%
(FPCore (x y z t a b) :precision binary64 (/ x (* a y)))
double code(double x, double y, double z, double t, double a, double b) {
return x / (a * 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 * y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return x / (a * y);
}
def code(x, y, z, t, a, b): return x / (a * y)
function code(x, y, z, t, a, b) return Float64(x / Float64(a * y)) end
function tmp = code(x, y, z, t, a, b) tmp = x / (a * y); end
code[x_, y_, z_, t_, a_, b_] := N[(x / N[(a * y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x}{a \cdot y}
\end{array}
Initial program 97.8%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
associate-/l*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
lower-/.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6472.0
Applied rewrites72.0%
Taylor expanded in t around 0
Applied rewrites53.4%
Taylor expanded in y around 0
Applied rewrites29.6%
Applied rewrites32.3%
(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 2024296
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
:precision binary64
:alt
(! :herbie-platform default (if (< t -8845848504127471/10000000000000000) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))) (if (< t 8520312288374073/10000000000) (/ (* (/ x y) (pow a (- t 1))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1)) y)) (- (+ b 1) (* y (log z)))))))
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))