(FPCore (x y z) :precision binary64 (/ (* x y) (* (* z z) (+ z 1.0))))
↓
(FPCore (x y z)
:precision binary64
(if (<= (* x y) -2e-289)
(/ (* x y) (* z (+ (pow z 2.0) z)))
(if (<= (* x y) 5e-319)
(* (- (/ x (pow z 2.0)) (/ x z)) y)
(/ (* x y) (* (* z z) (+ z 1.0))))))
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (x * y) / ((z * z) * (z + 1.0d0))
end function
↓
real(8) function code(x, y, z)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x * y) <= (-2d-289)) then
tmp = (x * y) / (z * ((z ** 2.0d0) + z))
else if ((x * y) <= 5d-319) then
tmp = ((x / (z ** 2.0d0)) - (x / z)) * y
else
tmp = (x * y) / ((z * z) * (z + 1.0d0))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
return (x * y) / ((z * z) * (z + 1.0));
}
herbie shell --seed 2023077
(FPCore (x y z)
:name "Statistics.Distribution.Beta:$cvariance from math-functions-0.1.5.2"
:precision binary64
:herbie-target
(if (< z 249.6182814532307) (/ (* y (/ x z)) (+ z (* z z))) (/ (* (/ (/ y z) (+ 1.0 z)) x) z))
(/ (* x y) (* (* z z) (+ z 1.0))))