a from scale-rotated-ellipse

Percentage Accurate: 2.8% → 57.0%
Time: 31.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: 57.0% accurate, 7.7× speedup?

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

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

\mathbf{else}:\\
\;\;\;\;\left(0.25 \cdot \left(b\_m \cdot \left(x-scale\_m \cdot \left(y-scale\_m \cdot \sqrt{8}\right)\right)\right)\right) \cdot \frac{\sqrt{2}}{x-scale\_m}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y-scale < 1.8e35

    1. Initial program 2.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 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 rewrites20.5%

      \[\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 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{{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)} \]
    7. 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{{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}}} \]
      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{{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}}} \]
      3. 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{{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}} \]
      4. associate-*r*N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{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}} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{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}} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\color{blue}{\left(x-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{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}} \]
      7. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{{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}} \]
      8. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{{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}} \]
      9. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{{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}}} \]
      10. lower-fma.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left({a}^{2}, {\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. Applied rewrites20.4%

      \[\leadsto \color{blue}{\left(0.25 \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{\mathsf{fma}\left(a \cdot a, {\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}\right)}} \]
    9. Step-by-step derivation
      1. add-cbrt-cubeN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{\mathsf{fma}\left(a \cdot a, {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot \color{blue}{{\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \mathsf{PI}\left(\right)\right)}^{\frac{1}{3}}}\right)\right)}^{2}\right)} \]
      3. add-sqr-sqrtN/A

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

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{\mathsf{fma}\left(a \cdot a, {\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, \left(b \cdot b\right) \cdot {\sin \left(\frac{1}{180} \cdot \left(angle \cdot {\color{blue}{\left(\left(\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right) \cdot \sqrt{\mathsf{PI}\left(\right)}\right)}}^{\frac{1}{3}}\right)\right)}^{2}\right)} \]
      5. unpow-prod-downN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    if 1.8e35 < y-scale

    1. Initial program 4.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 b around inf

      \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(b \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{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\sin \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}}{{x-scale}^{2}} + \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}\right)} \]
    4. Applied rewrites18.0%

      \[\leadsto \color{blue}{\left(0.25 \cdot \left(b \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\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{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)} + \left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale} + \frac{{\sin \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(b \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{x-scale}} \]
    6. Step-by-step derivation
      1. lower-/.f64N/A

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

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

      \[\leadsto \left(0.25 \cdot \left(b \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\right)\right)\right) \cdot \color{blue}{\frac{\sqrt{2}}{x-scale}} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 42.5% accurate, 10.6× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ b_m = \left|b\right| \\ \begin{array}{l} t_0 := \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\\ \mathbf{if}\;a \leq 1.35 \cdot 10^{+40}:\\ \;\;\;\;b\_m \cdot \left(0.25 \cdot \left(y-scale\_m \cdot 4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x-scale\_m \cdot \sqrt{\mathsf{fma}\left(b\_m, b\_m \cdot \mathsf{fma}\left(t\_0, -0.5, 0.5\right), \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, t\_0, 0.5\right)\right)}\\ \end{array} \end{array} \]
y-scale_m = (fabs.f64 y-scale)
x-scale_m = (fabs.f64 x-scale)
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale_m y-scale_m)
 :precision binary64
 (let* ((t_0 (cos (* (* angle (PI)) 0.011111111111111112))))
   (if (<= a 1.35e+40)
     (* b_m (* 0.25 (* y-scale_m 4.0)))
     (*
      x-scale_m
      (sqrt
       (fma b_m (* b_m (fma t_0 -0.5 0.5)) (* (* a a) (fma 0.5 t_0 0.5))))))))
\begin{array}{l}
y-scale_m = \left|y-scale\right|
\\
x-scale_m = \left|x-scale\right|
\\
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right)\\
\mathbf{if}\;a \leq 1.35 \cdot 10^{+40}:\\
\;\;\;\;b\_m \cdot \left(0.25 \cdot \left(y-scale\_m \cdot 4\right)\right)\\

