(FPCore (A B C)
:precision binary64
(*
180.0
(/
(atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0))))))
PI)))
↓
(FPCore (A B C)
:precision binary64
(let* ((t_0
(* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))))
(if (or (<= t_0 -0.5) (not (<= t_0 0.0)))
(* 180.0 (/ (atan (/ (- (- C A) (hypot B (- A C))) B)) PI))
(/ (* 180.0 (atan (* 0.5 (/ B A)))) PI))))
double code(double A, double B, double C) {
return 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((pow((A - C), 2.0) + pow(B, 2.0)))))) / ((double) M_PI));
}
def code(A, B, C):
t_0 = (1.0 / B) * ((C - A) - math.sqrt((math.pow((A - C), 2.0) + math.pow(B, 2.0))))
tmp = 0
if (t_0 <= -0.5) or not (t_0 <= 0.0):
tmp = 180.0 * (math.atan((((C - A) - math.hypot(B, (A - C))) / B)) / math.pi)
else:
tmp = (180.0 * math.atan((0.5 * (B / A)))) / math.pi
return tmp
function code(A, B, C)
return Float64(180.0 * Float64(atan(Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))) / pi))
end
↓
function code(A, B, C)
t_0 = Float64(Float64(1.0 / B) * Float64(Float64(C - A) - sqrt(Float64((Float64(A - C) ^ 2.0) + (B ^ 2.0)))))
tmp = 0.0
if ((t_0 <= -0.5) || !(t_0 <= 0.0))
tmp = Float64(180.0 * Float64(atan(Float64(Float64(Float64(C - A) - hypot(B, Float64(A - C))) / B)) / pi));
else
tmp = Float64(Float64(180.0 * atan(Float64(0.5 * Float64(B / A)))) / pi);
end
return tmp
end
function tmp = code(A, B, C)
tmp = 180.0 * (atan(((1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0)))))) / pi);
end
↓
function tmp_2 = code(A, B, C)
t_0 = (1.0 / B) * ((C - A) - sqrt((((A - C) ^ 2.0) + (B ^ 2.0))));
tmp = 0.0;
if ((t_0 <= -0.5) || ~((t_0 <= 0.0)))
tmp = 180.0 * (atan((((C - A) - hypot(B, (A - C))) / B)) / pi);
else
tmp = (180.0 * atan((0.5 * (B / A)))) / pi;
end
tmp_2 = tmp;
end
if (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < -0.5 or 0.0 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2)))))
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (hypot.f64 B (-.f64 A C))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 B B) (*.f64 (-.f64 A C) (-.f64 A C)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (Rewrite<= unpow2_binary64 (pow.f64 B 2)) (*.f64 (-.f64 A C) (-.f64 A C))))) B)) (PI.f64))): 6 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 B 2) (Rewrite<= unpow2_binary64 (pow.f64 (-.f64 A C) 2))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (Rewrite<= +-commutative_binary64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) B)) (PI.f64))): 0 points increase in error, 6 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (PI.f64))): 0 points increase in error, 0 points decrease in error
if -0.5 < (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) < 0.0
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (hypot.f64 B (-.f64 A C))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (Rewrite<= hypot-def_binary64 (sqrt.f64 (+.f64 (*.f64 B B) (*.f64 (-.f64 A C) (-.f64 A C)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (Rewrite<= unpow2_binary64 (pow.f64 B 2)) (*.f64 (-.f64 A C) (-.f64 A C))))) B)) (PI.f64))): 6 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 B 2) (Rewrite<= unpow2_binary64 (pow.f64 (-.f64 A C) 2))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (-.f64 (-.f64 C A) (sqrt.f64 (Rewrite<= +-commutative_binary64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))) B)) (PI.f64))): 0 points increase in error, 6 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (/.f64 (Rewrite<= *-lft-identity_binary64 (*.f64 1 (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2)))))) B)) (PI.f64))): 0 points increase in error, 0 points decrease in error
(*.f64 180 (/.f64 (atan.f64 (Rewrite<= associate-*l/_binary64 (*.f64 (/.f64 1 B) (-.f64 (-.f64 C A) (sqrt.f64 (+.f64 (pow.f64 (-.f64 A C) 2) (pow.f64 B 2))))))) (PI.f64))): 0 points increase in error, 0 points decrease in error
herbie shell --seed 2022340
(FPCore (A B C)
:name "ABCF->ab-angle angle"
:precision binary64
(* 180.0 (/ (atan (* (/ 1.0 B) (- (- C A) (sqrt (+ (pow (- A C) 2.0) (pow B 2.0)))))) PI)))