NMSE Section 6.1 mentioned, B

Percentage Accurate: 79.2% → 99.7%
Time: 8.1s
Alternatives: 7
Speedup: 2.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 7 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: 79.2% 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.7% accurate, 2.0× speedup?

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

\\
\frac{\frac{\mathsf{PI}\left(\right)}{b + a}}{\left(b \cdot a\right) \cdot 2}
\end{array}
Derivation
  1. Initial program 81.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. lift-/.f64N/A

      \[\leadsto \left(\color{blue}{\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) \]
    3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 86.2% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}\\ t_1 := \frac{0.5 \cdot \mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a}\\ \mathbf{if}\;a \leq -7.8 \cdot 10^{+31}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;a \leq -1020000000:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;a \leq -0.2:\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot a\right) \cdot b}\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-7} \lor \neg \left(a \leq 1.9 \cdot 10^{+284}\right):\\ \;\;\;\;t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (a b)
 :precision binary64
 (let* ((t_0 (* (PI) (/ 0.5 (* (* a b) b))))
        (t_1 (/ (* 0.5 (PI)) (* (* a b) a))))
   (if (<= a -7.8e+31)
     t_1
     (if (<= a -1020000000.0)
       t_0
       (if (<= a -0.2)
         (* (PI) (/ 0.5 (* (* a a) b)))
         (if (or (<= a 9.6e-7) (not (<= a 1.9e+284))) t_0 t_1))))))
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}\\
t_1 := \frac{0.5 \cdot \mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a}\\
\mathbf{if}\;a \leq -7.8 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;a \leq -1020000000:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;a \leq -0.2:\\
\;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot a\right) \cdot b}\\

