?

Average Accuracy: 33.7% → 44.6%
Time: 41.5s
Precision: binary64
Cost: 13568

?

\[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
\[\left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right) \]
(FPCore (a b angle)
 :precision binary64
 (*
  (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0))))
  (cos (* PI (/ angle 180.0)))))
(FPCore (a b angle)
 :precision binary64
 (* (* (sin (* angle (* PI 0.011111111111111112))) (+ b a)) (- b a)))
double code(double a, double b, double angle) {
	return ((2.0 * (pow(b, 2.0) - pow(a, 2.0))) * sin((((double) M_PI) * (angle / 180.0)))) * cos((((double) M_PI) * (angle / 180.0)));
}
double code(double a, double b, double angle) {
	return (sin((angle * (((double) M_PI) * 0.011111111111111112))) * (b + a)) * (b - a);
}
public static double code(double a, double b, double angle) {
	return ((2.0 * (Math.pow(b, 2.0) - Math.pow(a, 2.0))) * Math.sin((Math.PI * (angle / 180.0)))) * Math.cos((Math.PI * (angle / 180.0)));
}
public static double code(double a, double b, double angle) {
	return (Math.sin((angle * (Math.PI * 0.011111111111111112))) * (b + a)) * (b - a);
}
def code(a, b, angle):
	return ((2.0 * (math.pow(b, 2.0) - math.pow(a, 2.0))) * math.sin((math.pi * (angle / 180.0)))) * math.cos((math.pi * (angle / 180.0)))
def code(a, b, angle):
	return (math.sin((angle * (math.pi * 0.011111111111111112))) * (b + a)) * (b - a)
function code(a, b, angle)
	return Float64(Float64(Float64(2.0 * Float64((b ^ 2.0) - (a ^ 2.0))) * sin(Float64(pi * Float64(angle / 180.0)))) * cos(Float64(pi * Float64(angle / 180.0))))
end
function code(a, b, angle)
	return Float64(Float64(sin(Float64(angle * Float64(pi * 0.011111111111111112))) * Float64(b + a)) * Float64(b - a))
end
function tmp = code(a, b, angle)
	tmp = ((2.0 * ((b ^ 2.0) - (a ^ 2.0))) * sin((pi * (angle / 180.0)))) * cos((pi * (angle / 180.0)));
end
function tmp = code(a, b, angle)
	tmp = (sin((angle * (pi * 0.011111111111111112))) * (b + a)) * (b - a);