\mathbf{else}:\\
\;\;\;\;x-scale\_m \cdot \sqrt{\mathsf{fma}\left(b\_m, b\_m \cdot \mathsf{fma}\left(t\_0, -0.5, 0.5\right), \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, t\_0, 0.5\right)\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if a < 1.35000000000000005e40

    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.f6427.4

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

      \[\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-*.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) \]
      4. 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) \]
      5. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(y-scale \cdot 4\right) \cdot 0.25\right) \cdot b} \]

    if 1.35000000000000005e40 < a

    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 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 rewrites35.5%

      \[\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 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{{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)} \]
    7. 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{{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}}} \]
      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{{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}}} \]
      3. 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{{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}} \]
      4. associate-*r*N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{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}} \]
      5. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{\left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)}\right) \cdot \sqrt{{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}} \]
      6. lower-*.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\color{blue}{\left(x-scale \cdot \sqrt{2}\right)} \cdot \sqrt{8}\right)\right) \cdot \sqrt{{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}} \]
      7. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \color{blue}{\sqrt{2}}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{{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}} \]
      8. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \color{blue}{\sqrt{8}}\right)\right) \cdot \sqrt{{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}} \]
      9. lower-sqrt.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \color{blue}{\sqrt{{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}}} \]
      10. lower-fma.f64N/A

        \[\leadsto \left(\frac{1}{4} \cdot \left(\left(x-scale \cdot \sqrt{2}\right) \cdot \sqrt{8}\right)\right) \cdot \sqrt{\color{blue}{\mathsf{fma}\left({a}^{2}, {\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. Applied rewrites35.5%

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

      \[\leadsto \color{blue}{\left(x-scale \cdot 1\right) \cdot \sqrt{\mathsf{fma}\left(b, b \cdot \mathsf{fma}\left(\cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right), \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right), 0.5\right)\right)}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification29.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 1.35 \cdot 10^{+40}:\\ \;\;\;\;b \cdot \left(0.25 \cdot \left(y-scale \cdot 4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x-scale \cdot \sqrt{\mathsf{fma}\left(b, b \cdot \mathsf{fma}\left(\cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right), -0.5, 0.5\right), \left(a \cdot a\right) \cdot \mathsf{fma}\left(0.5, \cos \left(\left(angle \cdot \mathsf{PI}\left(\right)\right) \cdot 0.011111111111111112\right), 0.5\right)\right)}\\ \end{array} \]
  5. Add Preprocessing

Alternative 3: 42.7% accurate, 32.7× speedup?

\[\begin{array}{l} y-scale_m = \left|y-scale\right| \\ x-scale_m = \left|x-scale\right| \\ b_m = \left|b\right| \\ \begin{array}{l} t_0 := 0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\\ \mathbf{if}\;a \leq 1.35 \cdot 10^{+40}:\\ \;\;\;\;b\_m \cdot \left(0.25 \cdot \left(y-scale\_m \cdot 4\right)\right)\\ \mathbf{elif}\;a \leq 5.8 \cdot 10^{+133}:\\ \;\;\;\;t\_0 \cdot \sqrt{2 \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, \left(angle \cdot angle\right) \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot a\right)}\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+244}:\\ \;\;\;\;x-scale\_m \cdot a\\ \mathbf{else}:\\ \;\;\;\;t\_0 \cdot \sqrt{2 \cdot \left(a \cdot a\right)}\\ \end{array} \end{array} \]
y-scale_m = (fabs.f64 y-scale)
x-scale_m = (fabs.f64 x-scale)
b_m = (fabs.f64 b)
(FPCore (a b_m angle x-scale_m y-scale_m)
 :precision binary64
 (let* ((t_0 (* 0.25 (* x-scale_m (sqrt 8.0)))))
   (if (<= a 1.35e+40)
     (* b_m (* 0.25 (* y-scale_m 4.0)))
     (if (<= a 5.8e+133)
       (*
        t_0
        (sqrt
         (*
          2.0
          (fma
           3.08641975308642e-5
           (* (* angle angle) (* (* b_m b_m) (* (PI) (PI))))
           (* a a)))))
       (if (<= a 1.35e+244) (* x-scale_m a) (* t_0 (sqrt (* 2.0 (* a a)))))))))
\begin{array}{l}
y-scale_m = \left|y-scale\right|
\\
x-scale_m = \left|x-scale\right|
\\
b_m = \left|b\right|

\\
\begin{array}{l}
t_0 := 0.25 \cdot \left(x-scale\_m \cdot \sqrt{8}\right)\\
\mathbf{if}\;a \leq 1.35 \cdot 10^{+40}:\\
\;\;\;\;b\_m \cdot \left(0.25 \cdot \left(y-scale\_m \cdot 4\right)\right)\\

\mathbf{elif}\;a \leq 5.8 \cdot 10^{+133}:\\
\;\;\;\;t\_0 \cdot \sqrt{2 \cdot \mathsf{fma}\left(3.08641975308642 \cdot 10^{-5}, \left(angle \cdot angle\right) \cdot \left(\left(b\_m \cdot b\_m\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot a\right)}\\

\mathbf{elif}\;a \leq 1.35 \cdot 10^{+244}:\\
\;\;\;\;x-scale\_m \cdot a\\

\mathbf{else}:\\
\;\;\;\;t\_0 \cdot \sqrt{2 \cdot \left(a \cdot a\right)}\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if a < 1.35000000000000005e40

    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.f6427.4

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

      \[\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-*.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) \]
      4. 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) \]
      5. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \color{blue}{\left(\left(y-scale \cdot 4\right) \cdot 0.25\right) \cdot b} \]

    if 1.35000000000000005e40 < a < 5.8000000000000002e133

    1. Initial program 6.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 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 rewrites37.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. 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)}^{2}, b \cdot b, {\color{blue}{1}}^{2} \cdot \left(a \cdot a\right)\right)} \]
    7. Step-by-step derivation
      1. Applied rewrites37.1%

        \[\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)}^{2}, b \cdot b, {\color{blue}{1}}^{2} \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. 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}, {angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\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(\frac{1}{32400}, \color{blue}{{angle}^{2} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, {a}^{2}\right)} \]
        3. 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}, \color{blue}{\left(angle \cdot angle\right)} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
        4. 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}, \color{blue}{\left(angle \cdot angle\right)} \cdot \left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {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}, \left(angle \cdot angle\right) \cdot \color{blue}{\left({b}^{2} \cdot {\mathsf{PI}\left(\right)}^{2}\right)}, {a}^{2}\right)} \]
        6. 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}, \left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
        7. 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}, \left(angle \cdot angle\right) \cdot \left(\color{blue}{\left(b \cdot b\right)} \cdot {\mathsf{PI}\left(\right)}^{2}\right), {a}^{2}\right)} \]
        8. 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}, \left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}\right), {a}^{2}\right)} \]
        9. 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}, \left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \color{blue}{\left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)}\right), {a}^{2}\right)} \]
        10. 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}, \left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\color{blue}{\mathsf{PI}\left(\right)} \cdot \mathsf{PI}\left(\right)\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}, \left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)\right), {a}^{2}\right)} \]
        12. 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}, \left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{a \cdot a}\right)} \]
        13. lower-*.f6437.2

          \[\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}, \left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), \color{blue}{a \cdot a}\right)} \]
      4. Applied rewrites37.2%

        \[\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}, \left(angle \cdot angle\right) \cdot \left(\left(b \cdot b\right) \cdot \left(\mathsf{PI}\left(\right) \cdot \mathsf{PI}\left(\right)\right)\right), a \cdot a\right)}} \]

      if 5.8000000000000002e133 < a < 1.34999999999999999e244

      1. Initial program 0.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.3%

        \[\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.f6439.0

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

        \[\leadsto \color{blue}{0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
      9. Step-by-step derivation
        1. lift-*.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) \]
        2. lift-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) \]
        3. lift-sqrt.f64N/A

          \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
        4. lift-*.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) \]
        5. *-commutativeN/A

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

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

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

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

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

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

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

          \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{4}\right) \cdot \left(a \cdot x-scale\right) \]
        13. metadata-evalN/A

          \[\leadsto \color{blue}{1} \cdot \left(a \cdot x-scale\right) \]
        14. *-lft-identity39.3

          \[\leadsto \color{blue}{a \cdot x-scale} \]
        15. lift-*.f64N/A

          \[\leadsto \color{blue}{a \cdot x-scale} \]
        16. *-commutativeN/A

          \[\leadsto \color{blue}{x-scale \cdot a} \]
        17. lower-*.f6439.3

          \[\leadsto \color{blue}{x-scale \cdot a} \]
      10. Applied rewrites39.3%

        \[\leadsto \color{blue}{x-scale \cdot a} \]

      if 1.34999999999999999e244 < a

      1. Initial program 0.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 rewrites55.9%

        \[\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 \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\color{blue}{1}}^{2} \cdot \left(a \cdot a\right)\right)} \]
      7. Step-by-step derivation
        1. Applied rewrites55.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)}^{2}, b \cdot b, {\color{blue}{1}}^{2} \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}{{a}^{2}}} \]
        3. Step-by-step derivation
          1. unpow2N/A

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

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

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

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

      Alternative 4: 42.4% accurate, 46.1× speedup?

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

        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 rewrites20.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 \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.f6421.3

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

          \[\leadsto \color{blue}{0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
        9. Step-by-step derivation
          1. lift-*.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) \]
          2. lift-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) \]
          3. lift-sqrt.f64N/A

            \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
          4. lift-*.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) \]
          5. *-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{4}\right) \cdot \left(a \cdot x-scale\right) \]
          13. metadata-evalN/A

            \[\leadsto \color{blue}{1} \cdot \left(a \cdot x-scale\right) \]
          14. *-lft-identity21.5

            \[\leadsto \color{blue}{a \cdot x-scale} \]
          15. lift-*.f64N/A

            \[\leadsto \color{blue}{a \cdot x-scale} \]
          16. *-commutativeN/A

            \[\leadsto \color{blue}{x-scale \cdot a} \]
          17. lower-*.f6421.5

            \[\leadsto \color{blue}{x-scale \cdot a} \]
        10. Applied rewrites21.5%

          \[\leadsto \color{blue}{x-scale \cdot a} \]

        if 1.64999999999999998e-52 < b

        1. Initial program 2.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 b around inf

          \[\leadsto \color{blue}{\frac{1}{4} \cdot \left(\left(b \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{{\cos \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{x-scale}^{2}} - \frac{{\sin \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}}{{x-scale}^{2}} + \frac{{\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{{y-scale}^{2}}\right)}\right)} \]
        4. Applied rewrites16.0%

          \[\leadsto \color{blue}{\left(0.25 \cdot \left(b \cdot \left(x-scale \cdot \left(y-scale \cdot \sqrt{8}\right)\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{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale} - \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale \cdot y-scale}\right)}^{2}\right)} + \left(\frac{{\cos \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{x-scale \cdot x-scale} + \frac{{\sin \left(0.005555555555555556 \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}}{y-scale \cdot y-scale}\right)}} \]
        5. Applied rewrites16.9%

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

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

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

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

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

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

      Alternative 5: 42.5% accurate, 50.1× speedup?

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

        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.f6427.4

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

          \[\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-*.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) \]
          4. 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) \]
          5. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\left(\left(y-scale \cdot 4\right) \cdot 0.25\right) \cdot b} \]

        if 5.80000000000000035e40 < a < 1.34999999999999999e244

        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 rewrites30.3%

          \[\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.f6435.4

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

          \[\leadsto \color{blue}{0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
        9. Step-by-step derivation
          1. lift-*.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) \]
          2. lift-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) \]
          3. lift-sqrt.f64N/A

            \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
          4. lift-*.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) \]
          5. *-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{4}\right) \cdot \left(a \cdot x-scale\right) \]
          13. metadata-evalN/A

            \[\leadsto \color{blue}{1} \cdot \left(a \cdot x-scale\right) \]
          14. *-lft-identity35.7

            \[\leadsto \color{blue}{a \cdot x-scale} \]
          15. lift-*.f64N/A

            \[\leadsto \color{blue}{a \cdot x-scale} \]
          16. *-commutativeN/A

            \[\leadsto \color{blue}{x-scale \cdot a} \]
          17. lower-*.f6435.7

            \[\leadsto \color{blue}{x-scale \cdot a} \]
        10. Applied rewrites35.7%

          \[\leadsto \color{blue}{x-scale \cdot a} \]

        if 1.34999999999999999e244 < a

        1. Initial program 0.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 rewrites55.9%

          \[\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 \sqrt{2 \cdot \mathsf{fma}\left({\sin \left(\frac{1}{180} \cdot \left(angle \cdot \mathsf{PI}\left(\right)\right)\right)}^{2}, b \cdot b, {\color{blue}{1}}^{2} \cdot \left(a \cdot a\right)\right)} \]
        7. Step-by-step derivation
          1. Applied rewrites55.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)}^{2}, b \cdot b, {\color{blue}{1}}^{2} \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}{{a}^{2}}} \]
          3. Step-by-step derivation
            1. unpow2N/A

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

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

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

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.8 \cdot 10^{+40}:\\ \;\;\;\;b \cdot \left(0.25 \cdot \left(y-scale \cdot 4\right)\right)\\ \mathbf{elif}\;a \leq 1.35 \cdot 10^{+244}:\\ \;\;\;\;x-scale \cdot a\\ \mathbf{else}:\\ \;\;\;\;\left(0.25 \cdot \left(x-scale \cdot \sqrt{8}\right)\right) \cdot \sqrt{2 \cdot \left(a \cdot a\right)}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 6: 42.8% accurate, 132.1× speedup?

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

          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.f6427.4

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

            \[\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-*.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) \]
            4. 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) \]
            5. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \color{blue}{\left(\left(y-scale \cdot 4\right) \cdot 0.25\right) \cdot b} \]

          if 5.80000000000000035e40 < a

          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 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 rewrites35.5%

            \[\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.f6437.6

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

            \[\leadsto \color{blue}{0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
          9. Step-by-step derivation
            1. lift-*.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) \]
            2. lift-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) \]
            3. lift-sqrt.f64N/A

              \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
            4. lift-*.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) \]
            5. *-commutativeN/A

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

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

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

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

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

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

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

              \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{4}\right) \cdot \left(a \cdot x-scale\right) \]
            13. metadata-evalN/A

              \[\leadsto \color{blue}{1} \cdot \left(a \cdot x-scale\right) \]
            14. *-lft-identity37.8

              \[\leadsto \color{blue}{a \cdot x-scale} \]
            15. lift-*.f64N/A

              \[\leadsto \color{blue}{a \cdot x-scale} \]
            16. *-commutativeN/A

              \[\leadsto \color{blue}{x-scale \cdot a} \]
            17. lower-*.f6437.8

              \[\leadsto \color{blue}{x-scale \cdot a} \]
          10. Applied rewrites37.8%

            \[\leadsto \color{blue}{x-scale \cdot a} \]
        3. Recombined 2 regimes into one program.
        4. Final simplification29.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq 5.8 \cdot 10^{+40}:\\ \;\;\;\;b \cdot \left(0.25 \cdot \left(y-scale \cdot 4\right)\right)\\ \mathbf{else}:\\ \;\;\;\;x-scale \cdot a\\ \end{array} \]
        5. Add Preprocessing

        Alternative 7: 42.8% accurate, 242.0× speedup?

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

          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.f6427.4

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

            \[\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-*.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) \]
            4. 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) \]
            5. lift-*.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. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

              \[\leadsto \left(y-scale \cdot \color{blue}{1}\right) \cdot b \]
            3. *-rgt-identity27.6

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

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

          if 5.80000000000000035e40 < a

          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 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 rewrites35.5%

            \[\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.f6437.6

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

            \[\leadsto \color{blue}{0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
          9. Step-by-step derivation
            1. lift-*.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) \]
            2. lift-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) \]
            3. lift-sqrt.f64N/A

              \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
            4. lift-*.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) \]
            5. *-commutativeN/A

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

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

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

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

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

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

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

              \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{4}\right) \cdot \left(a \cdot x-scale\right) \]
            13. metadata-evalN/A

              \[\leadsto \color{blue}{1} \cdot \left(a \cdot x-scale\right) \]
            14. *-lft-identity37.8

              \[\leadsto \color{blue}{a \cdot x-scale} \]
            15. lift-*.f64N/A

              \[\leadsto \color{blue}{a \cdot x-scale} \]
            16. *-commutativeN/A

              \[\leadsto \color{blue}{x-scale \cdot a} \]
            17. lower-*.f6437.8

              \[\leadsto \color{blue}{x-scale \cdot a} \]
          10. Applied rewrites37.8%

            \[\leadsto \color{blue}{x-scale \cdot a} \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 8: 19.4% accurate, 484.7× speedup?

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

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

          \[\leadsto \color{blue}{0.25 \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \sqrt{8}\right)\right)} \]
        9. Step-by-step derivation
          1. lift-*.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) \]
          2. lift-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) \]
          3. lift-sqrt.f64N/A

            \[\leadsto \frac{1}{4} \cdot \left(\left(a \cdot x-scale\right) \cdot \left(\sqrt{2} \cdot \color{blue}{\sqrt{8}}\right)\right) \]
          4. lift-*.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) \]
          5. *-commutativeN/A

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

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

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

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

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

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

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

            \[\leadsto \left(\frac{1}{4} \cdot \color{blue}{4}\right) \cdot \left(a \cdot x-scale\right) \]
          13. metadata-evalN/A

            \[\leadsto \color{blue}{1} \cdot \left(a \cdot x-scale\right) \]
          14. *-lft-identity18.9

            \[\leadsto \color{blue}{a \cdot x-scale} \]
          15. lift-*.f64N/A

            \[\leadsto \color{blue}{a \cdot x-scale} \]
          16. *-commutativeN/A

            \[\leadsto \color{blue}{x-scale \cdot a} \]
          17. lower-*.f6418.9

            \[\leadsto \color{blue}{x-scale \cdot a} \]
        10. Applied rewrites18.9%

          \[\leadsto \color{blue}{x-scale \cdot a} \]
        11. Add Preprocessing

        Reproduce

        ?
        herbie shell --seed 2024216 
        (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))))