\mathbf{elif}\;a \leq 9.6 \cdot 10^{-7} \lor \neg \left(a \leq 1.9 \cdot 10^{+284}\right):\\
\;\;\;\;t\_0\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if a < -7.79999999999999999e31 or 9.59999999999999914e-7 < a < 1.8999999999999999e284

    1. Initial program 79.3%

      \[\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 a around inf

      \[\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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

        if -7.79999999999999999e31 < a < -1.02e9 or -0.20000000000000001 < a < 9.59999999999999914e-7 or 1.8999999999999999e284 < a

        1. Initial program 82.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. 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. lift-/.f64N/A

            \[\leadsto \left(\color{blue}{\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) \]
          3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
        6. 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-*.f6470.5

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

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

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

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

            if -1.02e9 < a < -0.20000000000000001

            1. Initial program 100.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. Taylor expanded in a around inf

              \[\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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

                \[\leadsto \begin{array}{l} \mathbf{if}\;a \leq -7.8 \cdot 10^{+31}:\\ \;\;\;\;\frac{0.5 \cdot \mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a}\\ \mathbf{elif}\;a \leq -1020000000:\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}\\ \mathbf{elif}\;a \leq -0.2:\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot a\right) \cdot b}\\ \mathbf{elif}\;a \leq 9.6 \cdot 10^{-7} \lor \neg \left(a \leq 1.9 \cdot 10^{+284}\right):\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\frac{0.5 \cdot \mathsf{PI}\left(\right)}{\left(a \cdot b\right) \cdot a}\\ \end{array} \]
              5. Add Preprocessing

              Alternative 3: 81.5% accurate, 1.4× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;b \leq -0.000375 \lor \neg \left(b \leq -2.6 \cdot 10^{-300} \lor \neg \left(b \leq -7.2 \cdot 10^{-301} \lor \neg \left(b \leq 1.52 \cdot 10^{-37}\right)\right)\right):\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot a\right) \cdot b}\\ \end{array} \end{array} \]
              (FPCore (a b)
               :precision binary64
               (if (or (<= b -0.000375)
                       (not
                        (or (<= b -2.6e-300)
                            (not (or (<= b -7.2e-301) (not (<= b 1.52e-37)))))))
                 (* (PI) (/ 0.5 (* (* a b) b)))
                 (* (PI) (/ 0.5 (* (* a a) b)))))
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;b \leq -0.000375 \lor \neg \left(b \leq -2.6 \cdot 10^{-300} \lor \neg \left(b \leq -7.2 \cdot 10^{-301} \lor \neg \left(b \leq 1.52 \cdot 10^{-37}\right)\right)\right):\\
              \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot a\right) \cdot b}\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if b < -3.7500000000000001e-4 or -2.59999999999999997e-300 < b < -7.20000000000000015e-301 or 1.52e-37 < b

                1. Initial program 79.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. lift-/.f64N/A

                    \[\leadsto \left(\color{blue}{\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) \]
                  3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                6. 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-*.f6476.5

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

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

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

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

                    if -3.7500000000000001e-4 < b < -2.59999999999999997e-300 or -7.20000000000000015e-301 < b < 1.52e-37

                    1. Initial program 82.7%

                      \[\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 a around inf

                      \[\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. associate-/r*N/A

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

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

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

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

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

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

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

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

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

                        \[\leadsto \begin{array}{l} \mathbf{if}\;b \leq -0.000375 \lor \neg \left(b \leq -2.6 \cdot 10^{-300} \lor \neg \left(b \leq -7.2 \cdot 10^{-301} \lor \neg \left(b \leq 1.52 \cdot 10^{-37}\right)\right)\right):\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}\\ \mathbf{else}:\\ \;\;\;\;\mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot a\right) \cdot b}\\ \end{array} \]
                      5. Add Preprocessing

                      Alternative 4: 99.1% accurate, 2.4× speedup?

                      \[\begin{array}{l} \\ \frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot \left(2 \cdot \left(a \cdot b\right)\right)} \end{array} \]
                      (FPCore (a b) :precision binary64 (/ (PI) (* (+ a b) (* 2.0 (* a b)))))
                      \begin{array}{l}
                      
                      \\
                      \frac{\mathsf{PI}\left(\right)}{\left(a + b\right) \cdot \left(2 \cdot \left(a \cdot b\right)\right)}
                      \end{array}
                      
                      Derivation
                      1. Initial program 81.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. lift-/.f64N/A

                          \[\leadsto \left(\color{blue}{\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) \]
                        3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 5: 93.1% accurate, 2.4× speedup?

                      \[\begin{array}{l} \\ \frac{\mathsf{PI}\left(\right)}{\left(\left(a + b\right) \cdot b\right) \cdot \left(2 \cdot a\right)} \end{array} \]
                      (FPCore (a b) :precision binary64 (/ (PI) (* (* (+ a b) b) (* 2.0 a))))
                      \begin{array}{l}
                      
                      \\
                      \frac{\mathsf{PI}\left(\right)}{\left(\left(a + b\right) \cdot b\right) \cdot \left(2 \cdot a\right)}
                      \end{array}
                      
                      Derivation
                      1. Initial program 81.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. lift-/.f64N/A

                          \[\leadsto \left(\color{blue}{\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) \]
                        3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                      Alternative 6: 63.1% accurate, 2.6× speedup?

                      \[\begin{array}{l} \\ \frac{\mathsf{PI}\left(\right)}{\left(b \cdot a\right) \cdot b} \cdot 0.5 \end{array} \]
                      (FPCore (a b) :precision binary64 (* (/ (PI) (* (* b a) b)) 0.5))
                      \begin{array}{l}
                      
                      \\
                      \frac{\mathsf{PI}\left(\right)}{\left(b \cdot a\right) \cdot b} \cdot 0.5
                      \end{array}
                      
                      Derivation
                      1. Initial program 81.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. lift-/.f64N/A

                          \[\leadsto \left(\color{blue}{\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) \]
                        3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                      6. 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-*.f6453.8

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

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

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

                        Alternative 7: 63.1% accurate, 2.6× speedup?

                        \[\begin{array}{l} \\ \mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b} \end{array} \]
                        (FPCore (a b) :precision binary64 (* (PI) (/ 0.5 (* (* a b) b))))
                        \begin{array}{l}
                        
                        \\
                        \mathsf{PI}\left(\right) \cdot \frac{0.5}{\left(a \cdot b\right) \cdot b}
                        \end{array}
                        
                        Derivation
                        1. Initial program 81.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. lift-/.f64N/A

                            \[\leadsto \left(\color{blue}{\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) \]
                          3. lift-/.f64N/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \color{blue}{\frac{1}{2} \cdot \frac{\mathsf{PI}\left(\right)}{a \cdot {b}^{2}}} \]
                        6. 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-*.f6453.8

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

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

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

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

                            Reproduce

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