end
code[a_, b_, angle_] := N[(N[(N[(2.0 * N[(N[Power[b, 2.0], $MachinePrecision] - N[Power[a, 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Sin[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * N[Cos[N[(Pi * N[(angle / 180.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
code[a_, b_, angle_] := N[(N[(N[Sin[N[(angle * N[(Pi * 0.011111111111111112), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[(b + a), $MachinePrecision]), $MachinePrecision] * N[(b - a), $MachinePrecision]), $MachinePrecision]
\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)
\left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation?

  1. Initial program 35.9%

    \[\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]
  2. Simplified35.9%

    \[\leadsto \color{blue}{\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]
    Step-by-step derivation

    [Start]35.9

    \[ \left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\pi \cdot \frac{angle}{180}\right)\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right) \]

    associate-*l* [=>]35.9

    \[ \color{blue}{\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right)} \]

    unpow2 [=>]35.9

    \[ \left(2 \cdot \left(\color{blue}{b \cdot b} - {a}^{2}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]

    unpow2 [=>]35.9

    \[ \left(2 \cdot \left(b \cdot b - \color{blue}{a \cdot a}\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]
  3. Applied egg-rr35.7%

    \[\leadsto \color{blue}{\frac{\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \left(0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}{2}} \]
    Step-by-step derivation

    [Start]35.9

    \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180}\right) \cdot \cos \left(\pi \cdot \frac{angle}{180}\right)\right) \]

    sin-cos-mult [=>]35.9

    \[ \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \color{blue}{\frac{\sin \left(\pi \cdot \frac{angle}{180} - \pi \cdot \frac{angle}{180}\right) + \sin \left(\pi \cdot \frac{angle}{180} + \pi \cdot \frac{angle}{180}\right)}{2}} \]

    associate-*r/ [=>]35.9

    \[ \color{blue}{\frac{\left(2 \cdot \left(b \cdot b - a \cdot a\right)\right) \cdot \left(\sin \left(\pi \cdot \frac{angle}{180} - \pi \cdot \frac{angle}{180}\right) + \sin \left(\pi \cdot \frac{angle}{180} + \pi \cdot \frac{angle}{180}\right)\right)}{2}} \]
  4. Simplified36.2%

    \[\leadsto \color{blue}{\frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{1}{b \cdot b - a \cdot a}}} \]
    Step-by-step derivation

    [Start]35.7

    \[ \frac{\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \left(0 + \sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)\right)}{2} \]

    +-lft-identity [=>]35.7

    \[ \frac{\left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right) \cdot \color{blue}{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}}{2} \]

    *-commutative [=>]35.7

    \[ \frac{\color{blue}{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right) \cdot \left(2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)\right)}}{2} \]

    associate-/l* [=>]35.7

    \[ \color{blue}{\frac{\sin \left(2 \cdot \left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right)\right)}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)}}} \]

    *-commutative [=>]35.7

    \[ \frac{\sin \color{blue}{\left(\left(\pi \cdot \left(angle \cdot 0.005555555555555556\right)\right) \cdot 2\right)}}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)}} \]

    associate-*r* [=>]36.2

    \[ \frac{\sin \left(\color{blue}{\left(\left(\pi \cdot angle\right) \cdot 0.005555555555555556\right)} \cdot 2\right)}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)}} \]

    *-commutative [<=]36.2

    \[ \frac{\sin \left(\left(\color{blue}{\left(angle \cdot \pi\right)} \cdot 0.005555555555555556\right) \cdot 2\right)}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)}} \]

    associate-*l* [=>]36.2

    \[ \frac{\sin \color{blue}{\left(\left(angle \cdot \pi\right) \cdot \left(0.005555555555555556 \cdot 2\right)\right)}}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)}} \]

    metadata-eval [=>]36.2

    \[ \frac{\sin \left(\left(angle \cdot \pi\right) \cdot \color{blue}{0.011111111111111112}\right)}{\frac{2}{2 \cdot \mathsf{fma}\left(b, b, -a \cdot a\right)}} \]

    associate-/r* [=>]36.2

    \[ \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\color{blue}{\frac{\frac{2}{2}}{\mathsf{fma}\left(b, b, -a \cdot a\right)}}} \]

    metadata-eval [=>]36.2

    \[ \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{\color{blue}{1}}{\mathsf{fma}\left(b, b, -a \cdot a\right)}} \]

    fma-neg [<=]36.2

    \[ \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{1}{\color{blue}{b \cdot b - a \cdot a}}} \]
  5. Applied egg-rr43.9%

    \[\leadsto \color{blue}{\left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \]
    Step-by-step derivation

    [Start]36.2

    \[ \frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{\frac{1}{b \cdot b - a \cdot a}} \]

    associate-/r/ [=>]36.2

    \[ \color{blue}{\frac{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)}{1} \cdot \left(b \cdot b - a \cdot a\right)} \]

    /-rgt-identity [=>]36.2

    \[ \color{blue}{\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right)} \cdot \left(b \cdot b - a \cdot a\right) \]

    difference-of-squares [=>]36.2

    \[ \sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \color{blue}{\left(\left(b + a\right) \cdot \left(b - a\right)\right)} \]

    associate-*r* [=>]44.0

    \[ \color{blue}{\left(\sin \left(\left(angle \cdot \pi\right) \cdot 0.011111111111111112\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right)} \]

    associate-*l* [=>]43.9

    \[ \left(\sin \color{blue}{\left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right)} \cdot \left(b + a\right)\right) \cdot \left(b - a\right) \]
  6. Final simplification43.9%

    \[\leadsto \left(\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(b + a\right)\right) \cdot \left(b - a\right) \]

Alternatives

