
(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 12 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 (/ (* (exp (- (+ (* (log a) (- t 1.0)) (* (log z) y)) b)) x) y))
double code(double x, double y, double z, double t, double a, double b) {
return (exp((((log(a) * (t - 1.0)) + (log(z) * y)) - b)) * x) / 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 = (exp((((log(a) * (t - 1.0d0)) + (log(z) * y)) - b)) * x) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (Math.exp((((Math.log(a) * (t - 1.0)) + (Math.log(z) * y)) - b)) * x) / y;
}
def code(x, y, z, t, a, b): return (math.exp((((math.log(a) * (t - 1.0)) + (math.log(z) * y)) - b)) * x) / y
function code(x, y, z, t, a, b) return Float64(Float64(exp(Float64(Float64(Float64(log(a) * Float64(t - 1.0)) + Float64(log(z) * y)) - b)) * x) / y) end
function tmp = code(x, y, z, t, a, b) tmp = (exp((((log(a) * (t - 1.0)) + (log(z) * y)) - b)) * x) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[Exp[N[(N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] + N[(N[Log[z], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{e^{\left(\log a \cdot \left(t - 1\right) + \log z \cdot y\right) - b} \cdot x}{y}
\end{array}
Initial program 98.6%
Final simplification98.6%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (pow a (- t 1.0)))
(t_2 (* (log a) (- t 1.0)))
(t_3 (* (/ t_1 y) x)))
(if (<= t_2 -2000.0)
t_3
(if (<= t_2 -326.0)
(* (/ t_1 (* (exp b) y)) x)
(if (<= t_2 5e+98) (/ (/ (* (pow z y) x) a) y) t_3)))))
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 = log(a) * (t - 1.0);
double t_3 = (t_1 / y) * x;
double tmp;
if (t_2 <= -2000.0) {
tmp = t_3;
} else if (t_2 <= -326.0) {
tmp = (t_1 / (exp(b) * y)) * x;
} else if (t_2 <= 5e+98) {
tmp = ((pow(z, y) * x) / a) / y;
} else {
tmp = t_3;
}
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) :: t_3
real(8) :: tmp
t_1 = a ** (t - 1.0d0)
t_2 = log(a) * (t - 1.0d0)
t_3 = (t_1 / y) * x
if (t_2 <= (-2000.0d0)) then
tmp = t_3
else if (t_2 <= (-326.0d0)) then
tmp = (t_1 / (exp(b) * y)) * x
else if (t_2 <= 5d+98) then
tmp = (((z ** y) * x) / a) / y
else
tmp = t_3
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 = Math.log(a) * (t - 1.0);
double t_3 = (t_1 / y) * x;
double tmp;
if (t_2 <= -2000.0) {
tmp = t_3;
} else if (t_2 <= -326.0) {
tmp = (t_1 / (Math.exp(b) * y)) * x;
} else if (t_2 <= 5e+98) {
tmp = ((Math.pow(z, y) * x) / a) / y;
} else {
tmp = t_3;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.pow(a, (t - 1.0)) t_2 = math.log(a) * (t - 1.0) t_3 = (t_1 / y) * x tmp = 0 if t_2 <= -2000.0: tmp = t_3 elif t_2 <= -326.0: tmp = (t_1 / (math.exp(b) * y)) * x elif t_2 <= 5e+98: tmp = ((math.pow(z, y) * x) / a) / y else: tmp = t_3 return tmp
function code(x, y, z, t, a, b) t_1 = a ^ Float64(t - 1.0) t_2 = Float64(log(a) * Float64(t - 1.0)) t_3 = Float64(Float64(t_1 / y) * x) tmp = 0.0 if (t_2 <= -2000.0) tmp = t_3; elseif (t_2 <= -326.0) tmp = Float64(Float64(t_1 / Float64(exp(b) * y)) * x); elseif (t_2 <= 5e+98) tmp = Float64(Float64(Float64((z ^ y) * x) / a) / y); else tmp = t_3; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = a ^ (t - 1.0); t_2 = log(a) * (t - 1.0); t_3 = (t_1 / y) * x; tmp = 0.0; if (t_2 <= -2000.0) tmp = t_3; elseif (t_2 <= -326.0) tmp = (t_1 / (exp(b) * y)) * x; elseif (t_2 <= 5e+98) tmp = (((z ^ y) * x) / a) / y; else tmp = t_3; 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[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$1 / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$2, -2000.0], t$95$3, If[LessEqual[t$95$2, -326.0], N[(N[(t$95$1 / N[(N[Exp[b], $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t$95$2, 5e+98], N[(N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], t$95$3]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := {a}^{\left(t - 1\right)}\\
t_2 := \log a \cdot \left(t - 1\right)\\
t_3 := \frac{t\_1}{y} \cdot x\\
\mathbf{if}\;t\_2 \leq -2000:\\
\;\;\;\;t\_3\\
\mathbf{elif}\;t\_2 \leq -326:\\
\;\;\;\;\frac{t\_1}{e^{b} \cdot y} \cdot x\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+98}:\\
\;\;\;\;\frac{\frac{{z}^{y} \cdot x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_3\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -2e3 or 4.9999999999999998e98 < (*.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--.f6475.1
Applied rewrites75.1%
Taylor expanded in y around 0
Applied rewrites89.8%
if -2e3 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -326Initial program 91.8%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6454.2
Applied rewrites54.2%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6454.2
Applied rewrites54.2%
Taylor expanded in y around 0
exp-diffN/A
associate-/l/N/A
lower-/.f64N/A
exp-to-powN/A
lower-pow.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-exp.f6486.1
Applied rewrites86.1%
if -326 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4.9999999999999998e98Initial program 98.7%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6476.9
Applied rewrites76.9%
Applied rewrites77.0%
Taylor expanded in t around 0
Applied rewrites80.9%
Final simplification85.5%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (log a) (- t 1.0))) (t_2 (* (/ (pow a (- t 1.0)) y) x)))
(if (<= t_1 -5e+19)
t_2
(if (<= t_1 -326.0)
(/ (* (exp (- (- (log a)) b)) x) y)
(if (<= t_1 5e+98) (/ (/ (* (pow z y) x) a) y) t_2)))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = log(a) * (t - 1.0);
double t_2 = (pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t_1 <= -5e+19) {
tmp = t_2;
} else if (t_1 <= -326.0) {
tmp = (exp((-log(a) - b)) * x) / y;
} else if (t_1 <= 5e+98) {
tmp = ((pow(z, y) * x) / a) / 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 = log(a) * (t - 1.0d0)
t_2 = ((a ** (t - 1.0d0)) / y) * x
if (t_1 <= (-5d+19)) then
tmp = t_2
else if (t_1 <= (-326.0d0)) then
tmp = (exp((-log(a) - b)) * x) / y
else if (t_1 <= 5d+98) then
tmp = (((z ** y) * x) / a) / 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.log(a) * (t - 1.0);
double t_2 = (Math.pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t_1 <= -5e+19) {
tmp = t_2;
} else if (t_1 <= -326.0) {
tmp = (Math.exp((-Math.log(a) - b)) * x) / y;
} else if (t_1 <= 5e+98) {
tmp = ((Math.pow(z, y) * x) / a) / y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.log(a) * (t - 1.0) t_2 = (math.pow(a, (t - 1.0)) / y) * x tmp = 0 if t_1 <= -5e+19: tmp = t_2 elif t_1 <= -326.0: tmp = (math.exp((-math.log(a) - b)) * x) / y elif t_1 <= 5e+98: tmp = ((math.pow(z, y) * x) / a) / y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(log(a) * Float64(t - 1.0)) t_2 = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x) tmp = 0.0 if (t_1 <= -5e+19) tmp = t_2; elseif (t_1 <= -326.0) tmp = Float64(Float64(exp(Float64(Float64(-log(a)) - b)) * x) / y); elseif (t_1 <= 5e+98) tmp = Float64(Float64(Float64((z ^ y) * x) / a) / y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = log(a) * (t - 1.0); t_2 = ((a ^ (t - 1.0)) / y) * x; tmp = 0.0; if (t_1 <= -5e+19) tmp = t_2; elseif (t_1 <= -326.0) tmp = (exp((-log(a) - b)) * x) / y; elseif (t_1 <= 5e+98) tmp = (((z ^ y) * x) / a) / y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+19], t$95$2, If[LessEqual[t$95$1, -326.0], N[(N[(N[Exp[N[((-N[Log[a], $MachinePrecision]) - b), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[t$95$1, 5e+98], N[(N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log a \cdot \left(t - 1\right)\\
t_2 := \frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -326:\\
\;\;\;\;\frac{e^{\left(-\log a\right) - b} \cdot x}{y}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+98}:\\
\;\;\;\;\frac{\frac{{z}^{y} \cdot x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -5e19 or 4.9999999999999998e98 < (*.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--.f6476.6
Applied rewrites76.6%
Taylor expanded in y around 0
Applied rewrites92.0%
if -5e19 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -326Initial program 93.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
rem-exp-logN/A
lower-log.f64N/A
rem-exp-log78.7
Applied rewrites78.7%
Taylor expanded in t around 0
Applied rewrites75.9%
if -326 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4.9999999999999998e98Initial program 98.7%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6476.9
Applied rewrites76.9%
Applied rewrites77.0%
Taylor expanded in t around 0
Applied rewrites80.9%
Final simplification85.1%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (log a) (- t 1.0))) (t_2 (* (/ (pow a (- t 1.0)) y) x)))
(if (<= t_1 -5e+19)
t_2
(if (<= t_1 5e+98) (/ (/ (* (pow z y) x) a) y) t_2))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = log(a) * (t - 1.0);
double t_2 = (pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t_1 <= -5e+19) {
tmp = t_2;
} else if (t_1 <= 5e+98) {
tmp = ((pow(z, y) * x) / a) / 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 = log(a) * (t - 1.0d0)
t_2 = ((a ** (t - 1.0d0)) / y) * x
if (t_1 <= (-5d+19)) then
tmp = t_2
else if (t_1 <= 5d+98) then
tmp = (((z ** y) * x) / a) / 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.log(a) * (t - 1.0);
double t_2 = (Math.pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t_1 <= -5e+19) {
tmp = t_2;
} else if (t_1 <= 5e+98) {
tmp = ((Math.pow(z, y) * x) / a) / y;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = math.log(a) * (t - 1.0) t_2 = (math.pow(a, (t - 1.0)) / y) * x tmp = 0 if t_1 <= -5e+19: tmp = t_2 elif t_1 <= 5e+98: tmp = ((math.pow(z, y) * x) / a) / y else: tmp = t_2 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(log(a) * Float64(t - 1.0)) t_2 = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x) tmp = 0.0 if (t_1 <= -5e+19) tmp = t_2; elseif (t_1 <= 5e+98) tmp = Float64(Float64(Float64((z ^ y) * x) / a) / y); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = log(a) * (t - 1.0); t_2 = ((a ^ (t - 1.0)) / y) * x; tmp = 0.0; if (t_1 <= -5e+19) tmp = t_2; elseif (t_1 <= 5e+98) tmp = (((z ^ y) * x) / a) / y; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+19], t$95$2, If[LessEqual[t$95$1, 5e+98], N[(N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \log a \cdot \left(t - 1\right)\\
t_2 := \frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+19}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+98}:\\
\;\;\;\;\frac{\frac{{z}^{y} \cdot x}{a}}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < -5e19 or 4.9999999999999998e98 < (*.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--.f6476.6
Applied rewrites76.6%
Taylor expanded in y around 0
Applied rewrites92.0%
if -5e19 < (*.f64 (-.f64 t #s(literal 1 binary64)) (log.f64 a)) < 4.9999999999999998e98Initial program 97.4%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6471.4
Applied rewrites71.4%
Applied rewrites71.5%
Taylor expanded in t around 0
Applied rewrites75.2%
Final simplification82.5%
(FPCore (x y z t a b)
:precision binary64
(if (<= y -1.3e+26)
(/ (/ (* (pow z y) x) a) y)
(if (<= y 5.9e+159)
(/ (* (exp (- (* (log a) (- t 1.0)) b)) x) y)
(/ (* (/ (pow z y) a) x) y))))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (y <= -1.3e+26) {
tmp = ((pow(z, y) * x) / a) / y;
} else if (y <= 5.9e+159) {
tmp = (exp(((log(a) * (t - 1.0)) - b)) * x) / y;
} else {
tmp = ((pow(z, y) / a) * 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) :: tmp
if (y <= (-1.3d+26)) then
tmp = (((z ** y) * x) / a) / y
else if (y <= 5.9d+159) then
tmp = (exp(((log(a) * (t - 1.0d0)) - b)) * x) / y
else
tmp = (((z ** y) / a) * 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 tmp;
if (y <= -1.3e+26) {
tmp = ((Math.pow(z, y) * x) / a) / y;
} else if (y <= 5.9e+159) {
tmp = (Math.exp(((Math.log(a) * (t - 1.0)) - b)) * x) / y;
} else {
tmp = ((Math.pow(z, y) / a) * x) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if y <= -1.3e+26: tmp = ((math.pow(z, y) * x) / a) / y elif y <= 5.9e+159: tmp = (math.exp(((math.log(a) * (t - 1.0)) - b)) * x) / y else: tmp = ((math.pow(z, y) / a) * x) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (y <= -1.3e+26) tmp = Float64(Float64(Float64((z ^ y) * x) / a) / y); elseif (y <= 5.9e+159) tmp = Float64(Float64(exp(Float64(Float64(log(a) * Float64(t - 1.0)) - b)) * x) / y); else tmp = Float64(Float64(Float64((z ^ y) / a) * x) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (y <= -1.3e+26) tmp = (((z ^ y) * x) / a) / y; elseif (y <= 5.9e+159) tmp = (exp(((log(a) * (t - 1.0)) - b)) * x) / y; else tmp = (((z ^ y) / a) * x) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[y, -1.3e+26], N[(N[(N[(N[Power[z, y], $MachinePrecision] * x), $MachinePrecision] / a), $MachinePrecision] / y), $MachinePrecision], If[LessEqual[y, 5.9e+159], N[(N[(N[Exp[N[(N[(N[Log[a], $MachinePrecision] * N[(t - 1.0), $MachinePrecision]), $MachinePrecision] - b), $MachinePrecision]], $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], N[(N[(N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+26}:\\
\;\;\;\;\frac{\frac{{z}^{y} \cdot x}{a}}{y}\\
\mathbf{elif}\;y \leq 5.9 \cdot 10^{+159}:\\
\;\;\;\;\frac{e^{\log a \cdot \left(t - 1\right) - b} \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{{z}^{y}}{a} \cdot x}{y}\\
\end{array}
\end{array}
if y < -1.30000000000000001e26Initial program 100.0%
Taylor expanded in b around 0
exp-sumN/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
*-commutativeN/A
exp-to-powN/A
lower-pow.f64N/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
lower--.f6467.7
Applied rewrites67.7%
Applied rewrites67.7%
Taylor expanded in t around 0
Applied rewrites80.6%
if -1.30000000000000001e26 < y < 5.89999999999999993e159Initial program 97.6%
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%
if 5.89999999999999993e159 < y Initial program 100.0%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites92.9%
Taylor expanded in t around 0
Applied rewrites93.0%
Final simplification90.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (pow a (- t 1.0)) y) x)))
(if (<= t -5.5e+17)
t_1
(if (<= t 1.35e-99)
(* (/ x y) (/ (pow z y) a))
(if (<= t 8.2) (* (/ (exp (- b)) y) x) 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 <= -5.5e+17) {
tmp = t_1;
} else if (t <= 1.35e-99) {
tmp = (x / y) * (pow(z, y) / a);
} else if (t <= 8.2) {
tmp = (exp(-b) / y) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = ((a ** (t - 1.0d0)) / y) * x
if (t <= (-5.5d+17)) then
tmp = t_1
else if (t <= 1.35d-99) then
tmp = (x / y) * ((z ** y) / a)
else if (t <= 8.2d0) then
tmp = (exp(-b) / y) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.pow(a, (t - 1.0)) / y) * x;
double tmp;
if (t <= -5.5e+17) {
tmp = t_1;
} else if (t <= 1.35e-99) {
tmp = (x / y) * (Math.pow(z, y) / a);
} else if (t <= 8.2) {
tmp = (Math.exp(-b) / y) * x;
} 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 <= -5.5e+17: tmp = t_1 elif t <= 1.35e-99: tmp = (x / y) * (math.pow(z, y) / a) elif t <= 8.2: tmp = (math.exp(-b) / y) * x 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 <= -5.5e+17) tmp = t_1; elseif (t <= 1.35e-99) tmp = Float64(Float64(x / y) * Float64((z ^ y) / a)); elseif (t <= 8.2) tmp = Float64(Float64(exp(Float64(-b)) / y) * x); 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 <= -5.5e+17) tmp = t_1; elseif (t <= 1.35e-99) tmp = (x / y) * ((z ^ y) / a); elseif (t <= 8.2) tmp = (exp(-b) / y) * x; 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, -5.5e+17], t$95$1, If[LessEqual[t, 1.35e-99], N[(N[(x / y), $MachinePrecision] * N[(N[Power[z, y], $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 8.2], N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $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 -5.5 \cdot 10^{+17}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t \leq 1.35 \cdot 10^{-99}:\\
\;\;\;\;\frac{x}{y} \cdot \frac{{z}^{y}}{a}\\
\mathbf{elif}\;t \leq 8.2:\\
\;\;\;\;\frac{e^{-b}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if t < -5.5e17 or 8.1999999999999993 < 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--.f6472.6
Applied rewrites72.6%
Taylor expanded in y around 0
Applied rewrites86.5%
if -5.5e17 < t < 1.35e-99Initial program 96.6%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites78.8%
Taylor expanded in t around 0
Applied rewrites80.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6474.4
Applied rewrites74.4%
if 1.35e-99 < t < 8.1999999999999993Initial program 99.7%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6467.4
Applied rewrites67.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6467.4
Applied rewrites67.4%
Final simplification80.1%
(FPCore (x y z t a b) :precision binary64 (if (<= (log a) 80.0) (* (/ 1.0 a) (/ x y)) (* (/ (/ 1.0 a) y) x)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (log(a) <= 80.0) {
tmp = (1.0 / a) * (x / y);
} else {
tmp = ((1.0 / a) / 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) <= 80.0d0) then
tmp = (1.0d0 / a) * (x / y)
else
tmp = ((1.0d0 / a) / 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) <= 80.0) {
tmp = (1.0 / a) * (x / y);
} else {
tmp = ((1.0 / a) / y) * x;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if math.log(a) <= 80.0: tmp = (1.0 / a) * (x / y) else: tmp = ((1.0 / a) / y) * x return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (log(a) <= 80.0) tmp = Float64(Float64(1.0 / a) * Float64(x / y)); else tmp = Float64(Float64(Float64(1.0 / a) / y) * x); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (log(a) <= 80.0) tmp = (1.0 / a) * (x / y); else tmp = ((1.0 / a) / y) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[N[Log[a], $MachinePrecision], 80.0], N[(N[(1.0 / a), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / a), $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;\log a \leq 80:\\
\;\;\;\;\frac{1}{a} \cdot \frac{x}{y}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{a}}{y} \cdot x\\
\end{array}
\end{array}
if (log.f64 a) < 80Initial program 99.2%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites78.3%
Taylor expanded in t around 0
Applied rewrites66.1%
Taylor expanded in y around 0
Applied rewrites35.6%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6436.4
Applied rewrites36.4%
if 80 < (log.f64 a) Initial program 97.8%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites68.7%
Taylor expanded in t around 0
Applied rewrites55.9%
Taylor expanded in y around 0
Applied rewrites30.4%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6432.0
Applied rewrites32.0%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -1.15e+68)
t_1
(if (<= b 2.15e+19) (* (/ (pow a (- t 1.0)) y) x) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp(-b) / y) * x;
double tmp;
if (b <= -1.15e+68) {
tmp = t_1;
} else if (b <= 2.15e+19) {
tmp = (pow(a, (t - 1.0)) / y) * x;
} else {
tmp = t_1;
}
return tmp;
}
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: t_1
real(8) :: tmp
t_1 = (exp(-b) / y) * x
if (b <= (-1.15d+68)) then
tmp = t_1
else if (b <= 2.15d+19) then
tmp = ((a ** (t - 1.0d0)) / y) * x
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (Math.exp(-b) / y) * x;
double tmp;
if (b <= -1.15e+68) {
tmp = t_1;
} else if (b <= 2.15e+19) {
tmp = (Math.pow(a, (t - 1.0)) / y) * x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp(-b) / y) * x tmp = 0 if b <= -1.15e+68: tmp = t_1 elif b <= 2.15e+19: tmp = (math.pow(a, (t - 1.0)) / y) * x else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(-b)) / y) * x) tmp = 0.0 if (b <= -1.15e+68) tmp = t_1; elseif (b <= 2.15e+19) tmp = Float64(Float64((a ^ Float64(t - 1.0)) / y) * x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp(-b) / y) * x; tmp = 0.0; if (b <= -1.15e+68) tmp = t_1; elseif (b <= 2.15e+19) tmp = ((a ^ (t - 1.0)) / y) * x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -1.15e+68], t$95$1, If[LessEqual[b, 2.15e+19], N[(N[(N[Power[a, N[(t - 1.0), $MachinePrecision]], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -1.15 \cdot 10^{+68}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 2.15 \cdot 10^{+19}:\\
\;\;\;\;\frac{{a}^{\left(t - 1\right)}}{y} \cdot x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -1.15e68 or 2.15e19 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6476.9
Applied rewrites76.9%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6476.9
Applied rewrites76.9%
if -1.15e68 < b < 2.15e19Initial program 97.4%
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--.f6484.1
Applied rewrites84.1%
Taylor expanded in y around 0
Applied rewrites72.1%
Final simplification74.2%
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* (/ (exp (- b)) y) x)))
(if (<= b -28000000000000.0)
t_1
(if (<= b 31000000.0) (/ (* (/ 1.0 a) x) y) t_1))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = (exp(-b) / y) * x;
double tmp;
if (b <= -28000000000000.0) {
tmp = t_1;
} else if (b <= 31000000.0) {
tmp = ((1.0 / a) * x) / 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 = (exp(-b) / y) * x
if (b <= (-28000000000000.0d0)) then
tmp = t_1
else if (b <= 31000000.0d0) then
tmp = ((1.0d0 / a) * x) / 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.exp(-b) / y) * x;
double tmp;
if (b <= -28000000000000.0) {
tmp = t_1;
} else if (b <= 31000000.0) {
tmp = ((1.0 / a) * x) / y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a, b): t_1 = (math.exp(-b) / y) * x tmp = 0 if b <= -28000000000000.0: tmp = t_1 elif b <= 31000000.0: tmp = ((1.0 / a) * x) / y else: tmp = t_1 return tmp
function code(x, y, z, t, a, b) t_1 = Float64(Float64(exp(Float64(-b)) / y) * x) tmp = 0.0 if (b <= -28000000000000.0) tmp = t_1; elseif (b <= 31000000.0) tmp = Float64(Float64(Float64(1.0 / a) * x) / y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a, b) t_1 = (exp(-b) / y) * x; tmp = 0.0; if (b <= -28000000000000.0) tmp = t_1; elseif (b <= 31000000.0) tmp = ((1.0 / a) * x) / y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := Block[{t$95$1 = N[(N[(N[Exp[(-b)], $MachinePrecision] / y), $MachinePrecision] * x), $MachinePrecision]}, If[LessEqual[b, -28000000000000.0], t$95$1, If[LessEqual[b, 31000000.0], N[(N[(N[(1.0 / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{e^{-b}}{y} \cdot x\\
\mathbf{if}\;b \leq -28000000000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;b \leq 31000000:\\
\;\;\;\;\frac{\frac{1}{a} \cdot x}{y}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if b < -2.8e13 or 3.1e7 < b Initial program 100.0%
Taylor expanded in b around inf
mul-1-negN/A
lower-neg.f6474.3
Applied rewrites74.3%
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6474.3
Applied rewrites74.3%
if -2.8e13 < b < 3.1e7Initial program 97.1%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites88.0%
Taylor expanded in t around 0
Applied rewrites70.8%
Taylor expanded in y around 0
Applied rewrites42.0%
Final simplification58.4%
(FPCore (x y z t a b) :precision binary64 (if (<= x 1e-128) (/ 1.0 (/ (/ y x) (/ 1.0 a))) (/ (* (/ 1.0 a) x) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (x <= 1e-128) {
tmp = 1.0 / ((y / x) / (1.0 / a));
} else {
tmp = ((1.0 / a) * 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) :: tmp
if (x <= 1d-128) then
tmp = 1.0d0 / ((y / x) / (1.0d0 / a))
else
tmp = ((1.0d0 / a) * 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 tmp;
if (x <= 1e-128) {
tmp = 1.0 / ((y / x) / (1.0 / a));
} else {
tmp = ((1.0 / a) * x) / y;
}
return tmp;
}
def code(x, y, z, t, a, b): tmp = 0 if x <= 1e-128: tmp = 1.0 / ((y / x) / (1.0 / a)) else: tmp = ((1.0 / a) * x) / y return tmp
function code(x, y, z, t, a, b) tmp = 0.0 if (x <= 1e-128) tmp = Float64(1.0 / Float64(Float64(y / x) / Float64(1.0 / a))); else tmp = Float64(Float64(Float64(1.0 / a) * x) / y); end return tmp end
function tmp_2 = code(x, y, z, t, a, b) tmp = 0.0; if (x <= 1e-128) tmp = 1.0 / ((y / x) / (1.0 / a)); else tmp = ((1.0 / a) * x) / y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_, b_] := If[LessEqual[x, 1e-128], N[(1.0 / N[(N[(y / x), $MachinePrecision] / N[(1.0 / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(1.0 / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq 10^{-128}:\\
\;\;\;\;\frac{1}{\frac{\frac{y}{x}}{\frac{1}{a}}}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{1}{a} \cdot x}{y}\\
\end{array}
\end{array}
if x < 1.00000000000000005e-128Initial program 98.1%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites70.1%
Taylor expanded in t around 0
Applied rewrites59.5%
Taylor expanded in y around 0
Applied rewrites33.3%
lift-/.f64N/A
clear-numN/A
lower-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
Applied rewrites34.1%
if 1.00000000000000005e-128 < x Initial program 99.3%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites80.3%
Taylor expanded in t around 0
Applied rewrites64.4%
Taylor expanded in y around 0
Applied rewrites32.8%
Final simplification33.6%
(FPCore (x y z t a b) :precision binary64 (/ (* (/ 1.0 a) x) y))
double code(double x, double y, double z, double t, double a, double b) {
return ((1.0 / a) * x) / 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 = ((1.0d0 / a) * x) / y
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((1.0 / a) * x) / y;
}
def code(x, y, z, t, a, b): return ((1.0 / a) * x) / y
function code(x, y, z, t, a, b) return Float64(Float64(Float64(1.0 / a) * x) / y) end
function tmp = code(x, y, z, t, a, b) tmp = ((1.0 / a) * x) / y; end
code[x_, y_, z_, t_, a_, b_] := N[(N[(N[(1.0 / a), $MachinePrecision] * x), $MachinePrecision] / y), $MachinePrecision]
\begin{array}{l}
\\
\frac{\frac{1}{a} \cdot x}{y}
\end{array}
Initial program 98.6%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites73.7%
Taylor expanded in t around 0
Applied rewrites61.2%
Taylor expanded in y around 0
Applied rewrites33.1%
Final simplification33.1%
(FPCore (x y z t a b) :precision binary64 (* (/ 1.0 a) (/ x y)))
double code(double x, double y, double z, double t, double a, double b) {
return (1.0 / a) * (x / 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 = (1.0d0 / a) * (x / y)
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return (1.0 / a) * (x / y);
}
def code(x, y, z, t, a, b): return (1.0 / a) * (x / y)
function code(x, y, z, t, a, b) return Float64(Float64(1.0 / a) * Float64(x / y)) end
function tmp = code(x, y, z, t, a, b) tmp = (1.0 / a) * (x / y); end
code[x_, y_, z_, t_, a_, b_] := N[(N[(1.0 / a), $MachinePrecision] * N[(x / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{1}{a} \cdot \frac{x}{y}
\end{array}
Initial program 98.6%
Taylor expanded in b around 0
sub-negN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-+l+N/A
+-commutativeN/A
associate-+l+N/A
+-commutativeN/A
exp-sumN/A
lower-*.f64N/A
*-commutativeN/A
exp-prodN/A
lower-pow.f64N/A
rem-exp-logN/A
+-commutativeN/A
mul-1-negN/A
Applied rewrites73.7%
Taylor expanded in t around 0
Applied rewrites61.2%
Taylor expanded in y around 0
Applied rewrites33.1%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f6432.1
Applied rewrites32.1%
(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 2024249
(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))