NMSE Section 6.1 mentioned, B

Percentage Accurate: 78.4% → 99.6%
Time: 8.8s
Alternatives: 12
Speedup: 1.4×

Specification

?
\[\begin{array}{l} \\ \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \end{array} \]
(FPCore (a b)
 :precision binary64
 (* (* (/ (PI) 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
\begin{array}{l}

\\
\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\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 12 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: 78.4% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \end{array} \]
(FPCore (a b)
 :precision binary64
 (* (* (/ (PI) 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))
\begin{array}{l}

\\
\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)
\end{array}

Alternative 1: 99.6% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \frac{\frac{0.5}{b - a}}{a \cdot b} \cdot \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \left(b - a\right)\right) \end{array} \]
(FPCore (a b)
 :precision binary64
 (* (/ (/ 0.5 (- b a)) (* a b)) (* (/ (PI) (+ a b)) (- b a))))
\begin{array}{l}

\\
\frac{\frac{0.5}{b - a}}{a \cdot b} \cdot \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \left(b - a\right)\right)
\end{array}
Derivation
  1. Initial program 79.5%

    \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
    2. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
    3. lift-*.f64N/A

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

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \]
    5. un-div-invN/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{b \cdot b - a \cdot a}} \]
    6. lift-/.f64N/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}}}{b \cdot b - a \cdot a} \]
    7. div-invN/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{b \cdot b - a \cdot a} \]
    8. lift--.f64N/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{b \cdot b - a \cdot a}} \]
    9. lift-*.f64N/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{b \cdot b} - a \cdot a} \]
    10. lift-*.f64N/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{b \cdot b - \color{blue}{a \cdot a}} \]
    11. difference-of-squaresN/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}} \]
    12. times-fracN/A

      \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{b + a} \cdot \frac{\frac{1}{2}}{b - a}\right)} \]
    13. associate-*r*N/A

      \[\leadsto \color{blue}{\left(\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right)}{b + a}\right) \cdot \frac{\frac{1}{2}}{b - a}} \]
    14. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right)}{b + a}\right) \cdot \frac{\frac{1}{2}}{b - a}} \]
  4. Applied rewrites88.1%

    \[\leadsto \color{blue}{\left(\frac{\frac{b - a}{a}}{b} \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right) \cdot \frac{0.5}{b - a}} \]
  5. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(\frac{\frac{b - a}{a}}{b} \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
    2. *-commutativeN/A

      \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \frac{\frac{b - a}{a}}{b}\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
    3. lift-/.f64N/A

      \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{a + b}} \cdot \frac{\frac{b - a}{a}}{b}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
    4. lift-/.f64N/A

      \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \color{blue}{\frac{\frac{b - a}{a}}{b}}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
    5. lift-/.f64N/A

      \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \frac{\color{blue}{\frac{b - a}{a}}}{b}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
    6. associate-/l/N/A

      \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \color{blue}{\frac{b - a}{b \cdot a}}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
    7. frac-timesN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
    8. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
    9. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
    10. lower-/.f64N/A

      \[\leadsto \color{blue}{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
    11. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
    12. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
    13. lower-*.f64N/A

      \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
    14. lower-*.f64N/A

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\color{blue}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
    15. *-commutativeN/A

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \color{blue}{\left(a \cdot b\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
    16. lower-*.f6498.1

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \color{blue}{\left(a \cdot b\right)}} \cdot \frac{0.5}{b - a} \]
  6. Applied rewrites98.1%

    \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(a \cdot b\right)}} \cdot \frac{0.5}{b - a} \]
  7. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(a \cdot b\right)} \cdot \frac{\frac{1}{2}}{b - a}} \]
    2. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(a \cdot b\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
    3. associate-*l/N/A

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

      \[\leadsto \frac{\left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right) \cdot \frac{\frac{1}{2}}{b - a}}{\color{blue}{\left(a + b\right) \cdot \left(a \cdot b\right)}} \]
    5. times-fracN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b}} \]
    6. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b}} \]
    7. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
    8. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
    9. associate-/l*N/A

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right)} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
    10. lower-*.f64N/A

      \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right)} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
    11. lower-/.f64N/A

      \[\leadsto \left(\left(b - a\right) \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{a + b}}\right) \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
    12. lower-/.f6499.6

      \[\leadsto \left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right) \cdot \color{blue}{\frac{\frac{0.5}{b - a}}{a \cdot b}} \]
  8. Applied rewrites99.6%

    \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right) \cdot \frac{\frac{0.5}{b - a}}{a \cdot b}} \]
  9. Final simplification99.6%

    \[\leadsto \frac{\frac{0.5}{b - a}}{a \cdot b} \cdot \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \left(b - a\right)\right) \]
  10. Add Preprocessing