Alternative 1
Accuracy43.3%
Cost13704
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.00012:\\ \;\;\;\;\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(a \cdot \left(-a\right)\right)\\ \mathbf{elif}\;angle \leq 7.5 \cdot 10^{-6}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(b \cdot \sin \left(\pi \cdot \left(angle \cdot 0.011111111111111112\right)\right)\right)\\ \end{array} \]
Alternative 2
Accuracy43.3%
Cost13704
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.000125:\\ \;\;\;\;\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(a \cdot \left(-a\right)\right)\\ \mathbf{elif}\;angle \leq 7.5 \cdot 10^{-6}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 3
Accuracy43.1%
Cost13577
\[\begin{array}{l} \mathbf{if}\;angle \leq -1.02 \cdot 10^{+31} \lor \neg \left(angle \leq 7.5 \cdot 10^{-6}\right):\\ \;\;\;\;b \cdot \left(b \cdot \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \end{array} \]
Alternative 4
Accuracy43.1%
Cost13576
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{if}\;angle \leq -1.05 \cdot 10^{+31}:\\ \;\;\;\;b \cdot \left(b \cdot t_0\right)\\ \mathbf{elif}\;angle \leq 7.5 \cdot 10^{-6}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(b \cdot b\right)\\ \end{array} \]
Alternative 5
Accuracy42.9%
Cost13576
\[\begin{array}{l} t_0 := \sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right)\\ \mathbf{if}\;angle \leq -6 \cdot 10^{-19}:\\ \;\;\;\;a \cdot \left(\left(-a\right) \cdot t_0\right)\\ \mathbf{elif}\;angle \leq 7.5 \cdot 10^{-6}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;t_0 \cdot \left(b \cdot b\right)\\ \end{array} \]
Alternative 6
Accuracy43.3%
Cost13576
\[\begin{array}{l} \mathbf{if}\;angle \leq -0.000125:\\ \;\;\;\;\sin \left(angle \cdot \left(\pi \cdot 0.011111111111111112\right)\right) \cdot \left(a \cdot \left(-a\right)\right)\\ \mathbf{elif}\;angle \leq 7.5 \cdot 10^{-6}:\\ \;\;\;\;\left(b - a\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(0.011111111111111112 \cdot \left(angle \cdot \pi\right)\right) \cdot \left(b \cdot b\right)\\ \end{array} \]
Alternative 7
Accuracy34.7%
Cost7433
\[\begin{array}{l} \mathbf{if}\;a \leq -6.5 \cdot 10^{-43} \lor \neg \left(a \leq 3.8 \cdot 10^{+149}\right):\\ \;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(a \cdot \left(-\pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\left(angle \cdot \pi\right) \cdot \left(b \cdot b - a \cdot a\right)\right)\\ \end{array} \]
Alternative 8
Accuracy33.6%
Cost7241
\[\begin{array}{l} \mathbf{if}\;a \leq -2 \cdot 10^{-56} \lor \neg \left(a \leq 5.3 \cdot 10^{-67}\right):\\ \;\;\;\;0.011111111111111112 \cdot \left(a \cdot \left(angle \cdot \left(a \cdot \left(-\pi\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right)\\ \end{array} \]
Alternative 9
Accuracy32.3%
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -1.15 \cdot 10^{-70}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right)\\ \mathbf{elif}\;b \leq 1.35 \cdot 10^{+26}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot \left(\pi \cdot a\right)\right) \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \left(angle \cdot \pi\right)\right)\right)\\ \end{array} \]
Alternative 10
Accuracy32.3%
Cost7176
\[\begin{array}{l} \mathbf{if}\;b \leq -1.15 \cdot 10^{-70}:\\ \;\;\;\;0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right)\\ \mathbf{elif}\;b \leq 1.45 \cdot 10^{+26}:\\ \;\;\;\;angle \cdot \left(\left(a \cdot \left(\pi \cdot a\right)\right) \cdot -0.011111111111111112\right)\\ \mathbf{else}:\\ \;\;\;\;b \cdot \left(\left(angle \cdot \pi\right) \cdot \left(0.011111111111111112 \cdot b\right)\right)\\ \end{array} \]
Alternative 11
Accuracy39.6%
Cost7168
\[0.011111111111111112 \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot \left(b - a\right)\right)\right) \]
Alternative 12
Accuracy39.7%
Cost7168
\[\left(b - a\right) \cdot \left(\left(\pi \cdot \left(b + a\right)\right) \cdot \left(angle \cdot 0.011111111111111112\right)\right) \]
Alternative 13
Accuracy21.1%
Cost6912
\[0.011111111111111112 \cdot \left(angle \cdot \left(b \cdot \left(\pi \cdot b\right)\right)\right) \]
Alternative 14
Accuracy25.0%
Cost6912
\[0.011111111111111112 \cdot \left(b \cdot \left(b \cdot \left(angle \cdot \pi\right)\right)\right) \]
Alternative 15
Accuracy25.0%
Cost6912
\[0.011111111111111112 \cdot \left(\pi \cdot \left(b \cdot \left(angle \cdot b\right)\right)\right) \]
Alternative 16
Accuracy13.0%
Cost320
\[0.011111111111111112 \cdot \left(angle \cdot 0\right) \]

Error

Reproduce?

herbie shell --seed 2023157 
(FPCore (a b angle)
  :name "ab-angle->ABCF B"
  :precision binary64
  (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* PI (/ angle 180.0)))) (cos (* PI (/ angle 180.0)))))