(FPCore (x y z t a b)
:precision binary64
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))
↓
(FPCore (x y z t a b)
:precision binary64
(if (<= (* (- t 1.0) (log a)) -684.5)
(* x (/ (/ (pow a t) a) y))
(/ (* x (exp (- (- (* y (log z)) (log a)) b))) y)))
double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * log(a)) <= -684.5) {
tmp = x * ((pow(a, t) / a) / y);
} else {
tmp = (x * exp((((y * log(z)) - 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
code = (x * exp((((y * log(z)) + ((t - 1.0d0) * log(a))) - b))) / y
end function
↓
real(8) function code(x, y, z, t, a, b)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8), intent (in) :: b
real(8) :: tmp
if (((t - 1.0d0) * log(a)) <= (-684.5d0)) then
tmp = x * (((a ** t) / a) / y)
else
tmp = (x * exp((((y * log(z)) - 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) {
return (x * Math.exp((((y * Math.log(z)) + ((t - 1.0) * Math.log(a))) - b))) / y;
}
↓
public static double code(double x, double y, double z, double t, double a, double b) {
double tmp;
if (((t - 1.0) * Math.log(a)) <= -684.5) {
tmp = x * ((Math.pow(a, t) / a) / y);
} else {
tmp = (x * Math.exp((((y * Math.log(z)) - Math.log(a)) - b))) / y;
}
return tmp;
}
def code(x, y, z, t, a, 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):
tmp = 0
if ((t - 1.0) * math.log(a)) <= -684.5:
tmp = x * ((math.pow(a, t) / a) / y)
else:
tmp = (x * math.exp((((y * math.log(z)) - math.log(a)) - b))) / y
return tmp
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 code(x, y, z, t, a, b)
tmp = 0.0
if (Float64(Float64(t - 1.0) * log(a)) <= -684.5)
tmp = Float64(x * Float64(Float64((a ^ t) / a) / y));
else
tmp = Float64(Float64(x * exp(Float64(Float64(Float64(y * log(z)) - log(a)) - b))) / y);
end
return tmp
end
function tmp = code(x, y, z, t, a, b)
tmp = (x * exp((((y * log(z)) + ((t - 1.0) * log(a))) - b))) / y;
end
↓
function tmp_2 = code(x, y, z, t, a, b)
tmp = 0.0;
if (((t - 1.0) * log(a)) <= -684.5)
tmp = x * (((a ^ t) / a) / y);
else
tmp = (x * exp((((y * log(z)) - log(a)) - b))) / y;
end
tmp_2 = tmp;
end
(*.f64 x (/.f64 (/.f64 (pow.f64 a t) a) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (/.f64 (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 a) t))) a) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (/.f64 (exp.f64 (*.f64 (log.f64 a) t)) (Rewrite<= rem-exp-log_binary64 (exp.f64 (log.f64 a)))) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 36 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (Rewrite<= exp-diff_binary64 (exp.f64 (-.f64 (*.f64 (log.f64 a) t) (log.f64 a)))) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 5 points increase in error, 6 points decrease in error
(*.f64 x (/.f64 (exp.f64 (-.f64 (Rewrite=> *-commutative_binary64 (*.f64 t (log.f64 a))) (log.f64 a))) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (exp.f64 (-.f64 (*.f64 t (log.f64 a)) (Rewrite<= *-lft-identity_binary64 (*.f64 1 (log.f64 a))))) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (exp.f64 (Rewrite=> distribute-rgt-out--_binary64 (*.f64 (log.f64 a) (-.f64 t 1)))) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (exp.f64 (Rewrite<= *-commutative_binary64 (*.f64 (-.f64 t 1) (log.f64 a)))) (/.f64 (*.f64 y (exp.f64 b)) (pow.f64 z y)))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (exp.f64 (*.f64 (-.f64 t 1) (log.f64 a))) (/.f64 (*.f64 y (exp.f64 b)) (Rewrite<= exp-to-pow_binary64 (exp.f64 (*.f64 (log.f64 z) y)))))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (exp.f64 (*.f64 (-.f64 t 1) (log.f64 a))) (/.f64 (*.f64 y (exp.f64 b)) (exp.f64 (Rewrite<= *-commutative_binary64 (*.f64 y (log.f64 z))))))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (exp.f64 (*.f64 (-.f64 t 1) (log.f64 a))) (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 y (exp.f64 (*.f64 y (log.f64 z)))) (exp.f64 b))))): 0 points increase in error, 0 points decrease in error
(*.f64 x (Rewrite<= associate-/l/_binary64 (/.f64 (/.f64 (exp.f64 (*.f64 (-.f64 t 1) (log.f64 a))) (exp.f64 b)) (/.f64 y (exp.f64 (*.f64 y (log.f64 z))))))): 1 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (Rewrite<= exp-diff_binary64 (exp.f64 (-.f64 (*.f64 (-.f64 t 1) (log.f64 a)) b))) (/.f64 y (exp.f64 (*.f64 y (log.f64 z)))))): 1 points increase in error, 31 points decrease in error
(*.f64 x (Rewrite<= associate-/l*_binary64 (/.f64 (*.f64 (exp.f64 (-.f64 (*.f64 (-.f64 t 1) (log.f64 a)) b)) (exp.f64 (*.f64 y (log.f64 z)))) y))): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (Rewrite<= exp-sum_binary64 (exp.f64 (+.f64 (-.f64 (*.f64 (-.f64 t 1) (log.f64 a)) b) (*.f64 y (log.f64 z))))) y)): 3 points increase in error, 48 points decrease in error
(*.f64 x (/.f64 (exp.f64 (Rewrite<= +-commutative_binary64 (+.f64 (*.f64 y (log.f64 z)) (-.f64 (*.f64 (-.f64 t 1) (log.f64 a)) b)))) y)): 0 points increase in error, 0 points decrease in error
(*.f64 x (/.f64 (exp.f64 (Rewrite<= associate--l+_binary64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y)): 0 points increase in error, 0 points decrease in error
(Rewrite=> associate-*r/_binary64 (/.f64 (*.f64 x (exp.f64 (-.f64 (+.f64 (*.f64 y (log.f64 z)) (*.f64 (-.f64 t 1) (log.f64 a))) b))) y)): 11 points increase in error, 8 points decrease in error
Taylor expanded in y around 0 9.6
\[\leadsto x \cdot \frac{\frac{{a}^{t}}{a}}{\color{blue}{y \cdot e^{b}}}
\]
Taylor expanded in b around 0 0.2
\[\leadsto x \cdot \frac{\frac{{a}^{t}}{a}}{\color{blue}{y}}
\]
herbie shell --seed 2022325
(FPCore (x y z t a b)
:name "Numeric.SpecFunctions:incompleteBetaWorker from math-functions-0.1.5.2, A"
:precision binary64
:herbie-target
(if (< t -0.8845848504127471) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z)))) (if (< t 852031.2288374073) (/ (* (/ x y) (pow a (- t 1.0))) (exp (- b (* (log z) y)))) (/ (* x (/ (pow a (- t 1.0)) y)) (- (+ b 1.0) (* y (log z))))))
(/ (* x (exp (- (+ (* y (log z)) (* (- t 1.0) (log a))) b))) y))