Alternative 2: 77.9% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-136}:\\ \;\;\;\;\frac{\frac{0.5 \cdot \mathsf{PI}\left(\right)}{a \cdot b}}{a}\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{+83}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(a \cdot b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (if (<= b 3.5e-136)
   (/ (/ (* 0.5 (PI)) (* a b)) a)
   (if (<= b 3.3e+83)
     (/ (* (PI) (- b a)) (* (* (+ a b) (- b a)) (* 2.0 (* a b))))
     (/ (* (/ (PI) b) 0.5) (* a b)))))
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;b \leq 3.5 \cdot 10^{-136}:\\
\;\;\;\;\frac{\frac{0.5 \cdot \mathsf{PI}\left(\right)}{a \cdot b}}{a}\\

\mathbf{elif}\;b \leq 3.3 \cdot 10^{+83}:\\
\;\;\;\;\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(a \cdot b\right)\right)}\\

\mathbf{else}:\\
\;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if b < 3.50000000000000029e-136

    1. Initial program 77.1%

      \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    2. Add Preprocessing
    3. Taylor expanded in b around 0

      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
    4. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
      2. lower-*.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
      3. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
      4. lower-PI.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
      5. *-commutativeN/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
      6. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
      7. unpow2N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
      8. lower-*.f6458.6

        \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
    5. Applied rewrites58.6%

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
    6. Step-by-step derivation
      1. Applied rewrites68.9%

        \[\leadsto \frac{\frac{\mathsf{PI}\left(\right) \cdot 0.5}{a \cdot b}}{\color{blue}{a}} \]

      if 3.50000000000000029e-136 < b < 3.29999999999999985e83

      1. Initial program 94.9%

        \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
        3. lift--.f64N/A

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

          \[\leadsto \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
        5. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
        6. frac-subN/A

          \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
        7. lift-*.f64N/A

          \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
        8. lift-/.f64N/A

          \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
        9. lift-/.f64N/A

          \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \]
        10. frac-timesN/A

          \[\leadsto \frac{1 \cdot b - a \cdot 1}{a \cdot b} \cdot \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot 1}{2 \cdot \left(b \cdot b - a \cdot a\right)}} \]
        11. frac-timesN/A

          \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot 1\right)}{\left(a \cdot b\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)}} \]
        12. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\mathsf{PI}\left(\right) \cdot 1\right)}{\left(a \cdot b\right) \cdot \left(2 \cdot \left(b \cdot b - a \cdot a\right)\right)}} \]
      4. Applied rewrites88.6%

        \[\leadsto \color{blue}{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{\left(\left(a \cdot b\right) \cdot 2\right) \cdot \left(\left(a + b\right) \cdot \left(b - a\right)\right)}} \]

      if 3.29999999999999985e83 < b

      1. Initial program 72.0%

        \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
        2. *-commutativeN/A

          \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
        3. lift--.f64N/A

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

          \[\leadsto \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
        5. lift-/.f64N/A

          \[\leadsto \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
        6. frac-subN/A

          \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
        7. associate-*l/N/A

          \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
        8. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
      4. Applied rewrites74.6%

        \[\leadsto \color{blue}{\frac{\left(\left(b - a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-0.5}{\mathsf{fma}\left(-b, b, a \cdot a\right)}}{a \cdot b}} \]
      5. Taylor expanded in b around inf

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}}{a \cdot b} \]
      6. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b} \cdot \frac{1}{2}}}{a \cdot b} \]
        2. lower-*.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b} \cdot \frac{1}{2}}}{a \cdot b} \]
        3. lower-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b}} \cdot \frac{1}{2}}{a \cdot b} \]
        4. lower-PI.f6499.1

          \[\leadsto \frac{\frac{\color{blue}{\mathsf{PI}\left(\right)}}{b} \cdot 0.5}{a \cdot b} \]
      7. Applied rewrites99.1%

        \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}}{a \cdot b} \]
    7. Recombined 3 regimes into one program.
    8. Final simplification77.0%

      \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq 3.5 \cdot 10^{-136}:\\ \;\;\;\;\frac{\frac{0.5 \cdot \mathsf{PI}\left(\right)}{a \cdot b}}{a}\\ \mathbf{elif}\;b \leq 3.3 \cdot 10^{+83}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(\left(a + b\right) \cdot \left(b - a\right)\right) \cdot \left(2 \cdot \left(a \cdot b\right)\right)}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \end{array} \]
    9. Add Preprocessing

    Alternative 3: 98.9% accurate, 1.4× speedup?

    \[\begin{array}{l} \\ \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a \cdot b\right) \cdot \left(a + b\right)} \cdot \frac{0.5}{b - a} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (* (/ (* (PI) (- b a)) (* (* a b) (+ a b))) (/ 0.5 (- b a))))
    \begin{array}{l}
    
    \\
    \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a \cdot b\right) \cdot \left(a + b\right)} \cdot \frac{0.5}{b - a}
    \end{array}
    
    Derivation
    1. Initial program 79.5%

      \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
    2. Add Preprocessing
    3. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
      3. lift-*.f64N/A

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

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \]
      5. un-div-invN/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{b \cdot b - a \cdot a}} \]
      6. lift-/.f64N/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}}}{b \cdot b - a \cdot a} \]
      7. div-invN/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{b \cdot b - a \cdot a} \]
      8. lift--.f64N/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{b \cdot b - a \cdot a}} \]
      9. lift-*.f64N/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{b \cdot b} - a \cdot a} \]
      10. lift-*.f64N/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{b \cdot b - \color{blue}{a \cdot a}} \]
      11. difference-of-squaresN/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}} \]
      12. times-fracN/A

        \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{b + a} \cdot \frac{\frac{1}{2}}{b - a}\right)} \]
      13. associate-*r*N/A

        \[\leadsto \color{blue}{\left(\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right)}{b + a}\right) \cdot \frac{\frac{1}{2}}{b - a}} \]
      14. lower-*.f64N/A

        \[\leadsto \color{blue}{\left(\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right)}{b + a}\right) \cdot \frac{\frac{1}{2}}{b - a}} \]
    4. Applied rewrites88.1%

      \[\leadsto \color{blue}{\left(\frac{\frac{b - a}{a}}{b} \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right) \cdot \frac{0.5}{b - a}} \]
    5. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(\frac{\frac{b - a}{a}}{b} \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
      2. *-commutativeN/A

        \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \frac{\frac{b - a}{a}}{b}\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
      3. lift-/.f64N/A

        \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{a + b}} \cdot \frac{\frac{b - a}{a}}{b}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
      4. lift-/.f64N/A

        \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \color{blue}{\frac{\frac{b - a}{a}}{b}}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
      5. lift-/.f64N/A

        \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \frac{\color{blue}{\frac{b - a}{a}}}{b}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
      6. associate-/l/N/A

        \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \color{blue}{\frac{b - a}{b \cdot a}}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
      7. frac-timesN/A

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
      8. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
      9. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
      10. lower-/.f64N/A

        \[\leadsto \color{blue}{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
      11. lift-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
      12. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
      14. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\color{blue}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
      15. *-commutativeN/A

        \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \color{blue}{\left(a \cdot b\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
      16. lower-*.f6498.1

        \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \color{blue}{\left(a \cdot b\right)}} \cdot \frac{0.5}{b - a} \]
    6. Applied rewrites98.1%

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(a \cdot b\right)}} \cdot \frac{0.5}{b - a} \]
    7. Final simplification98.1%

      \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a \cdot b\right) \cdot \left(a + b\right)} \cdot \frac{0.5}{b - a} \]
    8. Add Preprocessing

    Alternative 4: 76.1% accurate, 1.7× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq 2.3 \cdot 10^{-66}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{\frac{0.5}{b - a}}{a \cdot b}\\ \end{array} \end{array} \]
    (FPCore (a b)
     :precision binary64
     (if (<= b 2.3e-66)
       (* (/ (PI) (* (* a b) a)) 0.5)
       (* (PI) (/ (/ 0.5 (- b a)) (* a b)))))
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;b \leq 2.3 \cdot 10^{-66}:\\
    \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5\\
    
    \mathbf{else}:\\
    \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{\frac{0.5}{b - a}}{a \cdot b}\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if b < 2.29999999999999992e-66

      1. Initial program 78.4%

        \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
      2. Add Preprocessing
      3. Taylor expanded in b around 0

        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
      4. Step-by-step derivation
        1. *-commutativeN/A

          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
        3. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
        4. lower-PI.f64N/A

          \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
        5. *-commutativeN/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
        6. lower-*.f64N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
        7. unpow2N/A

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
        8. lower-*.f6460.2

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
      5. Applied rewrites60.2%

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
      6. Step-by-step derivation
        1. Applied rewrites69.9%

          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5 \]

        if 2.29999999999999992e-66 < b

        1. Initial program 82.8%

          \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
          3. lift-*.f64N/A

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

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \color{blue}{\frac{1}{b \cdot b - a \cdot a}}\right) \]
          5. un-div-invN/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{b \cdot b - a \cdot a}} \]
          6. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{2}}}{b \cdot b - a \cdot a} \]
          7. div-invN/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{b \cdot b - a \cdot a} \]
          8. lift--.f64N/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{b \cdot b - a \cdot a}} \]
          9. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{b \cdot b} - a \cdot a} \]
          10. lift-*.f64N/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{b \cdot b - \color{blue}{a \cdot a}} \]
          11. difference-of-squaresN/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}{\color{blue}{\left(b + a\right) \cdot \left(b - a\right)}} \]
          12. times-fracN/A

            \[\leadsto \left(\frac{1}{a} - \frac{1}{b}\right) \cdot \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{b + a} \cdot \frac{\frac{1}{2}}{b - a}\right)} \]
          13. associate-*r*N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right)}{b + a}\right) \cdot \frac{\frac{1}{2}}{b - a}} \]
          14. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \frac{\mathsf{PI}\left(\right)}{b + a}\right) \cdot \frac{\frac{1}{2}}{b - a}} \]
        4. Applied rewrites74.5%

          \[\leadsto \color{blue}{\left(\frac{\frac{b - a}{a}}{b} \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right) \cdot \frac{0.5}{b - a}} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{\frac{b - a}{a}}{b} \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \frac{\frac{b - a}{a}}{b}\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
          3. lift-/.f64N/A

            \[\leadsto \left(\color{blue}{\frac{\mathsf{PI}\left(\right)}{a + b}} \cdot \frac{\frac{b - a}{a}}{b}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
          4. lift-/.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \color{blue}{\frac{\frac{b - a}{a}}{b}}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
          5. lift-/.f64N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \frac{\color{blue}{\frac{b - a}{a}}}{b}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
          6. associate-/l/N/A

            \[\leadsto \left(\frac{\mathsf{PI}\left(\right)}{a + b} \cdot \color{blue}{\frac{b - a}{b \cdot a}}\right) \cdot \frac{\frac{1}{2}}{b - a} \]
          7. frac-timesN/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
          8. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
          9. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
          10. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
          11. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
          12. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
          13. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{\left(a + b\right) \cdot \left(b \cdot a\right)} \cdot \frac{\frac{1}{2}}{b - a} \]
          14. lower-*.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\color{blue}{\left(a + b\right) \cdot \left(b \cdot a\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
          15. *-commutativeN/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \color{blue}{\left(a \cdot b\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
          16. lower-*.f6497.1

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \color{blue}{\left(a \cdot b\right)}} \cdot \frac{0.5}{b - a} \]
        6. Applied rewrites97.1%

          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(a \cdot b\right)}} \cdot \frac{0.5}{b - a} \]
        7. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(a \cdot b\right)} \cdot \frac{\frac{1}{2}}{b - a}} \]
          2. lift-/.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{\left(a + b\right) \cdot \left(a \cdot b\right)}} \cdot \frac{\frac{1}{2}}{b - a} \]
          3. associate-*l/N/A

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

            \[\leadsto \frac{\left(\mathsf{PI}\left(\right) \cdot \left(b - a\right)\right) \cdot \frac{\frac{1}{2}}{b - a}}{\color{blue}{\left(a + b\right) \cdot \left(a \cdot b\right)}} \]
          5. times-fracN/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b}} \]
          6. lower-*.f64N/A

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b}} \]
          7. lift-*.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(b - a\right)}}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
          8. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\left(b - a\right) \cdot \mathsf{PI}\left(\right)}}{a + b} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
          9. associate-/l*N/A

            \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right)} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
          10. lower-*.f64N/A

            \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right)} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
          11. lower-/.f64N/A

            \[\leadsto \left(\left(b - a\right) \cdot \color{blue}{\frac{\mathsf{PI}\left(\right)}{a + b}}\right) \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
          12. lower-/.f6499.6

            \[\leadsto \left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right) \cdot \color{blue}{\frac{\frac{0.5}{b - a}}{a \cdot b}} \]
        8. Applied rewrites99.6%

          \[\leadsto \color{blue}{\left(\left(b - a\right) \cdot \frac{\mathsf{PI}\left(\right)}{a + b}\right) \cdot \frac{\frac{0.5}{b - a}}{a \cdot b}} \]
        9. Taylor expanded in b around inf

          \[\leadsto \color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{\frac{\frac{1}{2}}{b - a}}{a \cdot b} \]
        10. Step-by-step derivation
          1. lower-PI.f6492.7

            \[\leadsto \color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{\frac{0.5}{b - a}}{a \cdot b} \]
        11. Applied rewrites92.7%

          \[\leadsto \color{blue}{\mathsf{PI}\left(\right)} \cdot \frac{\frac{0.5}{b - a}}{a \cdot b} \]
      7. Recombined 2 regimes into one program.
      8. Add Preprocessing

      Alternative 5: 75.3% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\ \end{array} \end{array} \]
      (FPCore (a b)
       :precision binary64
       (if (<= a -2.9e-62)
         (/ (* (/ (PI) a) 0.5) (* a b))
         (/ (* (/ (PI) b) 0.5) (* a b))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\
      \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}{a \cdot b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if a < -2.89999999999999986e-62

        1. Initial program 76.6%

          \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
          3. lift--.f64N/A

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

            \[\leadsto \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          5. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          6. frac-subN/A

            \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          7. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
        4. Applied rewrites84.1%

          \[\leadsto \color{blue}{\frac{\left(\left(b - a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-0.5}{\mathsf{fma}\left(-b, b, a \cdot a\right)}}{a \cdot b}} \]
        5. Taylor expanded in b around 0

          \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a}}}{a \cdot b} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a} \cdot \frac{1}{2}}}{a \cdot b} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a} \cdot \frac{1}{2}}}{a \cdot b} \]
          3. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a}} \cdot \frac{1}{2}}{a \cdot b} \]
          4. lower-PI.f6489.2

            \[\leadsto \frac{\frac{\color{blue}{\mathsf{PI}\left(\right)}}{a} \cdot 0.5}{a \cdot b} \]
        7. Applied rewrites89.2%

          \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}}{a \cdot b} \]

        if -2.89999999999999986e-62 < a

        1. Initial program 80.9%

          \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
          3. lift--.f64N/A

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

            \[\leadsto \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          5. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          6. frac-subN/A

            \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          7. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
        4. Applied rewrites83.6%

          \[\leadsto \color{blue}{\frac{\left(\left(b - a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-0.5}{\mathsf{fma}\left(-b, b, a \cdot a\right)}}{a \cdot b}} \]
        5. Taylor expanded in b around inf

          \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}}{a \cdot b} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b} \cdot \frac{1}{2}}}{a \cdot b} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b} \cdot \frac{1}{2}}}{a \cdot b} \]
          3. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b}} \cdot \frac{1}{2}}{a \cdot b} \]
          4. lower-PI.f6470.8

            \[\leadsto \frac{\frac{\color{blue}{\mathsf{PI}\left(\right)}}{b} \cdot 0.5}{a \cdot b} \]
        7. Applied rewrites70.8%

          \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{b} \cdot 0.5}}{a \cdot b} \]
      3. Recombined 2 regimes into one program.
      4. Add Preprocessing

      Alternative 6: 69.1% accurate, 1.8× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{a} \cdot \mathsf{PI}\left(\right)}{b \cdot b}\\ \end{array} \end{array} \]
      (FPCore (a b)
       :precision binary64
       (if (<= a -2.9e-62)
         (/ (* (/ (PI) a) 0.5) (* a b))
         (/ (* (/ 0.5 a) (PI)) (* b b))))
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\
      \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{0.5}{a} \cdot \mathsf{PI}\left(\right)}{b \cdot b}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if a < -2.89999999999999986e-62

        1. Initial program 76.6%

          \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right)} \]
          2. *-commutativeN/A

            \[\leadsto \color{blue}{\left(\frac{1}{a} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)} \]
          3. lift--.f64N/A

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

            \[\leadsto \left(\color{blue}{\frac{1}{a}} - \frac{1}{b}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          5. lift-/.f64N/A

            \[\leadsto \left(\frac{1}{a} - \color{blue}{\frac{1}{b}}\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          6. frac-subN/A

            \[\leadsto \color{blue}{\frac{1 \cdot b - a \cdot 1}{a \cdot b}} \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \]
          7. associate-*l/N/A

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
          8. lower-/.f64N/A

            \[\leadsto \color{blue}{\frac{\left(1 \cdot b - a \cdot 1\right) \cdot \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right)}{a \cdot b}} \]
        4. Applied rewrites84.1%

          \[\leadsto \color{blue}{\frac{\left(\left(b - a\right) \cdot \mathsf{PI}\left(\right)\right) \cdot \frac{-0.5}{\mathsf{fma}\left(-b, b, a \cdot a\right)}}{a \cdot b}} \]
        5. Taylor expanded in b around 0

          \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a}}}{a \cdot b} \]
        6. Step-by-step derivation
          1. *-commutativeN/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a} \cdot \frac{1}{2}}}{a \cdot b} \]
          2. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a} \cdot \frac{1}{2}}}{a \cdot b} \]
          3. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a}} \cdot \frac{1}{2}}{a \cdot b} \]
          4. lower-PI.f6489.2

            \[\leadsto \frac{\frac{\color{blue}{\mathsf{PI}\left(\right)}}{a} \cdot 0.5}{a \cdot b} \]
        7. Applied rewrites89.2%

          \[\leadsto \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}}{a \cdot b} \]

        if -2.89999999999999986e-62 < a

        1. Initial program 80.9%

          \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
        2. Add Preprocessing
        3. Taylor expanded in b around inf

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

            \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b} + \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a}}{{b}^{2}}} \]
          2. +-commutativeN/A

            \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}}{{b}^{2}} \]
          3. associate-*r/N/A

            \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{a}} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}{{b}^{2}} \]
          4. *-commutativeN/A

            \[\leadsto \frac{\frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{a} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}{{b}^{2}} \]
          5. associate-/l*N/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a}} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}{{b}^{2}} \]
          6. associate-*r/N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a} + \color{blue}{\frac{\frac{-1}{2} \cdot \mathsf{PI}\left(\right)}{b}}}{{b}^{2}} \]
          7. *-commutativeN/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a} + \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{-1}{2}}}{b}}{{b}^{2}} \]
          8. associate-/l*N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a} + \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{\frac{-1}{2}}{b}}}{{b}^{2}} \]
          9. distribute-lft-outN/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}}{{b}^{2}} \]
          10. lower-*.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}}{{b}^{2}} \]
          11. lower-PI.f64N/A

            \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}{{b}^{2}} \]
          12. lower-+.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}}{{b}^{2}} \]
          13. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\frac{\frac{1}{2}}{a}} + \frac{\frac{-1}{2}}{b}\right)}{{b}^{2}} \]
          14. lower-/.f64N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \color{blue}{\frac{\frac{-1}{2}}{b}}\right)}{{b}^{2}} \]
          15. unpow2N/A

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}{\color{blue}{b \cdot b}} \]
          16. lower-*.f6458.5

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\frac{0.5}{a} + \frac{-0.5}{b}\right)}{\color{blue}{b \cdot b}} \]
        5. Applied rewrites58.5%

          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(\frac{0.5}{a} + \frac{-0.5}{b}\right)}{b \cdot b}} \]
        6. Taylor expanded in b around inf

          \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a}}{b \cdot b} \]
        7. Step-by-step derivation
          1. Applied rewrites62.5%

            \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{0.5}{a}}{b \cdot b} \]
        8. Recombined 2 regimes into one program.
        9. Final simplification70.8%

          \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{\frac{\mathsf{PI}\left(\right)}{a} \cdot 0.5}{a \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{a} \cdot \mathsf{PI}\left(\right)}{b \cdot b}\\ \end{array} \]
        10. Add Preprocessing

        Alternative 7: 69.1% accurate, 1.8× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{0.5}{a \cdot b} \cdot \frac{\mathsf{PI}\left(\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{a} \cdot \mathsf{PI}\left(\right)}{b \cdot b}\\ \end{array} \end{array} \]
        (FPCore (a b)
         :precision binary64
         (if (<= a -2.9e-62)
           (* (/ 0.5 (* a b)) (/ (PI) a))
           (/ (* (/ 0.5 a) (PI)) (* b b))))
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\
        \;\;\;\;\frac{0.5}{a \cdot b} \cdot \frac{\mathsf{PI}\left(\right)}{a}\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{\frac{0.5}{a} \cdot \mathsf{PI}\left(\right)}{b \cdot b}\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if a < -2.89999999999999986e-62

          1. Initial program 76.6%

            \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
          2. Add Preprocessing
          3. Taylor expanded in b around 0

            \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
          4. Step-by-step derivation
            1. *-commutativeN/A

              \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
            2. lower-*.f64N/A

              \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
            3. lower-/.f64N/A

              \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
            4. lower-PI.f64N/A

              \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
            5. *-commutativeN/A

              \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
            6. lower-*.f64N/A

              \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
            7. unpow2N/A

              \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
            8. lower-*.f6474.9

              \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
          5. Applied rewrites74.9%

            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
          6. Step-by-step derivation
            1. Applied rewrites74.9%

              \[\leadsto \mathsf{PI}\left(\right) \cdot \color{blue}{\frac{0.5}{\left(a \cdot a\right) \cdot b}} \]
            2. Step-by-step derivation
              1. Applied rewrites89.2%

                \[\leadsto \frac{\mathsf{PI}\left(\right)}{a} \cdot \color{blue}{\frac{0.5}{a \cdot b}} \]

              if -2.89999999999999986e-62 < a

              1. Initial program 80.9%

                \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
              2. Add Preprocessing
              3. Taylor expanded in b around inf

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

                  \[\leadsto \color{blue}{\frac{\frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b} + \frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a}}{{b}^{2}}} \]
                2. +-commutativeN/A

                  \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}}{{b}^{2}} \]
                3. associate-*r/N/A

                  \[\leadsto \frac{\color{blue}{\frac{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}{a}} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}{{b}^{2}} \]
                4. *-commutativeN/A

                  \[\leadsto \frac{\frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{a} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}{{b}^{2}} \]
                5. associate-/l*N/A

                  \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a}} + \frac{-1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{b}}{{b}^{2}} \]
                6. associate-*r/N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a} + \color{blue}{\frac{\frac{-1}{2} \cdot \mathsf{PI}\left(\right)}{b}}}{{b}^{2}} \]
                7. *-commutativeN/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a} + \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{-1}{2}}}{b}}{{b}^{2}} \]
                8. associate-/l*N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a} + \color{blue}{\mathsf{PI}\left(\right) \cdot \frac{\frac{-1}{2}}{b}}}{{b}^{2}} \]
                9. distribute-lft-outN/A

                  \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}}{{b}^{2}} \]
                10. lower-*.f64N/A

                  \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}}{{b}^{2}} \]
                11. lower-PI.f64N/A

                  \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)} \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}{{b}^{2}} \]
                12. lower-+.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \color{blue}{\left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}}{{b}^{2}} \]
                13. lower-/.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\color{blue}{\frac{\frac{1}{2}}{a}} + \frac{\frac{-1}{2}}{b}\right)}{{b}^{2}} \]
                14. lower-/.f64N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \color{blue}{\frac{\frac{-1}{2}}{b}}\right)}{{b}^{2}} \]
                15. unpow2N/A

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\frac{\frac{1}{2}}{a} + \frac{\frac{-1}{2}}{b}\right)}{\color{blue}{b \cdot b}} \]
                16. lower-*.f6458.5

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \left(\frac{0.5}{a} + \frac{-0.5}{b}\right)}{\color{blue}{b \cdot b}} \]
              5. Applied rewrites58.5%

                \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right) \cdot \left(\frac{0.5}{a} + \frac{-0.5}{b}\right)}{b \cdot b}} \]
              6. Taylor expanded in b around inf

                \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{\frac{1}{2}}{a}}{b \cdot b} \]
              7. Step-by-step derivation
                1. Applied rewrites62.5%

                  \[\leadsto \frac{\mathsf{PI}\left(\right) \cdot \frac{0.5}{a}}{b \cdot b} \]
              8. Recombined 2 regimes into one program.
              9. Final simplification70.8%

                \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{0.5}{a \cdot b} \cdot \frac{\mathsf{PI}\left(\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{0.5}{a} \cdot \mathsf{PI}\left(\right)}{b \cdot b}\\ \end{array} \]
              10. Add Preprocessing

              Alternative 8: 69.2% accurate, 1.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{0.5}{a \cdot b} \cdot \frac{\mathsf{PI}\left(\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\ \end{array} \end{array} \]
              (FPCore (a b)
               :precision binary64
               (if (<= a -2.9e-62)
                 (* (/ 0.5 (* a b)) (/ (PI) a))
                 (* (/ (PI) (* (* b b) a)) 0.5)))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\
              \;\;\;\;\frac{0.5}{a \cdot b} \cdot \frac{\mathsf{PI}\left(\right)}{a}\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if a < -2.89999999999999986e-62

                1. Initial program 76.6%

                  \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                2. Add Preprocessing
                3. Taylor expanded in b around 0

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
                4. Step-by-step derivation
                  1. *-commutativeN/A

                    \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                  2. lower-*.f64N/A

                    \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                  3. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
                  4. lower-PI.f64N/A

                    \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                  6. lower-*.f64N/A

                    \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                  7. unpow2N/A

                    \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
                  8. lower-*.f6474.9

                    \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
                5. Applied rewrites74.9%

                  \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
                6. Step-by-step derivation
                  1. Applied rewrites74.9%

                    \[\leadsto \mathsf{PI}\left(\right) \cdot \color{blue}{\frac{0.5}{\left(a \cdot a\right) \cdot b}} \]
                  2. Step-by-step derivation
                    1. Applied rewrites89.2%

                      \[\leadsto \frac{\mathsf{PI}\left(\right)}{a} \cdot \color{blue}{\frac{0.5}{a \cdot b}} \]

                    if -2.89999999999999986e-62 < a

                    1. Initial program 80.9%

                      \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in b around inf

                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2}} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2}} \]
                      3. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \cdot \frac{1}{2} \]
                      4. lower-PI.f64N/A

                        \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
                      5. *-commutativeN/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{{b}^{2} \cdot a}} \cdot \frac{1}{2} \]
                      6. lower-*.f64N/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{{b}^{2} \cdot a}} \cdot \frac{1}{2} \]
                      7. unpow2N/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(b \cdot b\right)} \cdot a} \cdot \frac{1}{2} \]
                      8. lower-*.f6462.3

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(b \cdot b\right)} \cdot a} \cdot 0.5 \]
                    5. Applied rewrites62.3%

                      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5} \]
                  3. Recombined 2 regimes into one program.
                  4. Final simplification70.7%

                    \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{0.5}{a \cdot b} \cdot \frac{\mathsf{PI}\left(\right)}{a}\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\ \end{array} \]
                  5. Add Preprocessing

                  Alternative 9: 69.1% accurate, 2.2× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5\\ \mathbf{else}:\\ \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\ \end{array} \end{array} \]
                  (FPCore (a b)
                   :precision binary64
                   (if (<= a -2.9e-62)
                     (* (/ (PI) (* (* a b) a)) 0.5)
                     (* (/ (PI) (* (* b b) a)) 0.5)))
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;a \leq -2.9 \cdot 10^{-62}:\\
                  \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 2 regimes
                  2. if a < -2.89999999999999986e-62

                    1. Initial program 76.6%

                      \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in b around 0

                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                      3. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
                      4. lower-PI.f64N/A

                        \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                      5. *-commutativeN/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                      6. lower-*.f64N/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                      7. unpow2N/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
                      8. lower-*.f6474.9

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
                    5. Applied rewrites74.9%

                      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
                    6. Step-by-step derivation
                      1. Applied rewrites88.7%

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5 \]

                      if -2.89999999999999986e-62 < a

                      1. Initial program 80.9%

                        \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in b around inf

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2}} \]
                        2. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}} \cdot \frac{1}{2}} \]
                        3. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \cdot \frac{1}{2} \]
                        4. lower-PI.f64N/A

                          \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{a \cdot {b}^{2}} \cdot \frac{1}{2} \]
                        5. *-commutativeN/A

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{{b}^{2} \cdot a}} \cdot \frac{1}{2} \]
                        6. lower-*.f64N/A

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{{b}^{2} \cdot a}} \cdot \frac{1}{2} \]
                        7. unpow2N/A

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(b \cdot b\right)} \cdot a} \cdot \frac{1}{2} \]
                        8. lower-*.f6462.3

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{\left(b \cdot b\right)} \cdot a} \cdot 0.5 \]
                      5. Applied rewrites62.3%

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{\left(b \cdot b\right) \cdot a} \cdot 0.5} \]
                    7. Recombined 2 regimes into one program.
                    8. Add Preprocessing

                    Alternative 10: 62.4% accurate, 2.6× speedup?

                    \[\begin{array}{l} \\ \frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5 \end{array} \]
                    (FPCore (a b) :precision binary64 (* (/ (PI) (* (* a b) a)) 0.5))
                    \begin{array}{l}
                    
                    \\
                    \frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5
                    \end{array}
                    
                    Derivation
                    1. Initial program 79.5%

                      \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                    2. Add Preprocessing
                    3. Taylor expanded in b around 0

                      \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
                    4. Step-by-step derivation
                      1. *-commutativeN/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                      3. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
                      4. lower-PI.f64N/A

                        \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                      5. *-commutativeN/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                      6. lower-*.f64N/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                      7. unpow2N/A

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
                      8. lower-*.f6456.6

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
                    5. Applied rewrites56.6%

                      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
                    6. Step-by-step derivation
                      1. Applied rewrites63.8%

                        \[\leadsto \frac{\mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a} \cdot 0.5 \]
                      2. Add Preprocessing

                      Alternative 11: 62.4% accurate, 2.6× speedup?

                      \[\begin{array}{l} \\ \frac{0.5}{\left(a \cdot b\right) \cdot a} \cdot \mathsf{PI}\left(\right) \end{array} \]
                      (FPCore (a b) :precision binary64 (* (/ 0.5 (* (* a b) a)) (PI)))
                      \begin{array}{l}
                      
                      \\
                      \frac{0.5}{\left(a \cdot b\right) \cdot a} \cdot \mathsf{PI}\left(\right)
                      \end{array}
                      
                      Derivation
                      1. Initial program 79.5%

                        \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                      2. Add Preprocessing
                      3. Taylor expanded in b around 0

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
                      4. Step-by-step derivation
                        1. *-commutativeN/A

                          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                        2. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                        3. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
                        4. lower-PI.f64N/A

                          \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                        5. *-commutativeN/A

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                        6. lower-*.f64N/A

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                        7. unpow2N/A

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
                        8. lower-*.f6456.6

                          \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
                      5. Applied rewrites56.6%

                        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
                      6. Step-by-step derivation
                        1. Applied rewrites56.6%

                          \[\leadsto \mathsf{PI}\left(\right) \cdot \color{blue}{\frac{0.5}{\left(a \cdot a\right) \cdot b}} \]
                        2. Step-by-step derivation
                          1. Applied rewrites63.8%

                            \[\leadsto \mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot \color{blue}{a}} \]
                          2. Final simplification63.8%

                            \[\leadsto \frac{0.5}{\left(a \cdot b\right) \cdot a} \cdot \mathsf{PI}\left(\right) \]
                          3. Add Preprocessing

                          Alternative 12: 56.6% accurate, 2.6× speedup?

                          \[\begin{array}{l} \\ \frac{0.5}{\left(a \cdot a\right) \cdot b} \cdot \mathsf{PI}\left(\right) \end{array} \]
                          (FPCore (a b) :precision binary64 (* (/ 0.5 (* (* a a) b)) (PI)))
                          \begin{array}{l}
                          
                          \\
                          \frac{0.5}{\left(a \cdot a\right) \cdot b} \cdot \mathsf{PI}\left(\right)
                          \end{array}
                          
                          Derivation
                          1. Initial program 79.5%

                            \[\left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{1}{b \cdot b - a \cdot a}\right) \cdot \left(\frac{1}{a} - \frac{1}{b}\right) \]
                          2. Add Preprocessing
                          3. Taylor expanded in b around 0

                            \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \]
                          4. Step-by-step derivation
                            1. *-commutativeN/A

                              \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                            2. lower-*.f64N/A

                              \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b} \cdot \frac{1}{2}} \]
                            3. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{{a}^{2} \cdot b}} \cdot \frac{1}{2} \]
                            4. lower-PI.f64N/A

                              \[\leadsto \frac{\color{blue}{\mathsf{PI}\left(\right)}}{{a}^{2} \cdot b} \cdot \frac{1}{2} \]
                            5. *-commutativeN/A

                              \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                            6. lower-*.f64N/A

                              \[\leadsto \frac{\mathsf{PI}\left(\right)}{\color{blue}{b \cdot {a}^{2}}} \cdot \frac{1}{2} \]
                            7. unpow2N/A

                              \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot \frac{1}{2} \]
                            8. lower-*.f6456.6

                              \[\leadsto \frac{\mathsf{PI}\left(\right)}{b \cdot \color{blue}{\left(a \cdot a\right)}} \cdot 0.5 \]
                          5. Applied rewrites56.6%

                            \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{b \cdot \left(a \cdot a\right)} \cdot 0.5} \]
                          6. Step-by-step derivation
                            1. Applied rewrites56.6%

                              \[\leadsto \mathsf{PI}\left(\right) \cdot \color{blue}{\frac{0.5}{\left(a \cdot a\right) \cdot b}} \]
                            2. Final simplification56.6%

                              \[\leadsto \frac{0.5}{\left(a \cdot a\right) \cdot b} \cdot \mathsf{PI}\left(\right) \]
                            3. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024276 
                            (FPCore (a b)
                              :name "NMSE Section 6.1 mentioned, B"
                              :precision binary64
                              (* (* (/ (PI) 2.0) (/ 1.0 (- (* b b) (* a a)))) (- (/ 1.0 a) (/ 1.0 b))))