(FPCore (x y z t)
:precision binary64
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
↓
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- x (/ y (* z 3.0)))))
(if (<= t -200000000.0)
(+ t_1 (/ t (* (* z 3.0) y)))
(if (<= t 1.55e-7)
(+ (- x (/ (/ y z) 3.0)) (/ (/ (/ t y) z) 3.0))
(+ t_1 (* (/ t (* y z)) 0.3333333333333333))))))
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
↓
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = x - (y / (z * 3.0d0))
if (t <= (-200000000.0d0)) then
tmp = t_1 + (t / ((z * 3.0d0) * y))
else if (t <= 1.55d-7) then
tmp = (x - ((y / z) / 3.0d0)) + (((t / y) / z) / 3.0d0)
else
tmp = t_1 + ((t / (y * z)) * 0.3333333333333333d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
herbie shell --seed 2023075
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:herbie-target
(+ (- x (/ y (* z 3.0))) (/ (/ t (* z 3.0)) y))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))