(FPCore (x y z t a b)
:precision binary64
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))
↓
(FPCore (x y z t a b)
:precision binary64
(let* ((t_1 (* a (* 27.0 b))))
(if (<= (* y 9.0) -1e-32)
(+ t_1 (- (* x 2.0) (* (* y 9.0) (* z t))))
(+ (+ t_1 (* x 2.0)) (* z (* y (* t -9.0)))))))
double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if ((y * 9.0) <= -1e-32) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (t_1 + (x * 2.0)) + (z * (y * (t * -9.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
code = ((x * 2.0d0) - (((y * 9.0d0) * z) * t)) + ((a * 27.0d0) * b)
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) :: t_1
real(8) :: tmp
t_1 = a * (27.0d0 * b)
if ((y * 9.0d0) <= (-1d-32)) then
tmp = t_1 + ((x * 2.0d0) - ((y * 9.0d0) * (z * t)))
else
tmp = (t_1 + (x * 2.0d0)) + (z * (y * (t * (-9.0d0))))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a, double b) {
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
}
↓
public static double code(double x, double y, double z, double t, double a, double b) {
double t_1 = a * (27.0 * b);
double tmp;
if ((y * 9.0) <= -1e-32) {
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
} else {
tmp = (t_1 + (x * 2.0)) + (z * (y * (t * -9.0)));
}
return tmp;
}
def code(x, y, z, t, a, b):
return ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b)
↓
def code(x, y, z, t, a, b):
t_1 = a * (27.0 * b)
tmp = 0
if (y * 9.0) <= -1e-32:
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)))
else:
tmp = (t_1 + (x * 2.0)) + (z * (y * (t * -9.0)))
return tmp
function code(x, y, z, t, a, b)
return Float64(Float64(Float64(x * 2.0) - Float64(Float64(Float64(y * 9.0) * z) * t)) + Float64(Float64(a * 27.0) * b))
end
↓
function code(x, y, z, t, a, b)
t_1 = Float64(a * Float64(27.0 * b))
tmp = 0.0
if (Float64(y * 9.0) <= -1e-32)
tmp = Float64(t_1 + Float64(Float64(x * 2.0) - Float64(Float64(y * 9.0) * Float64(z * t))));
else
tmp = Float64(Float64(t_1 + Float64(x * 2.0)) + Float64(z * Float64(y * Float64(t * -9.0))));
end
return tmp
end
function tmp = code(x, y, z, t, a, b)
tmp = ((x * 2.0) - (((y * 9.0) * z) * t)) + ((a * 27.0) * b);
end
↓
function tmp_2 = code(x, y, z, t, a, b)
t_1 = a * (27.0 * b);
tmp = 0.0;
if ((y * 9.0) <= -1e-32)
tmp = t_1 + ((x * 2.0) - ((y * 9.0) * (z * t)));
else
tmp = (t_1 + (x * 2.0)) + (z * (y * (t * -9.0)));
end
tmp_2 = tmp;
end
herbie shell --seed 2023121
(FPCore (x y z t a b)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, A"
:precision binary64
:herbie-target
(if (< y 7.590524218811189e-161) (+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* a (* 27.0 b))) (+ (- (* x 2.0) (* 9.0 (* y (* t z)))) (* (* a 27.0) b)))
(+ (- (* x 2.0) (* (* (* y 9.0) z) t)) (* (* a 27.0) b)))