Average Error: 58.2 → 7.7
Time: 2.3m
Precision: 64
Internal Precision: 2368
$\frac{\sqrt{y1 \cdot y1 + x1 \cdot x1} \cdot \sin \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(\pi - 2 \cdot \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)\right)}$
$\begin{array}{l} \mathbf{if}\;x1 \le -7.560066695063207 \cdot 10^{+105}:\\ \;\;\;\;\frac{\left(-x1\right) \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right) \cdot 2\right)}\\ \mathbf{if}\;x1 \le 1.4695493763731748 \cdot 10^{+127}:\\ \;\;\;\;\frac{\sqrt{x1 \cdot x1 + y1 \cdot y1} \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\left(\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot x1}{\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right) \cdot 2\right)}\\ \end{array}$

# Try it out

Results

 In Out
Enter valid numbers for all inputs

# Derivation

1. Split input into 3 regimes
2. ## if x1 < -7.560066695063207e+105

1. Initial program 58.7

$\frac{\sqrt{y1 \cdot y1 + x1 \cdot x1} \cdot \sin \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(\pi - 2 \cdot \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)\right)}$
2. Applied simplify58.6

$\leadsto \color{blue}{\frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\sin \left(\pi - 2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
3. Using strategy rm
4. Applied sub-neg58.6

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\sin \color{blue}{\left(\pi + \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)\right)}}$
5. Applied sin-sum58.6

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\color{blue}{\sin \pi \cdot \cos \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right) + \cos \pi \cdot \sin \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
6. Applied simplify48.2

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\color{blue}{0} + \cos \pi \cdot \sin \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}$
7. Applied simplify48.2

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{0 + \color{blue}{\sin \left(2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
8. Taylor expanded around -inf 5.4

$\leadsto \color{blue}{-1 \cdot \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot x1}{\sin \left(2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
9. Applied simplify5.4

$\leadsto \color{blue}{\frac{\left(-x1\right) \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$

## if -7.560066695063207e+105 < x1 < 1.4695493763731748e+127

1. Initial program 57.9

$\frac{\sqrt{y1 \cdot y1 + x1 \cdot x1} \cdot \sin \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(\pi - 2 \cdot \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)\right)}$
2. Applied simplify57.6

$\leadsto \color{blue}{\frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\sin \left(\pi - 2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
3. Using strategy rm
4. Applied sub-neg57.6

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\sin \color{blue}{\left(\pi + \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)\right)}}$
5. Applied sin-sum57.6

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\color{blue}{\sin \pi \cdot \cos \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right) + \cos \pi \cdot \sin \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
6. Applied simplify9.4

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\color{blue}{0} + \cos \pi \cdot \sin \left(-2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}$
7. Applied simplify9.4

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{0 + \color{blue}{\sin \left(2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
8. Using strategy rm
9. Applied sin-29.4

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{0 + \color{blue}{2 \cdot \left(\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)\right)}}$

## if 1.4695493763731748e+127 < x1

1. Initial program 58.9

$\frac{\sqrt{y1 \cdot y1 + x1 \cdot x1} \cdot \sin \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(\pi - 2 \cdot \left(\frac{\pi}{2} - \tan^{-1} \left(\frac{x1}{y1}\right)\right)\right)}$
2. Applied simplify58.9

$\leadsto \color{blue}{\frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \sqrt{y1 \cdot y1 + x1 \cdot x1}}{\sin \left(\pi - 2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}}$
3. Taylor expanded around 0 55.7

$\leadsto \frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \color{blue}{x1}}{\sin \left(\pi - 2 \cdot \tan^{-1} \left(\frac{x1}{y1}\right)\right)}$
4. Applied simplify4.6

$\leadsto \color{blue}{\frac{x1 \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right) \cdot 2\right)}}$
3. Recombined 3 regimes into one program.
4. Applied simplify7.7

$\leadsto \color{blue}{\begin{array}{l} \mathbf{if}\;x1 \le -7.560066695063207 \cdot 10^{+105}:\\ \;\;\;\;\frac{\left(-x1\right) \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right) \cdot 2\right)}\\ \mathbf{if}\;x1 \le 1.4695493763731748 \cdot 10^{+127}:\\ \;\;\;\;\frac{\sqrt{x1 \cdot x1 + y1 \cdot y1} \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)}{\left(\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot \cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right)\right) \cdot 2}\\ \mathbf{else}:\\ \;\;\;\;\frac{\cos \left(\tan^{-1} \left(\frac{x1}{y1}\right)\right) \cdot x1}{\sin \left(\tan^{-1} \left(\frac{x1}{y1}\right) \cdot 2\right)}\\ \end{array}}$

# Runtime

Time bar (total: 2.3m)Debug log

herbie shell --seed '#(2775764126 3555076145 3898259844 1891440260 2599947619 1948460636)'
(FPCore (y1 x1)
:name "(sqrt(y1 * y1 + x1 * x1) * sin((PI/2) - atan(x1 / y1))) / (sin(PI - 2 * ((PI/2) - atan(x1 / y1))))"
(/ (* (sqrt (+ (* y1 y1) (* x1 x1))) (sin (- (/ PI 2) (atan (/ x1 y1))))) (sin (- PI (* 2 (- (/ PI 2) (atan (/ x1 y1))))))))