a from scale-rotated-ellipse

Percentage Accurate: 2.8% → 62.1%
Time: 30.3s
Alternatives: 8
Speedup: 484.7×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ t_1 := \sin t\_0\\ t_2 := \cos t\_0\\ t_3 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}\\ t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\\ t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\ t_6 := \frac{4 \cdot t\_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\ \frac{-\sqrt{\left(\left(2 \cdot t\_6\right) \cdot t\_5\right) \cdot \left(\left(t\_4 + t\_3\right) + \sqrt{{\left(t\_4 - t\_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t\_6} \end{array} \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI)))
        (t_1 (sin t_0))
        (t_2 (cos t_0))
        (t_3
         (/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale))
        (t_4
         (/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
        (t_5 (* (* b a) (* b (- a))))
        (t_6 (/ (* 4.0 t_5) (pow (* x-scale y-scale) 2.0))))
   (/
    (-
     (sqrt
      (*
       (* (* 2.0 t_6) t_5)
       (+
        (+ t_4 t_3)
        (sqrt
         (+
          (pow (- t_4 t_3) 2.0)
          (pow
           (/
            (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
            y-scale)
           2.0)))))))
    t_6)))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\\
t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\
t_6 := \frac{4 \cdot t\_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\
\frac{-\sqrt{\left(\left(2 \cdot t\_6\right) \cdot t\_5\right) \cdot \left(\left(t\_4 + t\_3\right) + \sqrt{{\left(t\_4 - t\_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t\_6}
\end{array}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 8 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 2.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\ t_1 := \sin t\_0\\ t_2 := \cos t\_0\\ t_3 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}\\ t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\\ t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\ t_6 := \frac{4 \cdot t\_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\ \frac{-\sqrt{\left(\left(2 \cdot t\_6\right) \cdot t\_5\right) \cdot \left(\left(t\_4 + t\_3\right) + \sqrt{{\left(t\_4 - t\_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t\_6} \end{array} \end{array} \]
(FPCore (a b angle x-scale y-scale)
 :precision binary64
 (let* ((t_0 (* (/ angle 180.0) (PI)))
        (t_1 (sin t_0))
        (t_2 (cos t_0))
        (t_3
         (/ (/ (+ (pow (* a t_2) 2.0) (pow (* b t_1) 2.0)) y-scale) y-scale))
        (t_4
         (/ (/ (+ (pow (* a t_1) 2.0) (pow (* b t_2) 2.0)) x-scale) x-scale))
        (t_5 (* (* b a) (* b (- a))))
        (t_6 (/ (* 4.0 t_5) (pow (* x-scale y-scale) 2.0))))
   (/
    (-
     (sqrt
      (*
       (* (* 2.0 t_6) t_5)
       (+
        (+ t_4 t_3)
        (sqrt
         (+
          (pow (- t_4 t_3) 2.0)
          (pow
           (/
            (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) t_1) t_2) x-scale)
            y-scale)
           2.0)))))))
    t_6)))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \frac{angle}{180} \cdot \mathsf{PI}\left(\right)\\
t_1 := \sin t\_0\\
t_2 := \cos t\_0\\
t_3 := \frac{\frac{{\left(a \cdot t\_2\right)}^{2} + {\left(b \cdot t\_1\right)}^{2}}{y-scale}}{y-scale}\\
t_4 := \frac{\frac{{\left(a \cdot t\_1\right)}^{2} + {\left(b \cdot t\_2\right)}^{2}}{x-scale}}{x-scale}\\
t_5 := \left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\\
t_6 := \frac{4 \cdot t\_5}{{\left(x-scale \cdot y-scale\right)}^{2}}\\
\frac{-\sqrt{\left(\left(2 \cdot t\_6\right) \cdot t\_5\right) \cdot \left(\left(t\_4 + t\_3\right) + \sqrt{{\left(t\_4 - t\_3\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot t\_1\right) \cdot t\_2}{x-scale}}{y-scale}\right)}^{2}}\right)}}{t\_6}
\end{array}
\end{array}

Alternative 1: 62.1% accurate, 7.7× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ \begin{array}{l} t_0 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\ t_1 := \sin t\_0\\ \mathbf{if}\;x-scale\_m \leq 6.8 \cdot 10^{+48}:\\ \;\;\;\;\left(0.25 \cdot \left(\left(y-scale\_m \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a \cdot t\_1, b \cdot \cos t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x-scale\_m \cdot 0.25\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, t\_1 \cdot b\right)\\ \end{array} \end{array} \]
y-scale_m = (fabs.f64 y-scale)
x-scale_m = (fabs.f64 x-scale)
(FPCore (a b angle x-scale_m y-scale_m)
 :precision binary64
 (let* ((t_0 (* 0.005555555555555556 (* angle (PI)))) (t_1 (sin t_0)))
   (if (<= x-scale_m 6.8e+48)
     (*
      (* 0.25 (* (* y-scale_m (sqrt 2.0)) (sqrt 8.0)))
      (hypot (* a t_1) (* b (cos t_0))))
     (*
      (* (* x-scale_m 0.25) (* (sqrt 2.0) (sqrt 8.0)))
      (hypot a (* t_1 b))))))
\begin{array}{l}
y-scale_m = \left|y-scale\right|
\\
x-scale_m = \left|x-scale\right|

\\
\begin{array}{l}
t_0 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\
t_1 := \sin t\_0\\
\mathbf{if}\;x-scale\_m \leq 6.8 \cdot 10^{+48}:\\
\;\;\;\;\left(0.25 \cdot \left(\left(y-scale\_m \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a \cdot t\_1, b \cdot \cos t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\left(\left(x-scale\_m \cdot 0.25\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, t\_1 \cdot b\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x-scale < 6.8000000000000006e48

    1. Initial program 3.4%

      \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. Add Preprocessing
    3. Taylor expanded in y-scale around inf

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right)} \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      4. associate-*r*N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot y-scale\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot y-scale\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      7. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      8. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + 2 \cdot \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}} \]
    5. Applied rewrites9.2%

      \[\leadsto \color{blue}{\left(0.25 \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(a \cdot a, \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale}, \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(b \cdot b\right)}{x-scale \cdot x-scale}\right)}} \]
    6. Taylor expanded in y-scale around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}\right)} \]
    7. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)} \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      4. associate-*r*N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)}\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)}\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\color{blue}{\left(x-scale \cdot y-scale\right)} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      7. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)}\right)\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      8. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      9. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right)\right) \cdot \sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}} \]
      10. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \color{blue}{\sqrt{\frac{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} + \frac{{b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}}} \]
    8. Applied rewrites9.2%

      \[\leadsto \color{blue}{\left(0.25 \cdot \left(\left(x-scale \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\mathsf{fma}\left(b \cdot b, \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale}, \frac{\left(a \cdot a\right) \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale}\right)}} \]
    9. Taylor expanded in x-scale around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}\right)} \]
    10. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
      4. associate-*r*N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
      7. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
      8. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{{a}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
    11. Applied rewrites25.9%

      \[\leadsto \color{blue}{\left(0.25 \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]

    if 6.8000000000000006e48 < x-scale

    1. Initial program 3.5%

      \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
    2. Add Preprocessing
    3. Taylor expanded in y-scale around 0

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
    4. Step-by-step derivation
      1. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
      3. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
      4. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
      5. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
      6. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
      7. distribute-lft-outN/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
      8. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
    5. Applied rewrites56.4%

      \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
    6. Applied rewrites64.7%

      \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right)\right)}} \]
    7. Taylor expanded in angle around 0

      \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
    8. Step-by-step derivation
      1. Applied rewrites64.7%

        \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
      2. Taylor expanded in x-scale around 0

        \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}}\right)} \]
      3. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}}} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}}} \]
        3. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
        4. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot x-scale\right)} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
        7. lower-sqrt.f64N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
        8. lower-sqrt.f64N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
        9. +-commutativeN/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{{a}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}} \]
        10. unpow2N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{a \cdot a} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
        11. unpow2N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{a \cdot a + \color{blue}{\left(b \cdot b\right)} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
        12. unpow2N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{a \cdot a + \left(b \cdot b\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}} \]
        13. unswap-sqrN/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{a \cdot a + \color{blue}{\left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}} \]
        14. lower-hypot.f64N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\mathsf{hypot}\left(a, b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
      4. Applied rewrites74.2%

        \[\leadsto \color{blue}{\left(\left(0.25 \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
    9. Recombined 2 regimes into one program.
    10. Final simplification37.2%

      \[\leadsto \begin{array}{l} \mathbf{if}\;x-scale \leq 6.8 \cdot 10^{+48}:\\ \;\;\;\;\left(0.25 \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right), b \cdot \cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x-scale \cdot 0.25\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)\\ \end{array} \]
    11. Add Preprocessing

    Alternative 2: 46.9% accurate, 11.1× speedup?

    \[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ \begin{array}{l} \mathbf{if}\;x-scale\_m \leq 3.3 \cdot 10^{-56}:\\ \;\;\;\;y-scale\_m \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x-scale\_m \cdot 0.25\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)\\ \end{array} \end{array} \]
    y-scale_m = (fabs.f64 y-scale)
    x-scale_m = (fabs.f64 x-scale)
    (FPCore (a b angle x-scale_m y-scale_m)
     :precision binary64
     (if (<= x-scale_m 3.3e-56)
       (* y-scale_m b)
       (*
        (* (* x-scale_m 0.25) (* (sqrt 2.0) (sqrt 8.0)))
        (hypot a (* (sin (* 0.005555555555555556 (* angle (PI)))) b)))))
    \begin{array}{l}
    y-scale_m = \left|y-scale\right|
    \\
    x-scale_m = \left|x-scale\right|
    
    \\
    \begin{array}{l}
    \mathbf{if}\;x-scale\_m \leq 3.3 \cdot 10^{-56}:\\
    \;\;\;\;y-scale\_m \cdot b\\
    
    \mathbf{else}:\\
    \;\;\;\;\left(\left(x-scale\_m \cdot 0.25\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if x-scale < 3.29999999999999984e-56

      1. Initial program 3.2%

        \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      2. Add Preprocessing
      3. Taylor expanded in angle around 0

        \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(b \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
        4. associate-*r*N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
        5. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
        6. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right) \]
        7. lower-sqrt.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
        8. lower-sqrt.f6418.3

          \[\leadsto \left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
      5. Applied rewrites18.3%

        \[\leadsto \color{blue}{\left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
      6. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right) \]
        2. lift-sqrt.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
        3. lift-sqrt.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
        4. associate-*l*N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
        5. lift-sqrt.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
        6. lift-sqrt.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
        7. sqrt-unprodN/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{\sqrt{2 \cdot 8}}\right) \]
        8. metadata-evalN/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \sqrt{\color{blue}{16}}\right) \]
        9. metadata-evalN/A

          \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{4}\right) \]
        10. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
        11. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
        12. lower-*.f6418.3

          \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
      7. Applied rewrites18.3%

        \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right) \cdot 4} \]
      8. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \cdot 4 \]
        2. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
        3. metadata-evalN/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\sqrt{16}} \]
        4. metadata-evalN/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \sqrt{\color{blue}{2 \cdot 8}} \]
        5. sqrt-unprodN/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
        6. lift-sqrt.f64N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \]
        7. lift-sqrt.f64N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \]
        8. lift-*.f64N/A

          \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
        9. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
        10. lift-*.f64N/A

          \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
        11. lift-*.f64N/A

          \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \]
        12. associate-*l*N/A

          \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\frac{1}{4} \cdot \left(b \cdot y-scale\right)\right)} \]
        13. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right)} \]
        14. lift-*.f64N/A

          \[\leadsto \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
        15. lift-sqrt.f64N/A

          \[\leadsto \left(\left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
        16. lift-sqrt.f64N/A

          \[\leadsto \left(\left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
        17. sqrt-unprodN/A

          \[\leadsto \left(\color{blue}{\sqrt{2 \cdot 8}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
        18. metadata-evalN/A

          \[\leadsto \left(\sqrt{\color{blue}{16}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
        19. metadata-evalN/A

          \[\leadsto \left(\color{blue}{4} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
        20. metadata-evalN/A

          \[\leadsto \color{blue}{1} \cdot \left(b \cdot y-scale\right) \]
        21. *-lft-identityN/A

          \[\leadsto \color{blue}{b \cdot y-scale} \]
        22. *-commutativeN/A

          \[\leadsto \color{blue}{y-scale \cdot b} \]
        23. lower-*.f6418.3

          \[\leadsto \color{blue}{y-scale \cdot b} \]
      9. Applied rewrites18.3%

        \[\leadsto \color{blue}{y-scale \cdot b} \]

      if 3.29999999999999984e-56 < x-scale

      1. Initial program 3.8%

        \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
      2. Add Preprocessing
      3. Taylor expanded in y-scale around 0

        \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
      4. Step-by-step derivation
        1. associate-*r*N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
        3. lower-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
        4. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
        5. lower-sqrt.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
        6. lower-sqrt.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
        7. distribute-lft-outN/A

          \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
        8. lower-*.f64N/A

          \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
      5. Applied rewrites46.8%

        \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
      6. Applied rewrites51.5%

        \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right)\right)}} \]
      7. Taylor expanded in angle around 0

        \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
      8. Step-by-step derivation
        1. Applied rewrites51.5%

          \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
        2. Taylor expanded in x-scale around 0

          \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}}\right)} \]
        3. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}}} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}}} \]
          3. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
          4. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
          5. lower-*.f64N/A

            \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot x-scale\right)} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
          6. lower-*.f64N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
          7. lower-sqrt.f64N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
          8. lower-sqrt.f64N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{{b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {a}^{2}} \]
          9. +-commutativeN/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{{a}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}} \]
          10. unpow2N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{a \cdot a} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
          11. unpow2N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{a \cdot a + \color{blue}{\left(b \cdot b\right)} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}} \]
          12. unpow2N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{a \cdot a + \left(b \cdot b\right) \cdot \color{blue}{\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}} \]
          13. unswap-sqrN/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \sqrt{a \cdot a + \color{blue}{\left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right) \cdot \left(b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)}} \]
          14. lower-hypot.f64N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\mathsf{hypot}\left(a, b \cdot \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
        4. Applied rewrites60.3%

          \[\leadsto \color{blue}{\left(\left(0.25 \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, b \cdot \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)} \]
      9. Recombined 2 regimes into one program.
      10. Final simplification32.4%

        \[\leadsto \begin{array}{l} \mathbf{if}\;x-scale \leq 3.3 \cdot 10^{-56}:\\ \;\;\;\;y-scale \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(\left(x-scale \cdot 0.25\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \cdot \mathsf{hypot}\left(a, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b\right)\\ \end{array} \]
      11. Add Preprocessing

      Alternative 3: 29.1% accurate, 14.5× speedup?

      \[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ \begin{array}{l} t_0 := \sqrt{2} \cdot \sqrt{8}\\ t_1 := \mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}{a}, 0.25 \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot a\right)\right)\right)\\ t_2 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\ \mathbf{if}\;x-scale\_m \leq 1.65 \cdot 10^{-98}:\\ \;\;\;\;y-scale\_m \cdot b\\ \mathbf{elif}\;x-scale\_m \leq 7.6 \cdot 10^{+39}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;x-scale\_m \leq 3.6 \cdot 10^{+154}:\\ \;\;\;\;\left(0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(t\_2 \cdot b, \sin t\_2 \cdot b, a \cdot a\right)}\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
      y-scale_m = (fabs.f64 y-scale)
      x-scale_m = (fabs.f64 x-scale)
      (FPCore (a b angle x-scale_m y-scale_m)
       :precision binary64
       (let* ((t_0 (* (sqrt 2.0) (sqrt 8.0)))
              (t_1
               (fma
                3.858024691358025e-6
                (/
                 (* (* angle angle) (* (* b b) (* t_0 (* x-scale_m (* (PI) (PI))))))
                 a)
                (* 0.25 (* t_0 (* x-scale_m a)))))
              (t_2 (* 0.005555555555555556 (* angle (PI)))))
         (if (<= x-scale_m 1.65e-98)
           (* y-scale_m b)
           (if (<= x-scale_m 7.6e+39)
             t_1
             (if (<= x-scale_m 3.6e+154)
               (*
                (* 0.25 (* x-scale_m (sqrt 8.0)))
                (sqrt (* 2.0 (fma (* t_2 b) (* (sin t_2) b) (* a a)))))
               t_1)))))
      \begin{array}{l}
      y-scale_m = \left|y-scale\right|
      \\
      x-scale_m = \left|x-scale\right|
      
      \\
      \begin{array}{l}
      t_0 := \sqrt{2} \cdot \sqrt{8}\\
      t_1 := \mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}{a}, 0.25 \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot a\right)\right)\right)\\
      t_2 := 0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\\
      \mathbf{if}\;x-scale\_m \leq 1.65 \cdot 10^{-98}:\\
      \;\;\;\;y-scale\_m \cdot b\\
      
      \mathbf{elif}\;x-scale\_m \leq 7.6 \cdot 10^{+39}:\\
      \;\;\;\;t\_1\\
      
      \mathbf{elif}\;x-scale\_m \leq 3.6 \cdot 10^{+154}:\\
      \;\;\;\;\left(0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(t\_2 \cdot b, \sin t\_2 \cdot b, a \cdot a\right)}\\
      
      \mathbf{else}:\\
      \;\;\;\;t\_1\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if x-scale < 1.6500000000000001e-98

        1. Initial program 2.8%

          \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
        2. Add Preprocessing
        3. Taylor expanded in angle around 0

          \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(b \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
        4. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
          4. associate-*r*N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
          5. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
          6. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right) \]
          7. lower-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
          8. lower-sqrt.f6418.8

            \[\leadsto \left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
        5. Applied rewrites18.8%

          \[\leadsto \color{blue}{\left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
        6. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right) \]
          2. lift-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
          3. lift-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
          4. associate-*l*N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
          5. lift-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
          6. lift-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
          7. sqrt-unprodN/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{\sqrt{2 \cdot 8}}\right) \]
          8. metadata-evalN/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \sqrt{\color{blue}{16}}\right) \]
          9. metadata-evalN/A

            \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{4}\right) \]
          10. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
          11. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
          12. lower-*.f6418.9

            \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
        7. Applied rewrites18.9%

          \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right) \cdot 4} \]
        8. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \cdot 4 \]
          2. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
          3. metadata-evalN/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\sqrt{16}} \]
          4. metadata-evalN/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \sqrt{\color{blue}{2 \cdot 8}} \]
          5. sqrt-unprodN/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
          6. lift-sqrt.f64N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \]
          7. lift-sqrt.f64N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \]
          8. lift-*.f64N/A

            \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
          9. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
          10. lift-*.f64N/A

            \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
          11. lift-*.f64N/A

            \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \]
          12. associate-*l*N/A

            \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\frac{1}{4} \cdot \left(b \cdot y-scale\right)\right)} \]
          13. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right)} \]
          14. lift-*.f64N/A

            \[\leadsto \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
          15. lift-sqrt.f64N/A

            \[\leadsto \left(\left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
          16. lift-sqrt.f64N/A

            \[\leadsto \left(\left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
          17. sqrt-unprodN/A

            \[\leadsto \left(\color{blue}{\sqrt{2 \cdot 8}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
          18. metadata-evalN/A

            \[\leadsto \left(\sqrt{\color{blue}{16}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
          19. metadata-evalN/A

            \[\leadsto \left(\color{blue}{4} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
          20. metadata-evalN/A

            \[\leadsto \color{blue}{1} \cdot \left(b \cdot y-scale\right) \]
          21. *-lft-identityN/A

            \[\leadsto \color{blue}{b \cdot y-scale} \]
          22. *-commutativeN/A

            \[\leadsto \color{blue}{y-scale \cdot b} \]
          23. lower-*.f6418.9

            \[\leadsto \color{blue}{y-scale \cdot b} \]
        9. Applied rewrites18.9%

          \[\leadsto \color{blue}{y-scale \cdot b} \]

        if 1.6500000000000001e-98 < x-scale < 7.5999999999999996e39 or 3.6000000000000001e154 < x-scale

        1. Initial program 3.3%

          \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
        2. Add Preprocessing
        3. Taylor expanded in y-scale around 0

          \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
        4. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
          2. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
          3. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
          4. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
          5. lower-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
          6. lower-sqrt.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
          7. distribute-lft-outN/A

            \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
          8. lower-*.f64N/A

            \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
        5. Applied rewrites47.0%

          \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
        6. Applied rewrites45.9%

          \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right)\right)}} \]
        7. Taylor expanded in angle around 0

          \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
        8. Step-by-step derivation
          1. Applied rewrites45.9%

            \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
          2. Taylor expanded in angle around 0

            \[\leadsto \color{blue}{\frac{1}{259200} \cdot \frac{{angle}^{2} \cdot \left({b}^{2} \cdot \left(x-scale \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)}{a} + \frac{1}{4} \cdot \left(a \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
          3. Step-by-step derivation
            1. lower-fma.f64N/A

              \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{259200}, \frac{{angle}^{2} \cdot \left({b}^{2} \cdot \left(x-scale \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)}{a}, \frac{1}{4} \cdot \left(a \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)} \]
          4. Applied rewrites33.1%

            \[\leadsto \color{blue}{\mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\left(x-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)}{a}, 0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]

          if 7.5999999999999996e39 < x-scale < 3.6000000000000001e154

          1. Initial program 7.8%

            \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
          2. Add Preprocessing
          3. Taylor expanded in y-scale around 0

            \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
          4. Step-by-step derivation
            1. associate-*r*N/A

              \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
            3. lower-*.f64N/A

              \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
            4. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
            5. lower-sqrt.f64N/A

              \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
            6. lower-sqrt.f64N/A

              \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
            7. distribute-lft-outN/A

              \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
            8. lower-*.f64N/A

              \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
          5. Applied rewrites47.4%

            \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
          6. Applied rewrites58.6%

            \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right)\right)}} \]
          7. Taylor expanded in angle around 0

            \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
          8. Step-by-step derivation
            1. Applied rewrites58.6%

              \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
            2. Taylor expanded in angle around 0

              \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, 1 \cdot \left(a \cdot a\right)\right)} \]
            3. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\color{blue}{\left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, 1 \cdot \left(a \cdot a\right)\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\left(\frac{1}{180} \cdot \color{blue}{\left(angle \cdot \mathsf{PI}\left(\right)\right)}\right) \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, 1 \cdot \left(a \cdot a\right)\right)} \]
              3. lower-PI.f6457.3

                \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\left(0.005555555555555556 \cdot \left(angle \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, 1 \cdot \left(a \cdot a\right)\right)} \]
            4. Applied rewrites57.3%

              \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\color{blue}{\left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)} \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, 1 \cdot \left(a \cdot a\right)\right)} \]
          9. Recombined 3 regimes into one program.
          10. Final simplification26.8%

            \[\leadsto \begin{array}{l} \mathbf{if}\;x-scale \leq 1.65 \cdot 10^{-98}:\\ \;\;\;\;y-scale \cdot b\\ \mathbf{elif}\;x-scale \leq 7.6 \cdot 10^{+39}:\\ \;\;\;\;\mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}{a}, 0.25 \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale \cdot a\right)\right)\right)\\ \mathbf{elif}\;x-scale \leq 3.6 \cdot 10^{+154}:\\ \;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, a \cdot a\right)}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}{a}, 0.25 \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale \cdot a\right)\right)\right)\\ \end{array} \]
          11. Add Preprocessing

          Alternative 4: 25.1% accurate, 22.4× speedup?

          \[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ \begin{array}{l} t_0 := \sqrt{2} \cdot \sqrt{8}\\ \mathbf{if}\;x-scale\_m \leq 3.3 \cdot 10^{-56}:\\ \;\;\;\;y-scale\_m \cdot b\\ \mathbf{elif}\;x-scale\_m \leq 5.5 \cdot 10^{+162}:\\ \;\;\;\;\left(0.25 \cdot \left(\left(x-scale\_m \cdot a\right) \cdot \left(y-scale\_m \cdot \sqrt{8}\right)\right)\right) \cdot \frac{\sqrt{2}}{y-scale\_m}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}{a}, 0.25 \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot a\right)\right)\right)\\ \end{array} \end{array} \]
          y-scale_m = (fabs.f64 y-scale)
          x-scale_m = (fabs.f64 x-scale)
          (FPCore (a b angle x-scale_m y-scale_m)
           :precision binary64
           (let* ((t_0 (* (sqrt 2.0) (sqrt 8.0))))
             (if (<= x-scale_m 3.3e-56)
               (* y-scale_m b)
               (if (<= x-scale_m 5.5e+162)
                 (*
                  (* 0.25 (* (* x-scale_m a) (* y-scale_m (sqrt 8.0))))
                  (/ (sqrt 2.0) y-scale_m))
                 (fma
                  3.858024691358025e-6
                  (/
                   (* (* angle angle) (* (* b b) (* t_0 (* x-scale_m (* (PI) (PI))))))
                   a)
                  (* 0.25 (* t_0 (* x-scale_m a))))))))
          \begin{array}{l}
          y-scale_m = \left|y-scale\right|
          \\
          x-scale_m = \left|x-scale\right|
          
          \\
          \begin{array}{l}
          t_0 := \sqrt{2} \cdot \sqrt{8}\\
          \mathbf{if}\;x-scale\_m \leq 3.3 \cdot 10^{-56}:\\
          \;\;\;\;y-scale\_m \cdot b\\
          
          \mathbf{elif}\;x-scale\_m \leq 5.5 \cdot 10^{+162}:\\
          \;\;\;\;\left(0.25 \cdot \left(\left(x-scale\_m \cdot a\right) \cdot \left(y-scale\_m \cdot \sqrt{8}\right)\right)\right) \cdot \frac{\sqrt{2}}{y-scale\_m}\\
          
          \mathbf{else}:\\
          \;\;\;\;\mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}{a}, 0.25 \cdot \left(t\_0 \cdot \left(x-scale\_m \cdot a\right)\right)\right)\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 3 regimes
          2. if x-scale < 3.29999999999999984e-56

            1. Initial program 3.2%

              \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
            2. Add Preprocessing
            3. Taylor expanded in angle around 0

              \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(b \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
            4. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
              4. associate-*r*N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
              5. lower-*.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
              6. lower-*.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right) \]
              7. lower-sqrt.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
              8. lower-sqrt.f6418.3

                \[\leadsto \left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
            5. Applied rewrites18.3%

              \[\leadsto \color{blue}{\left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
            6. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right) \]
              2. lift-sqrt.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
              3. lift-sqrt.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
              4. associate-*l*N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
              5. lift-sqrt.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
              6. lift-sqrt.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
              7. sqrt-unprodN/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{\sqrt{2 \cdot 8}}\right) \]
              8. metadata-evalN/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \sqrt{\color{blue}{16}}\right) \]
              9. metadata-evalN/A

                \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{4}\right) \]
              10. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
              11. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
              12. lower-*.f6418.3

                \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
            7. Applied rewrites18.3%

              \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right) \cdot 4} \]
            8. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \cdot 4 \]
              2. lift-*.f64N/A

                \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
              3. metadata-evalN/A

                \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\sqrt{16}} \]
              4. metadata-evalN/A

                \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \sqrt{\color{blue}{2 \cdot 8}} \]
              5. sqrt-unprodN/A

                \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
              6. lift-sqrt.f64N/A

                \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \]
              7. lift-sqrt.f64N/A

                \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \]
              8. lift-*.f64N/A

                \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
              9. *-commutativeN/A

                \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
              10. lift-*.f64N/A

                \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
              11. lift-*.f64N/A

                \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \]
              12. associate-*l*N/A

                \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\frac{1}{4} \cdot \left(b \cdot y-scale\right)\right)} \]
              13. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right)} \]
              14. lift-*.f64N/A

                \[\leadsto \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
              15. lift-sqrt.f64N/A

                \[\leadsto \left(\left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
              16. lift-sqrt.f64N/A

                \[\leadsto \left(\left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
              17. sqrt-unprodN/A

                \[\leadsto \left(\color{blue}{\sqrt{2 \cdot 8}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
              18. metadata-evalN/A

                \[\leadsto \left(\sqrt{\color{blue}{16}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
              19. metadata-evalN/A

                \[\leadsto \left(\color{blue}{4} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
              20. metadata-evalN/A

                \[\leadsto \color{blue}{1} \cdot \left(b \cdot y-scale\right) \]
              21. *-lft-identityN/A

                \[\leadsto \color{blue}{b \cdot y-scale} \]
              22. *-commutativeN/A

                \[\leadsto \color{blue}{y-scale \cdot b} \]
              23. lower-*.f6418.3

                \[\leadsto \color{blue}{y-scale \cdot b} \]
            9. Applied rewrites18.3%

              \[\leadsto \color{blue}{y-scale \cdot b} \]

            if 3.29999999999999984e-56 < x-scale < 5.49999999999999966e162

            1. Initial program 6.1%

              \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
            2. Add Preprocessing
            3. Taylor expanded in a around inf

              \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(a \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\sqrt{4 \cdot \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2} \cdot {y-scale}^{2}} + {\left(\frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}^{2}} + \left(\frac{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}} + \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}}\right)}\right)} \]
            4. Applied rewrites12.9%

              \[\leadsto \color{blue}{\left(0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \sqrt{\sqrt{\mathsf{fma}\left(4, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{\left(x-scale \cdot x-scale\right) \cdot \left(y-scale \cdot y-scale\right)}, {\left(\frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)} + \left(\frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale} + \frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale \cdot y-scale}\right)}} \]
            5. Taylor expanded in angle around 0

              \[\leadsto \left(\frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{y-scale}} \]
            6. Step-by-step derivation
              1. lower-/.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{y-scale}} \]
              2. lower-sqrt.f6428.7

                \[\leadsto \left(0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \frac{\color{blue}{\sqrt{2}}}{y-scale} \]
            7. Applied rewrites28.7%

              \[\leadsto \left(0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{y-scale}} \]

            if 5.49999999999999966e162 < x-scale

            1. Initial program 0.1%

              \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
            2. Add Preprocessing
            3. Taylor expanded in y-scale around 0

              \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
            4. Step-by-step derivation
              1. associate-*r*N/A

                \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
              2. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
              3. lower-*.f64N/A

                \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
              4. lower-*.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
              5. lower-sqrt.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
              6. lower-sqrt.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
              7. distribute-lft-outN/A

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
              8. lower-*.f64N/A

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
            5. Applied rewrites61.8%

              \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
            6. Applied rewrites67.8%

              \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right)\right)}} \]
            7. Taylor expanded in angle around 0

              \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
            8. Step-by-step derivation
              1. Applied rewrites67.9%

                \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
              2. Taylor expanded in angle around 0

                \[\leadsto \color{blue}{\frac{1}{259200} \cdot \frac{{angle}^{2} \cdot \left({b}^{2} \cdot \left(x-scale \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)}{a} + \frac{1}{4} \cdot \left(a \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
              3. Step-by-step derivation
                1. lower-fma.f64N/A

                  \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{1}{259200}, \frac{{angle}^{2} \cdot \left({b}^{2} \cdot \left(x-scale \cdot \left({\mathsf{PI}\left(\right)}^{2} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)}{a}, \frac{1}{4} \cdot \left(a \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)\right)} \]
              4. Applied rewrites36.9%

                \[\leadsto \color{blue}{\mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\left(x-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)}{a}, 0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
            9. Recombined 3 regimes into one program.
            10. Final simplification22.9%

              \[\leadsto \begin{array}{l} \mathbf{if}\;x-scale \leq 3.3 \cdot 10^{-56}:\\ \;\;\;\;y-scale \cdot b\\ \mathbf{elif}\;x-scale \leq 5.5 \cdot 10^{+162}:\\ \;\;\;\;\left(0.25 \cdot \left(\left(x-scale \cdot a\right) \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right) \cdot \frac{\sqrt{2}}{y-scale}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(3.858024691358025 \cdot 10^{-6}, \frac{\left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right)}{a}, 0.25 \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale \cdot a\right)\right)\right)\\ \end{array} \]
            11. Add Preprocessing

            Alternative 5: 29.5% accurate, 32.7× speedup?

            \[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ \begin{array}{l} t_0 := 0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\\ \mathbf{if}\;b \leq 7.8 \cdot 10^{-132}:\\ \;\;\;\;t\_0 \cdot \left(\sqrt{2} \cdot a\right)\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+106}:\\ \;\;\;\;t\_0 \cdot \sqrt{2 \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot a\right)}\\ \mathbf{else}:\\ \;\;\;\;y-scale\_m \cdot b\\ \end{array} \end{array} \]
            y-scale_m = (fabs.f64 y-scale)
            x-scale_m = (fabs.f64 x-scale)
            (FPCore (a b angle x-scale_m y-scale_m)
             :precision binary64
             (let* ((t_0 (* 0.25 (* x-scale_m (sqrt 8.0)))))
               (if (<= b 7.8e-132)
                 (* t_0 (* (sqrt 2.0) a))
                 (if (<= b 4.8e+106)
                   (*
                    t_0
                    (sqrt
                     (*
                      2.0
                      (fma
                       (* (* angle angle) 3.08641975308642e-5)
                       (* (* b b) (* (PI) (PI)))
                       (* a a)))))
                   (* y-scale_m b)))))
            \begin{array}{l}
            y-scale_m = \left|y-scale\right|
            \\
            x-scale_m = \left|x-scale\right|
            
            \\
            \begin{array}{l}
            t_0 := 0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\\
            \mathbf{if}\;b \leq 7.8 \cdot 10^{-132}:\\
            \;\;\;\;t\_0 \cdot \left(\sqrt{2} \cdot a\right)\\
            
            \mathbf{elif}\;b \leq 4.8 \cdot 10^{+106}:\\
            \;\;\;\;t\_0 \cdot \sqrt{2 \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot a\right)}\\
            
            \mathbf{else}:\\
            \;\;\;\;y-scale\_m \cdot b\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if b < 7.79999999999999964e-132

              1. Initial program 3.0%

                \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
              2. Add Preprocessing
              3. Taylor expanded in y-scale around 0

                \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
              4. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                3. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                4. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                5. lower-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                6. lower-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                7. distribute-lft-outN/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                8. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
              5. Applied rewrites21.7%

                \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
              6. Taylor expanded in angle around 0

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\left(a \cdot \sqrt{2}\right)} \]
              7. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\left(a \cdot \sqrt{2}\right)} \]
                2. lower-sqrt.f6424.6

                  \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(a \cdot \color{blue}{\sqrt{2}}\right) \]
              8. Applied rewrites24.6%

                \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\left(a \cdot \sqrt{2}\right)} \]

              if 7.79999999999999964e-132 < b < 4.8000000000000001e106

              1. Initial program 5.5%

                \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
              2. Add Preprocessing
              3. Taylor expanded in y-scale around 0

                \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
              4. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                3. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                4. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                5. lower-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                6. lower-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                7. distribute-lft-outN/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                8. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
              5. Applied rewrites27.4%

                \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
              6. Applied rewrites28.2%

                \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \left(0.5 + 0.5 \cdot \cos \left(2 \cdot \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)\right)\right) \cdot \left(a \cdot a\right)\right)}} \]
              7. Taylor expanded in angle around 0

                \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
              8. Step-by-step derivation
                1. Applied rewrites28.2%

                  \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right) \cdot b, \color{blue}{1} \cdot \left(a \cdot a\right)\right)} \]
                2. Taylor expanded in angle around 0

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\left(\frac{1}{32400} \cdot \left({angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)\right) + {a}^{2}\right)}} \]
                3. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left(\color{blue}{\left(\frac{1}{32400} \cdot {angle}^{2}\right) \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)} + {a}^{2}\right)} \]
                  2. lower-fma.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(\frac{1}{32400} \cdot {angle}^{2}, {b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}, {a}^{2}\right)}} \]
                  3. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\color{blue}{\frac{1}{32400} \cdot {angle}^{2}}, {b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}, {a}^{2}\right)} \]
                  4. unpow2N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}, {b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}, {a}^{2}\right)} \]
                  5. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \color{blue}{\left(angle \cdot angle\right)}, {b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}, {a}^{2}\right)} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \color{blue}{{b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}}, {a}^{2}\right)} \]
                  7. unpow2N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \color{blue}{\left(b \cdot b\right)} \cdot {\mathsf{PI}\left(\right)}^{2}, {a}^{2}\right)} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \color{blue}{\left(b \cdot b\right)} \cdot {\mathsf{PI}\left(\right)}^{2}, {a}^{2}\right)} \]
                  9. unpow2N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \left(b \cdot b\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}, {a}^{2}\right)} \]
                  10. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \left(b \cdot b\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}, {a}^{2}\right)} \]
                  11. lower-PI.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \left(b \cdot b\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\right), {a}^{2}\right)} \]
                  12. lower-PI.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right), {a}^{2}\right)} \]
                  13. unpow2N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\frac{1}{32400} \cdot \left(angle \cdot angle\right), \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \color{blue}{a \cdot a}\right)} \]
                  14. lower-*.f6426.0

                    \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), \color{blue}{a \cdot a}\right)} \]
                4. Applied rewrites26.0%

                  \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \color{blue}{\mathsf{fma}\left(3.08641975308642 \cdot 10^{-5} \cdot \left(angle \cdot angle\right), \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot a\right)}} \]

                if 4.8000000000000001e106 < b

                1. Initial program 3.1%

                  \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
                2. Add Preprocessing
                3. Taylor expanded in angle around 0

                  \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(b \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                  5. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right) \]
                  7. lower-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                  8. lower-sqrt.f6441.6

                    \[\leadsto \left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
                5. Applied rewrites41.6%

                  \[\leadsto \color{blue}{\left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right) \]
                  2. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                  3. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
                  4. associate-*l*N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  5. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
                  6. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
                  7. sqrt-unprodN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{\sqrt{2 \cdot 8}}\right) \]
                  8. metadata-evalN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \sqrt{\color{blue}{16}}\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{4}\right) \]
                  10. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                  11. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                  12. lower-*.f6441.7

                    \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
                7. Applied rewrites41.7%

                  \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                8. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \cdot 4 \]
                  2. lift-*.f64N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
                  3. metadata-evalN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\sqrt{16}} \]
                  4. metadata-evalN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \sqrt{\color{blue}{2 \cdot 8}} \]
                  5. sqrt-unprodN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                  6. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \]
                  7. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                  9. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                  10. lift-*.f64N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                  11. lift-*.f64N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \]
                  12. associate-*l*N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\frac{1}{4} \cdot \left(b \cdot y-scale\right)\right)} \]
                  13. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right)} \]
                  14. lift-*.f64N/A

                    \[\leadsto \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  15. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  16. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  17. sqrt-unprodN/A

                    \[\leadsto \left(\color{blue}{\sqrt{2 \cdot 8}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  18. metadata-evalN/A

                    \[\leadsto \left(\sqrt{\color{blue}{16}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  19. metadata-evalN/A

                    \[\leadsto \left(\color{blue}{4} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  20. metadata-evalN/A

                    \[\leadsto \color{blue}{1} \cdot \left(b \cdot y-scale\right) \]
                  21. *-lft-identityN/A

                    \[\leadsto \color{blue}{b \cdot y-scale} \]
                  22. *-commutativeN/A

                    \[\leadsto \color{blue}{y-scale \cdot b} \]
                  23. lower-*.f6441.7

                    \[\leadsto \color{blue}{y-scale \cdot b} \]
                9. Applied rewrites41.7%

                  \[\leadsto \color{blue}{y-scale \cdot b} \]
              9. Recombined 3 regimes into one program.
              10. Final simplification27.0%

                \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 7.8 \cdot 10^{-132}:\\ \;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(\sqrt{2} \cdot a\right)\\ \mathbf{elif}\;b \leq 4.8 \cdot 10^{+106}:\\ \;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left(\left(angle \cdot angle\right) \cdot 3.08641975308642 \cdot 10^{-5}, \left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right), a \cdot a\right)}\\ \mathbf{else}:\\ \;\;\;\;y-scale \cdot b\\ \end{array} \]
              11. Add Preprocessing

              Alternative 6: 24.1% accurate, 61.9× speedup?

              \[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ \begin{array}{l} \mathbf{if}\;x-scale\_m \leq 3.6 \cdot 10^{-56}:\\ \;\;\;\;y-scale\_m \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\right) \cdot \left(\sqrt{2} \cdot a\right)\\ \end{array} \end{array} \]
              y-scale_m = (fabs.f64 y-scale)
              x-scale_m = (fabs.f64 x-scale)
              (FPCore (a b angle x-scale_m y-scale_m)
               :precision binary64
               (if (<= x-scale_m 3.6e-56)
                 (* y-scale_m b)
                 (* (* 0.25 (* x-scale_m (sqrt 8.0))) (* (sqrt 2.0) a))))
              y-scale_m = fabs(y_45_scale);
              x-scale_m = fabs(x_45_scale);
              double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale_m) {
              	double tmp;
              	if (x_45_scale_m <= 3.6e-56) {
              		tmp = y_45_scale_m * b;
              	} else {
              		tmp = (0.25 * (x_45_scale_m * sqrt(8.0))) * (sqrt(2.0) * a);
              	}
              	return tmp;
              }
              
              y-scale_m = abs(y_45scale)
              x-scale_m = abs(x_45scale)
              real(8) function code(a, b, angle, x_45scale_m, y_45scale_m)
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  real(8), intent (in) :: angle
                  real(8), intent (in) :: x_45scale_m
                  real(8), intent (in) :: y_45scale_m
                  real(8) :: tmp
                  if (x_45scale_m <= 3.6d-56) then
                      tmp = y_45scale_m * b
                  else
                      tmp = (0.25d0 * (x_45scale_m * sqrt(8.0d0))) * (sqrt(2.0d0) * a)
                  end if
                  code = tmp
              end function
              
              y-scale_m = Math.abs(y_45_scale);
              x-scale_m = Math.abs(x_45_scale);
              public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale_m) {
              	double tmp;
              	if (x_45_scale_m <= 3.6e-56) {
              		tmp = y_45_scale_m * b;
              	} else {
              		tmp = (0.25 * (x_45_scale_m * Math.sqrt(8.0))) * (Math.sqrt(2.0) * a);
              	}
              	return tmp;
              }
              
              y-scale_m = math.fabs(y_45_scale)
              x-scale_m = math.fabs(x_45_scale)
              def code(a, b, angle, x_45_scale_m, y_45_scale_m):
              	tmp = 0
              	if x_45_scale_m <= 3.6e-56:
              		tmp = y_45_scale_m * b
              	else:
              		tmp = (0.25 * (x_45_scale_m * math.sqrt(8.0))) * (math.sqrt(2.0) * a)
              	return tmp
              
              y-scale_m = abs(y_45_scale)
              x-scale_m = abs(x_45_scale)
              function code(a, b, angle, x_45_scale_m, y_45_scale_m)
              	tmp = 0.0
              	if (x_45_scale_m <= 3.6e-56)
              		tmp = Float64(y_45_scale_m * b);
              	else
              		tmp = Float64(Float64(0.25 * Float64(x_45_scale_m * sqrt(8.0))) * Float64(sqrt(2.0) * a));
              	end
              	return tmp
              end
              
              y-scale_m = abs(y_45_scale);
              x-scale_m = abs(x_45_scale);
              function tmp_2 = code(a, b, angle, x_45_scale_m, y_45_scale_m)
              	tmp = 0.0;
              	if (x_45_scale_m <= 3.6e-56)
              		tmp = y_45_scale_m * b;
              	else
              		tmp = (0.25 * (x_45_scale_m * sqrt(8.0))) * (sqrt(2.0) * a);
              	end
              	tmp_2 = tmp;
              end
              
              y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
              x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
              code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := If[LessEqual[x$45$scale$95$m, 3.6e-56], N[(y$45$scale$95$m * b), $MachinePrecision], N[(N[(0.25 * N[(x$45$scale$95$m * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(N[Sqrt[2.0], $MachinePrecision] * a), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              y-scale_m = \left|y-scale\right|
              \\
              x-scale_m = \left|x-scale\right|
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x-scale\_m \leq 3.6 \cdot 10^{-56}:\\
              \;\;\;\;y-scale\_m \cdot b\\
              
              \mathbf{else}:\\
              \;\;\;\;\left(0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\right) \cdot \left(\sqrt{2} \cdot a\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x-scale < 3.59999999999999978e-56

                1. Initial program 3.2%

                  \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
                2. Add Preprocessing
                3. Taylor expanded in angle around 0

                  \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(b \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                  5. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right) \]
                  7. lower-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                  8. lower-sqrt.f6418.3

                    \[\leadsto \left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
                5. Applied rewrites18.3%

                  \[\leadsto \color{blue}{\left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right) \]
                  2. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                  3. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
                  4. associate-*l*N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  5. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
                  6. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
                  7. sqrt-unprodN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{\sqrt{2 \cdot 8}}\right) \]
                  8. metadata-evalN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \sqrt{\color{blue}{16}}\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{4}\right) \]
                  10. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                  11. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                  12. lower-*.f6418.3

                    \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
                7. Applied rewrites18.3%

                  \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                8. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \cdot 4 \]
                  2. lift-*.f64N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
                  3. metadata-evalN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\sqrt{16}} \]
                  4. metadata-evalN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \sqrt{\color{blue}{2 \cdot 8}} \]
                  5. sqrt-unprodN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                  6. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \]
                  7. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                  9. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                  10. lift-*.f64N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                  11. lift-*.f64N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \]
                  12. associate-*l*N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\frac{1}{4} \cdot \left(b \cdot y-scale\right)\right)} \]
                  13. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right)} \]
                  14. lift-*.f64N/A

                    \[\leadsto \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  15. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  16. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  17. sqrt-unprodN/A

                    \[\leadsto \left(\color{blue}{\sqrt{2 \cdot 8}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  18. metadata-evalN/A

                    \[\leadsto \left(\sqrt{\color{blue}{16}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  19. metadata-evalN/A

                    \[\leadsto \left(\color{blue}{4} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  20. metadata-evalN/A

                    \[\leadsto \color{blue}{1} \cdot \left(b \cdot y-scale\right) \]
                  21. *-lft-identityN/A

                    \[\leadsto \color{blue}{b \cdot y-scale} \]
                  22. *-commutativeN/A

                    \[\leadsto \color{blue}{y-scale \cdot b} \]
                  23. lower-*.f6418.3

                    \[\leadsto \color{blue}{y-scale \cdot b} \]
                9. Applied rewrites18.3%

                  \[\leadsto \color{blue}{y-scale \cdot b} \]

                if 3.59999999999999978e-56 < x-scale

                1. Initial program 3.8%

                  \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
                2. Add Preprocessing
                3. Taylor expanded in y-scale around 0

                  \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                  4. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                  5. lower-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                  6. lower-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  7. distribute-lft-outN/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                5. Applied rewrites46.8%

                  \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
                6. Taylor expanded in angle around 0

                  \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\left(a \cdot \sqrt{2}\right)} \]
                7. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\left(a \cdot \sqrt{2}\right)} \]
                  2. lower-sqrt.f6425.5

                    \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(a \cdot \color{blue}{\sqrt{2}}\right) \]
                8. Applied rewrites25.5%

                  \[\leadsto \left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\left(a \cdot \sqrt{2}\right)} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification20.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x-scale \leq 3.6 \cdot 10^{-56}:\\ \;\;\;\;y-scale \cdot b\\ \mathbf{else}:\\ \;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \left(\sqrt{2} \cdot a\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 7: 24.1% accurate, 61.9× speedup?

              \[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ \begin{array}{l} \mathbf{if}\;x-scale\_m \leq 3.6 \cdot 10^{-56}:\\ \;\;\;\;y-scale\_m \cdot b\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale\_m \cdot a\right)\right)\\ \end{array} \end{array} \]
              y-scale_m = (fabs.f64 y-scale)
              x-scale_m = (fabs.f64 x-scale)
              (FPCore (a b angle x-scale_m y-scale_m)
               :precision binary64
               (if (<= x-scale_m 3.6e-56)
                 (* y-scale_m b)
                 (* 0.25 (* (* (sqrt 2.0) (sqrt 8.0)) (* x-scale_m a)))))
              y-scale_m = fabs(y_45_scale);
              x-scale_m = fabs(x_45_scale);
              double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale_m) {
              	double tmp;
              	if (x_45_scale_m <= 3.6e-56) {
              		tmp = y_45_scale_m * b;
              	} else {
              		tmp = 0.25 * ((sqrt(2.0) * sqrt(8.0)) * (x_45_scale_m * a));
              	}
              	return tmp;
              }
              
              y-scale_m = abs(y_45scale)
              x-scale_m = abs(x_45scale)
              real(8) function code(a, b, angle, x_45scale_m, y_45scale_m)
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  real(8), intent (in) :: angle
                  real(8), intent (in) :: x_45scale_m
                  real(8), intent (in) :: y_45scale_m
                  real(8) :: tmp
                  if (x_45scale_m <= 3.6d-56) then
                      tmp = y_45scale_m * b
                  else
                      tmp = 0.25d0 * ((sqrt(2.0d0) * sqrt(8.0d0)) * (x_45scale_m * a))
                  end if
                  code = tmp
              end function
              
              y-scale_m = Math.abs(y_45_scale);
              x-scale_m = Math.abs(x_45_scale);
              public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale_m) {
              	double tmp;
              	if (x_45_scale_m <= 3.6e-56) {
              		tmp = y_45_scale_m * b;
              	} else {
              		tmp = 0.25 * ((Math.sqrt(2.0) * Math.sqrt(8.0)) * (x_45_scale_m * a));
              	}
              	return tmp;
              }
              
              y-scale_m = math.fabs(y_45_scale)
              x-scale_m = math.fabs(x_45_scale)
              def code(a, b, angle, x_45_scale_m, y_45_scale_m):
              	tmp = 0
              	if x_45_scale_m <= 3.6e-56:
              		tmp = y_45_scale_m * b
              	else:
              		tmp = 0.25 * ((math.sqrt(2.0) * math.sqrt(8.0)) * (x_45_scale_m * a))
              	return tmp
              
              y-scale_m = abs(y_45_scale)
              x-scale_m = abs(x_45_scale)
              function code(a, b, angle, x_45_scale_m, y_45_scale_m)
              	tmp = 0.0
              	if (x_45_scale_m <= 3.6e-56)
              		tmp = Float64(y_45_scale_m * b);
              	else
              		tmp = Float64(0.25 * Float64(Float64(sqrt(2.0) * sqrt(8.0)) * Float64(x_45_scale_m * a)));
              	end
              	return tmp
              end
              
              y-scale_m = abs(y_45_scale);
              x-scale_m = abs(x_45_scale);
              function tmp_2 = code(a, b, angle, x_45_scale_m, y_45_scale_m)
              	tmp = 0.0;
              	if (x_45_scale_m <= 3.6e-56)
              		tmp = y_45_scale_m * b;
              	else
              		tmp = 0.25 * ((sqrt(2.0) * sqrt(8.0)) * (x_45_scale_m * a));
              	end
              	tmp_2 = tmp;
              end
              
              y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
              x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
              code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := If[LessEqual[x$45$scale$95$m, 3.6e-56], N[(y$45$scale$95$m * b), $MachinePrecision], N[(0.25 * N[(N[(N[Sqrt[2.0], $MachinePrecision] * N[Sqrt[8.0], $MachinePrecision]), $MachinePrecision] * N[(x$45$scale$95$m * a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
              
              \begin{array}{l}
              y-scale_m = \left|y-scale\right|
              \\
              x-scale_m = \left|x-scale\right|
              
              \\
              \begin{array}{l}
              \mathbf{if}\;x-scale\_m \leq 3.6 \cdot 10^{-56}:\\
              \;\;\;\;y-scale\_m \cdot b\\
              
              \mathbf{else}:\\
              \;\;\;\;0.25 \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale\_m \cdot a\right)\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if x-scale < 3.59999999999999978e-56

                1. Initial program 3.2%

                  \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
                2. Add Preprocessing
                3. Taylor expanded in angle around 0

                  \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(b \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
                  4. associate-*r*N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                  5. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                  6. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right) \]
                  7. lower-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                  8. lower-sqrt.f6418.3

                    \[\leadsto \left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
                5. Applied rewrites18.3%

                  \[\leadsto \color{blue}{\left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                6. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right) \]
                  2. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                  3. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
                  4. associate-*l*N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  5. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
                  6. lift-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
                  7. sqrt-unprodN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{\sqrt{2 \cdot 8}}\right) \]
                  8. metadata-evalN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \sqrt{\color{blue}{16}}\right) \]
                  9. metadata-evalN/A

                    \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{4}\right) \]
                  10. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                  11. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                  12. lower-*.f6418.3

                    \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
                7. Applied rewrites18.3%

                  \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                8. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \cdot 4 \]
                  2. lift-*.f64N/A

                    \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
                  3. metadata-evalN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\sqrt{16}} \]
                  4. metadata-evalN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \sqrt{\color{blue}{2 \cdot 8}} \]
                  5. sqrt-unprodN/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                  6. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \]
                  7. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \]
                  8. lift-*.f64N/A

                    \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                  9. *-commutativeN/A

                    \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                  10. lift-*.f64N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                  11. lift-*.f64N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \]
                  12. associate-*l*N/A

                    \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\frac{1}{4} \cdot \left(b \cdot y-scale\right)\right)} \]
                  13. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right)} \]
                  14. lift-*.f64N/A

                    \[\leadsto \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  15. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  16. lift-sqrt.f64N/A

                    \[\leadsto \left(\left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  17. sqrt-unprodN/A

                    \[\leadsto \left(\color{blue}{\sqrt{2 \cdot 8}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  18. metadata-evalN/A

                    \[\leadsto \left(\sqrt{\color{blue}{16}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  19. metadata-evalN/A

                    \[\leadsto \left(\color{blue}{4} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                  20. metadata-evalN/A

                    \[\leadsto \color{blue}{1} \cdot \left(b \cdot y-scale\right) \]
                  21. *-lft-identityN/A

                    \[\leadsto \color{blue}{b \cdot y-scale} \]
                  22. *-commutativeN/A

                    \[\leadsto \color{blue}{y-scale \cdot b} \]
                  23. lower-*.f6418.3

                    \[\leadsto \color{blue}{y-scale \cdot b} \]
                9. Applied rewrites18.3%

                  \[\leadsto \color{blue}{y-scale \cdot b} \]

                if 3.59999999999999978e-56 < x-scale

                1. Initial program 3.8%

                  \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
                2. Add Preprocessing
                3. Taylor expanded in y-scale around 0

                  \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{8}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}\right)} \]
                4. Step-by-step derivation
                  1. associate-*r*N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  3. lower-*.f64N/A

                    \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right)} \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                  4. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(x-scale \cdot \sqrt{8}\right)}\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                  5. lower-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)} \]
                  6. lower-sqrt.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right) + 2 \cdot \left({b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  7. distribute-lft-outN/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                  8. lower-*.f64N/A

                    \[\leadsto \left(\frac{1}{4} \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{2 \cdot \left({a}^{2} \cdot {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {b}^{2} \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
                5. Applied rewrites46.8%

                  \[\leadsto \color{blue}{\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} \cdot \left(a \cdot a\right)\right)}} \]
                6. Taylor expanded in angle around 0

                  \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(a \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
                7. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(a \cdot \left(x-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
                  2. associate-*r*N/A

                    \[\leadsto \frac{1}{4} \cdot \color{blue}{\left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  3. lower-*.f64N/A

                    \[\leadsto \frac{1}{4} \cdot \color{blue}{\left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                  4. lower-*.f64N/A

                    \[\leadsto \frac{1}{4} \cdot \left(\color{blue}{\left(a \cdot x-scale\right)} \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
                  5. lower-*.f64N/A

                    \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)}\right) \]
                  6. lower-sqrt.f64N/A

                    \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
                  7. lower-sqrt.f6425.5

                    \[\leadsto 0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
                8. Applied rewrites25.5%

                  \[\leadsto \color{blue}{0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
              3. Recombined 2 regimes into one program.
              4. Final simplification20.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x-scale \leq 3.6 \cdot 10^{-56}:\\ \;\;\;\;y-scale \cdot b\\ \mathbf{else}:\\ \;\;\;\;0.25 \cdot \left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(x-scale \cdot a\right)\right)\\ \end{array} \]
              5. Add Preprocessing

              Alternative 8: 19.5% accurate, 484.7× speedup?

              \[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ y-scale\_m \cdot b \end{array} \]
              y-scale_m = (fabs.f64 y-scale)
              x-scale_m = (fabs.f64 x-scale)
              (FPCore (a b angle x-scale_m y-scale_m) :precision binary64 (* y-scale_m b))
              y-scale_m = fabs(y_45_scale);
              x-scale_m = fabs(x_45_scale);
              double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale_m) {
              	return y_45_scale_m * b;
              }
              
              y-scale_m = abs(y_45scale)
              x-scale_m = abs(x_45scale)
              real(8) function code(a, b, angle, x_45scale_m, y_45scale_m)
                  real(8), intent (in) :: a
                  real(8), intent (in) :: b
                  real(8), intent (in) :: angle
                  real(8), intent (in) :: x_45scale_m
                  real(8), intent (in) :: y_45scale_m
                  code = y_45scale_m * b
              end function
              
              y-scale_m = Math.abs(y_45_scale);
              x-scale_m = Math.abs(x_45_scale);
              public static double code(double a, double b, double angle, double x_45_scale_m, double y_45_scale_m) {
              	return y_45_scale_m * b;
              }
              
              y-scale_m = math.fabs(y_45_scale)
              x-scale_m = math.fabs(x_45_scale)
              def code(a, b, angle, x_45_scale_m, y_45_scale_m):
              	return y_45_scale_m * b
              
              y-scale_m = abs(y_45_scale)
              x-scale_m = abs(x_45_scale)
              function code(a, b, angle, x_45_scale_m, y_45_scale_m)
              	return Float64(y_45_scale_m * b)
              end
              
              y-scale_m = abs(y_45_scale);
              x-scale_m = abs(x_45_scale);
              function tmp = code(a, b, angle, x_45_scale_m, y_45_scale_m)
              	tmp = y_45_scale_m * b;
              end
              
              y-scale_m = N[Abs[y$45$scale], $MachinePrecision]
              x-scale_m = N[Abs[x$45$scale], $MachinePrecision]
              code[a_, b_, angle_, x$45$scale$95$m_, y$45$scale$95$m_] := N[(y$45$scale$95$m * b), $MachinePrecision]
              
              \begin{array}{l}
              y-scale_m = \left|y-scale\right|
              \\
              x-scale_m = \left|x-scale\right|
              
              \\
              y-scale\_m \cdot b
              \end{array}
              
              Derivation
              1. Initial program 3.4%

                \[\frac{-\sqrt{\left(\left(2 \cdot \frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}\right) \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)\right) \cdot \left(\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} + \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right) + \sqrt{{\left(\frac{\frac{{\left(a \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale}}{x-scale} - \frac{\frac{{\left(a \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2} + {\left(b \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale}}{y-scale}\right)}^{2} + {\left(\frac{\frac{\left(\left(2 \cdot \left({b}^{2} - {a}^{2}\right)\right) \cdot \sin \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)\right) \cdot \cos \left(\frac{angle}{180} \cdot \mathsf{PI}\left(\right)\right)}{x-scale}}{y-scale}\right)}^{2}}\right)}}{\frac{4 \cdot \left(\left(b \cdot a\right) \cdot \left(b \cdot \left(-a\right)\right)\right)}{{\left(x-scale \cdot y-scale\right)}^{2}}} \]
              2. Add Preprocessing
              3. Taylor expanded in angle around 0

                \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(b \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)\right)} \]
              4. Step-by-step derivation
                1. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                3. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right) \]
                4. associate-*r*N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                5. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
                6. lower-*.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\color{blue}{\left(y-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right) \]
                7. lower-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                8. lower-sqrt.f6416.0

                  \[\leadsto \left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
              5. Applied rewrites16.0%

                \[\leadsto \color{blue}{\left(0.25 \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)} \]
              6. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right) \]
                2. lift-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right) \]
                3. lift-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(\left(y-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right) \]
                4. associate-*l*N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \color{blue}{\left(y-scale \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
                5. lift-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right)\right) \]
                6. lift-sqrt.f64N/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
                7. sqrt-unprodN/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{\sqrt{2 \cdot 8}}\right) \]
                8. metadata-evalN/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \sqrt{\color{blue}{16}}\right) \]
                9. metadata-evalN/A

                  \[\leadsto \left(\frac{1}{4} \cdot b\right) \cdot \left(y-scale \cdot \color{blue}{4}\right) \]
                10. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                11. lower-*.f64N/A

                  \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot 4} \]
                12. lower-*.f6416.1

                  \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
              7. Applied rewrites16.1%

                \[\leadsto \color{blue}{\left(\left(0.25 \cdot b\right) \cdot y-scale\right) \cdot 4} \]
              8. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \cdot 4 \]
                2. lift-*.f64N/A

                  \[\leadsto \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \cdot 4 \]
                3. metadata-evalN/A

                  \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\sqrt{16}} \]
                4. metadata-evalN/A

                  \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \sqrt{\color{blue}{2 \cdot 8}} \]
                5. sqrt-unprodN/A

                  \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                6. lift-sqrt.f64N/A

                  \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \]
                7. lift-sqrt.f64N/A

                  \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \]
                8. lift-*.f64N/A

                  \[\leadsto \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right) \cdot \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \]
                9. *-commutativeN/A

                  \[\leadsto \color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                10. lift-*.f64N/A

                  \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\left(\frac{1}{4} \cdot b\right) \cdot y-scale\right)} \]
                11. lift-*.f64N/A

                  \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \left(\color{blue}{\left(\frac{1}{4} \cdot b\right)} \cdot y-scale\right) \]
                12. associate-*l*N/A

                  \[\leadsto \left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \color{blue}{\left(\frac{1}{4} \cdot \left(b \cdot y-scale\right)\right)} \]
                13. associate-*r*N/A

                  \[\leadsto \color{blue}{\left(\left(\sqrt{2} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right)} \]
                14. lift-*.f64N/A

                  \[\leadsto \left(\color{blue}{\left(\sqrt{2} \cdot \sqrt{8}\right)} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                15. lift-sqrt.f64N/A

                  \[\leadsto \left(\left(\color{blue}{\sqrt{2}} \cdot \sqrt{8}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                16. lift-sqrt.f64N/A

                  \[\leadsto \left(\left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right) \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                17. sqrt-unprodN/A

                  \[\leadsto \left(\color{blue}{\sqrt{2 \cdot 8}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                18. metadata-evalN/A

                  \[\leadsto \left(\sqrt{\color{blue}{16}} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                19. metadata-evalN/A

                  \[\leadsto \left(\color{blue}{4} \cdot \frac{1}{4}\right) \cdot \left(b \cdot y-scale\right) \]
                20. metadata-evalN/A

                  \[\leadsto \color{blue}{1} \cdot \left(b \cdot y-scale\right) \]
                21. *-lft-identityN/A

                  \[\leadsto \color{blue}{b \cdot y-scale} \]
                22. *-commutativeN/A

                  \[\leadsto \color{blue}{y-scale \cdot b} \]
                23. lower-*.f6416.1

                  \[\leadsto \color{blue}{y-scale \cdot b} \]
              9. Applied rewrites16.1%

                \[\leadsto \color{blue}{y-scale \cdot b} \]
              10. Add Preprocessing

              Reproduce

              ?
              herbie shell --seed 2024219 
              (FPCore (a b angle x-scale y-scale)
                :name "a from scale-rotated-ellipse"
                :precision binary64
                (/ (- (sqrt (* (* (* 2.0 (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))) (* (* b a) (* b (- a)))) (+ (+ (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (sin (* (/ angle 180.0) (PI)))) 2.0)) y-scale) y-scale)) (sqrt (+ (pow (- (/ (/ (+ (pow (* a (sin (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (cos (* (/ angle 180.0) (PI)))) 2.0)) x-scale) x-scale) (/ (/ (+ (pow (* a (cos (* (/ angle 180.0) (PI)))) 2.0) (pow (* b (sin (* (/ angle 180.0) (PI)))) 2.0)) y-scale) y-scale)) 2.0) (pow (/ (/ (* (* (* 2.0 (- (pow b 2.0) (pow a 2.0))) (sin (* (/ angle 180.0) (PI)))) (cos (* (/ angle 180.0) (PI)))) x-scale) y-scale) 2.0))))))) (/ (* 4.0 (* (* b a) (* b (- a)))) (pow (* x-scale y-scale) 2.0))))