bug323 (missed optimization)

Percentage Accurate: 6.9% → 10.4%
Time: 2.9s
Alternatives: 9
Speedup: 1.0×

Specification

?
\[0 \leq x \land x \leq \frac{1}{2}\]
\[\cos^{-1} \left(1 - x\right) \]
(FPCore (x)
  :precision binary64
  (acos (- 1 x)))
double code(double x) {
	return acos((1.0 - x));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    code = acos((1.0d0 - x))
end function
public static double code(double x) {
	return Math.acos((1.0 - x));
}
def code(x):
	return math.acos((1.0 - x))
function code(x)
	return acos(Float64(1.0 - x))
end
function tmp = code(x)
	tmp = acos((1.0 - x));
end
code[x_] := N[ArcCos[N[(1 - x), $MachinePrecision]], $MachinePrecision]
\cos^{-1} \left(1 - x\right)

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 9 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: 6.9% accurate, 1.0× speedup?

\[\cos^{-1} \left(1 - x\right) \]
(FPCore (x)
  :precision binary64
  (acos (- 1 x)))
double code(double x) {
	return acos((1.0 - x));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x)
use fmin_fmax_functions
    real(8), intent (in) :: x
    code = acos((1.0d0 - x))
end function
public static double code(double x) {
	return Math.acos((1.0 - x));
}
def code(x):
	return math.acos((1.0 - x))
function code(x)
	return acos(Float64(1.0 - x))
end
function tmp = code(x)
	tmp = acos((1.0 - x));
end
code[x_] := N[ArcCos[N[(1 - x), $MachinePrecision]], $MachinePrecision]
\cos^{-1} \left(1 - x\right)

Alternative 1: 10.4% accurate, 0.1× speedup?

\[\begin{array}{l} t_0 := \frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\\ t_1 := \frac{7}{4} \cdot \left(\pi \cdot \pi\right)\\ t_2 := \sin^{-1} \left(x - 1\right) - \frac{t\_0}{t\_1}\\ t_3 := \frac{t\_0 \cdot t\_0}{\left(t\_1 \cdot t\_1\right) \cdot t\_2}\\ t_4 := \frac{{\sin^{-1} \left(1 - x\right)}^{2}}{t\_2}\\ \frac{t\_4 \cdot t\_4 - t\_3 \cdot t\_3}{t\_4 + t\_3} \end{array} \]
(FPCore (x)
  :precision binary64
  (let* ((t_0 (* 7/8 (* (* PI PI) PI)))
       (t_1 (* 7/4 (* PI PI)))
       (t_2 (- (asin (- x 1)) (/ t_0 t_1)))
       (t_3 (/ (* t_0 t_0) (* (* t_1 t_1) t_2)))
       (t_4 (/ (pow (asin (- 1 x)) 2) t_2)))
  (/ (- (* t_4 t_4) (* t_3 t_3)) (+ t_4 t_3))))
double code(double x) {
	double t_0 = 0.875 * ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI));
	double t_1 = 1.75 * (((double) M_PI) * ((double) M_PI));
	double t_2 = asin((x - 1.0)) - (t_0 / t_1);
	double t_3 = (t_0 * t_0) / ((t_1 * t_1) * t_2);
	double t_4 = pow(asin((1.0 - x)), 2.0) / t_2;
	return ((t_4 * t_4) - (t_3 * t_3)) / (t_4 + t_3);
}
public static double code(double x) {
	double t_0 = 0.875 * ((Math.PI * Math.PI) * Math.PI);
	double t_1 = 1.75 * (Math.PI * Math.PI);
	double t_2 = Math.asin((x - 1.0)) - (t_0 / t_1);
	double t_3 = (t_0 * t_0) / ((t_1 * t_1) * t_2);
	double t_4 = Math.pow(Math.asin((1.0 - x)), 2.0) / t_2;
	return ((t_4 * t_4) - (t_3 * t_3)) / (t_4 + t_3);
}
def code(x):
	t_0 = 0.875 * ((math.pi * math.pi) * math.pi)
	t_1 = 1.75 * (math.pi * math.pi)
	t_2 = math.asin((x - 1.0)) - (t_0 / t_1)
	t_3 = (t_0 * t_0) / ((t_1 * t_1) * t_2)
	t_4 = math.pow(math.asin((1.0 - x)), 2.0) / t_2
	return ((t_4 * t_4) - (t_3 * t_3)) / (t_4 + t_3)
function code(x)
	t_0 = Float64(0.875 * Float64(Float64(pi * pi) * pi))
	t_1 = Float64(1.75 * Float64(pi * pi))
	t_2 = Float64(asin(Float64(x - 1.0)) - Float64(t_0 / t_1))
	t_3 = Float64(Float64(t_0 * t_0) / Float64(Float64(t_1 * t_1) * t_2))
	t_4 = Float64((asin(Float64(1.0 - x)) ^ 2.0) / t_2)
	return Float64(Float64(Float64(t_4 * t_4) - Float64(t_3 * t_3)) / Float64(t_4 + t_3))
end
function tmp = code(x)
	t_0 = 0.875 * ((pi * pi) * pi);
	t_1 = 1.75 * (pi * pi);
	t_2 = asin((x - 1.0)) - (t_0 / t_1);
	t_3 = (t_0 * t_0) / ((t_1 * t_1) * t_2);
	t_4 = (asin((1.0 - x)) ^ 2.0) / t_2;
	tmp = ((t_4 * t_4) - (t_3 * t_3)) / (t_4 + t_3);
end
code[x_] := Block[{t$95$0 = N[(7/8 * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(7/4 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[ArcSin[N[(x - 1), $MachinePrecision]], $MachinePrecision] - N[(t$95$0 / t$95$1), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[(t$95$0 * t$95$0), $MachinePrecision] / N[(N[(t$95$1 * t$95$1), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$4 = N[(N[Power[N[ArcSin[N[(1 - x), $MachinePrecision]], $MachinePrecision], 2], $MachinePrecision] / t$95$2), $MachinePrecision]}, N[(N[(N[(t$95$4 * t$95$4), $MachinePrecision] - N[(t$95$3 * t$95$3), $MachinePrecision]), $MachinePrecision] / N[(t$95$4 + t$95$3), $MachinePrecision]), $MachinePrecision]]]]]]
\begin{array}{l}
t_0 := \frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\\
t_1 := \frac{7}{4} \cdot \left(\pi \cdot \pi\right)\\
t_2 := \sin^{-1} \left(x - 1\right) - \frac{t\_0}{t\_1}\\
t_3 := \frac{t\_0 \cdot t\_0}{\left(t\_1 \cdot t\_1\right) \cdot t\_2}\\
t_4 := \frac{{\sin^{-1} \left(1 - x\right)}^{2}}{t\_2}\\
\frac{t\_4 \cdot t\_4 - t\_3 \cdot t\_3}{t\_4 + t\_3}
\end{array}
Derivation
  1. Initial program 6.9%

    \[\cos^{-1} \left(1 - x\right) \]
  2. Step-by-step derivation
    1. lift-acos.f64N/A

      \[\leadsto \color{blue}{\cos^{-1} \left(1 - x\right)} \]
    2. acos-asinN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} - \sin^{-1} \left(1 - x\right)} \]
    3. sub-flipN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} + \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    4. +-commutativeN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}} \]
    5. sum-to-multN/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    6. lower-unsound-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    7. lower-unsound-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right)} \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    8. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    9. mult-flipN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    10. *-commutativeN/A

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

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    12. metadata-evalN/A

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

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \color{blue}{\pi}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    14. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    15. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    16. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    17. lower-asin.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    18. lower--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    19. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)} \]
    20. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right) \]
    21. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \color{blue}{\left(x - 1\right)} \]
  3. Applied rewrites6.9%

    \[\leadsto \color{blue}{\left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    2. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    3. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi \cdot \color{blue}{\left(1 - \frac{1}{2}\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    4. distribute-rgt-out--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{1 \cdot \pi - \frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    5. *-lft-identityN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi} - \frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    6. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    7. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi - \pi \cdot \color{blue}{\frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    8. mult-flipN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\frac{\pi}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    9. lift-PI.f64N/A

      \[\leadsto \left(1 + \frac{\pi - \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    10. flip3--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    11. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  5. Applied rewrites10.4%

    \[\leadsto \left(1 + \frac{\color{blue}{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
    2. lift-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right)} \cdot \sin^{-1} \left(x - 1\right) \]
    3. lift-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  7. Applied rewrites10.4%

    \[\leadsto \color{blue}{\frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}} \]
  8. Applied rewrites10.4%

    \[\leadsto \color{blue}{\frac{\frac{{\sin^{-1} \left(1 - x\right)}^{2}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}} \cdot \frac{{\sin^{-1} \left(1 - x\right)}^{2}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}} - \frac{\left(\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right) \cdot \left(\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right)}{\left(\left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot \left(\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}\right)} \cdot \frac{\left(\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right) \cdot \left(\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right)}{\left(\left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot \left(\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}\right)}}{\frac{{\sin^{-1} \left(1 - x\right)}^{2}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}} + \frac{\left(\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right) \cdot \left(\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right)}{\left(\left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right) \cdot \left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right)\right) \cdot \left(\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}\right)}}} \]
  9. Add Preprocessing

Alternative 2: 10.4% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \left(\pi \cdot \pi\right) \cdot \pi\\ t_1 := \frac{7}{8} \cdot t\_0\\ t_2 := \frac{7}{4} \cdot \left(\pi \cdot \pi\right)\\ \frac{\frac{{\sin^{-1} \left(1 - x\right)}^{2} \cdot t\_2 - \frac{t\_1}{t\_2} \cdot t\_1}{t\_2}}{\sin^{-1} \left(x - 1\right) - \frac{t\_0 - \frac{1}{8} \cdot t\_0}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \end{array} \]
(FPCore (x)
  :precision binary64
  (let* ((t_0 (* (* PI PI) PI))
       (t_1 (* 7/8 t_0))
       (t_2 (* 7/4 (* PI PI))))
  (/
   (/ (- (* (pow (asin (- 1 x)) 2) t_2) (* (/ t_1 t_2) t_1)) t_2)
   (-
    (asin (- x 1))
    (/ (- t_0 (* 1/8 t_0)) (+ (* (* PI PI) 3/4) (* PI PI)))))))
double code(double x) {
	double t_0 = (((double) M_PI) * ((double) M_PI)) * ((double) M_PI);
	double t_1 = 0.875 * t_0;
	double t_2 = 1.75 * (((double) M_PI) * ((double) M_PI));
	return (((pow(asin((1.0 - x)), 2.0) * t_2) - ((t_1 / t_2) * t_1)) / t_2) / (asin((x - 1.0)) - ((t_0 - (0.125 * t_0)) / (((((double) M_PI) * ((double) M_PI)) * 0.75) + (((double) M_PI) * ((double) M_PI)))));
}
public static double code(double x) {
	double t_0 = (Math.PI * Math.PI) * Math.PI;
	double t_1 = 0.875 * t_0;
	double t_2 = 1.75 * (Math.PI * Math.PI);
	return (((Math.pow(Math.asin((1.0 - x)), 2.0) * t_2) - ((t_1 / t_2) * t_1)) / t_2) / (Math.asin((x - 1.0)) - ((t_0 - (0.125 * t_0)) / (((Math.PI * Math.PI) * 0.75) + (Math.PI * Math.PI))));
}
def code(x):
	t_0 = (math.pi * math.pi) * math.pi
	t_1 = 0.875 * t_0
	t_2 = 1.75 * (math.pi * math.pi)
	return (((math.pow(math.asin((1.0 - x)), 2.0) * t_2) - ((t_1 / t_2) * t_1)) / t_2) / (math.asin((x - 1.0)) - ((t_0 - (0.125 * t_0)) / (((math.pi * math.pi) * 0.75) + (math.pi * math.pi))))
function code(x)
	t_0 = Float64(Float64(pi * pi) * pi)
	t_1 = Float64(0.875 * t_0)
	t_2 = Float64(1.75 * Float64(pi * pi))
	return Float64(Float64(Float64(Float64((asin(Float64(1.0 - x)) ^ 2.0) * t_2) - Float64(Float64(t_1 / t_2) * t_1)) / t_2) / Float64(asin(Float64(x - 1.0)) - Float64(Float64(t_0 - Float64(0.125 * t_0)) / Float64(Float64(Float64(pi * pi) * 0.75) + Float64(pi * pi)))))
end
function tmp = code(x)
	t_0 = (pi * pi) * pi;
	t_1 = 0.875 * t_0;
	t_2 = 1.75 * (pi * pi);
	tmp = ((((asin((1.0 - x)) ^ 2.0) * t_2) - ((t_1 / t_2) * t_1)) / t_2) / (asin((x - 1.0)) - ((t_0 - (0.125 * t_0)) / (((pi * pi) * 0.75) + (pi * pi))));
end
code[x_] := Block[{t$95$0 = N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]}, Block[{t$95$1 = N[(7/8 * t$95$0), $MachinePrecision]}, Block[{t$95$2 = N[(7/4 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[Power[N[ArcSin[N[(1 - x), $MachinePrecision]], $MachinePrecision], 2], $MachinePrecision] * t$95$2), $MachinePrecision] - N[(N[(t$95$1 / t$95$2), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision] / t$95$2), $MachinePrecision] / N[(N[ArcSin[N[(x - 1), $MachinePrecision]], $MachinePrecision] - N[(N[(t$95$0 - N[(1/8 * t$95$0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(Pi * Pi), $MachinePrecision] * 3/4), $MachinePrecision] + N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_0 := \left(\pi \cdot \pi\right) \cdot \pi\\
t_1 := \frac{7}{8} \cdot t\_0\\
t_2 := \frac{7}{4} \cdot \left(\pi \cdot \pi\right)\\
\frac{\frac{{\sin^{-1} \left(1 - x\right)}^{2} \cdot t\_2 - \frac{t\_1}{t\_2} \cdot t\_1}{t\_2}}{\sin^{-1} \left(x - 1\right) - \frac{t\_0 - \frac{1}{8} \cdot t\_0}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}
\end{array}
Derivation
  1. Initial program 6.9%

    \[\cos^{-1} \left(1 - x\right) \]
  2. Step-by-step derivation
    1. lift-acos.f64N/A

      \[\leadsto \color{blue}{\cos^{-1} \left(1 - x\right)} \]
    2. acos-asinN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} - \sin^{-1} \left(1 - x\right)} \]
    3. sub-flipN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} + \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    4. +-commutativeN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}} \]
    5. sum-to-multN/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    6. lower-unsound-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    7. lower-unsound-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right)} \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    8. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    9. mult-flipN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    10. *-commutativeN/A

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

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    12. metadata-evalN/A

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

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \color{blue}{\pi}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    14. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    15. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    16. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    17. lower-asin.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    18. lower--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    19. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)} \]
    20. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right) \]
    21. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \color{blue}{\left(x - 1\right)} \]
  3. Applied rewrites6.9%

    \[\leadsto \color{blue}{\left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    2. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    3. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi \cdot \color{blue}{\left(1 - \frac{1}{2}\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    4. distribute-rgt-out--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{1 \cdot \pi - \frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    5. *-lft-identityN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi} - \frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    6. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    7. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi - \pi \cdot \color{blue}{\frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    8. mult-flipN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\frac{\pi}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    9. lift-PI.f64N/A

      \[\leadsto \left(1 + \frac{\pi - \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    10. flip3--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    11. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  5. Applied rewrites10.4%

    \[\leadsto \left(1 + \frac{\color{blue}{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
    2. lift-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right)} \cdot \sin^{-1} \left(x - 1\right) \]
    3. lift-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  7. Applied rewrites10.4%

    \[\leadsto \color{blue}{\frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}} \]
  8. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \frac{\color{blue}{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \color{blue}{\frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
  9. Applied rewrites10.4%

    \[\leadsto \frac{\color{blue}{\frac{{\sin^{-1} \left(1 - x\right)}^{2} \cdot \left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \left(\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
  10. Add Preprocessing

Alternative 3: 10.4% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \sin^{-1} \left(x - 1\right)\\ t_1 := \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}\\ \frac{t\_0 \cdot t\_0 - t\_1 \cdot t\_1}{t\_0 - t\_1} \end{array} \]
(FPCore (x)
  :precision binary64
  (let* ((t_0 (asin (- x 1)))
       (t_1 (/ (* 7/8 (* (* PI PI) PI)) (* 7/4 (* PI PI)))))
  (/ (- (* t_0 t_0) (* t_1 t_1)) (- t_0 t_1))))
double code(double x) {
	double t_0 = asin((x - 1.0));
	double t_1 = (0.875 * ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI))) / (1.75 * (((double) M_PI) * ((double) M_PI)));
	return ((t_0 * t_0) - (t_1 * t_1)) / (t_0 - t_1);
}
public static double code(double x) {
	double t_0 = Math.asin((x - 1.0));
	double t_1 = (0.875 * ((Math.PI * Math.PI) * Math.PI)) / (1.75 * (Math.PI * Math.PI));
	return ((t_0 * t_0) - (t_1 * t_1)) / (t_0 - t_1);
}
def code(x):
	t_0 = math.asin((x - 1.0))
	t_1 = (0.875 * ((math.pi * math.pi) * math.pi)) / (1.75 * (math.pi * math.pi))
	return ((t_0 * t_0) - (t_1 * t_1)) / (t_0 - t_1)
function code(x)
	t_0 = asin(Float64(x - 1.0))
	t_1 = Float64(Float64(0.875 * Float64(Float64(pi * pi) * pi)) / Float64(1.75 * Float64(pi * pi)))
	return Float64(Float64(Float64(t_0 * t_0) - Float64(t_1 * t_1)) / Float64(t_0 - t_1))
end
function tmp = code(x)
	t_0 = asin((x - 1.0));
	t_1 = (0.875 * ((pi * pi) * pi)) / (1.75 * (pi * pi));
	tmp = ((t_0 * t_0) - (t_1 * t_1)) / (t_0 - t_1);
end
code[x_] := Block[{t$95$0 = N[ArcSin[N[(x - 1), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[(7/8 * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] / N[(7/4 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(t$95$1 * t$95$1), $MachinePrecision]), $MachinePrecision] / N[(t$95$0 - t$95$1), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \sin^{-1} \left(x - 1\right)\\
t_1 := \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}\\
\frac{t\_0 \cdot t\_0 - t\_1 \cdot t\_1}{t\_0 - t\_1}
\end{array}
Derivation
  1. Initial program 6.9%

    \[\cos^{-1} \left(1 - x\right) \]
  2. Step-by-step derivation
    1. lift-acos.f64N/A

      \[\leadsto \color{blue}{\cos^{-1} \left(1 - x\right)} \]
    2. acos-asinN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} - \sin^{-1} \left(1 - x\right)} \]
    3. sub-flipN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} + \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    4. +-commutativeN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}} \]
    5. sum-to-multN/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    6. lower-unsound-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    7. lower-unsound-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right)} \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    8. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    9. mult-flipN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    10. *-commutativeN/A

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

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    12. metadata-evalN/A

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

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \color{blue}{\pi}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    14. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    15. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    16. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    17. lower-asin.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    18. lower--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    19. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)} \]
    20. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right) \]
    21. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \color{blue}{\left(x - 1\right)} \]
  3. Applied rewrites6.9%

    \[\leadsto \color{blue}{\left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    2. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    3. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi \cdot \color{blue}{\left(1 - \frac{1}{2}\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    4. distribute-rgt-out--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{1 \cdot \pi - \frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    5. *-lft-identityN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi} - \frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    6. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    7. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi - \pi \cdot \color{blue}{\frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    8. mult-flipN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\frac{\pi}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    9. lift-PI.f64N/A

      \[\leadsto \left(1 + \frac{\pi - \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    10. flip3--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    11. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  5. Applied rewrites10.4%

    \[\leadsto \left(1 + \frac{\color{blue}{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
    2. lift-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right)} \cdot \sin^{-1} \left(x - 1\right) \]
    3. lift-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  7. Applied rewrites10.4%

    \[\leadsto \color{blue}{\frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}} \]
  8. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \color{blue}{\frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    3. fp-cancel-sub-sign-invN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\pi \cdot \pi\right) \cdot \pi + \left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    4. distribute-rgt1-inN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    5. lower-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    6. metadata-evalN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\color{blue}{\frac{-1}{8}} + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    7. metadata-eval10.4%

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\frac{7}{8}} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    8. lift-+.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    9. lift-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4}} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    10. *-commutativeN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\frac{3}{4} \cdot \left(\pi \cdot \pi\right)} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    11. distribute-lft1-inN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\frac{3}{4} + 1\right) \cdot \left(\pi \cdot \pi\right)}} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    12. lower-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\frac{3}{4} + 1\right) \cdot \left(\pi \cdot \pi\right)}} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    13. metadata-eval10.4%

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\frac{7}{4}} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
  9. Applied rewrites10.4%

    \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \color{blue}{\frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
  10. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\color{blue}{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \color{blue}{\frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    3. fp-cancel-sub-sign-invN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\color{blue}{\left(\pi \cdot \pi\right) \cdot \pi + \left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    4. distribute-rgt1-inN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    5. lower-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    6. metadata-evalN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\left(\color{blue}{\frac{-1}{8}} + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    7. metadata-eval10.4%

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\color{blue}{\frac{7}{8}} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    8. lift-+.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    9. lift-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4}} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    10. *-commutativeN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\frac{3}{4} \cdot \left(\pi \cdot \pi\right)} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    11. distribute-lft1-inN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\frac{3}{4} + 1\right) \cdot \left(\pi \cdot \pi\right)}}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    12. lower-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\frac{3}{4} + 1\right) \cdot \left(\pi \cdot \pi\right)}}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    13. metadata-eval10.4%

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\frac{7}{4}} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
  11. Applied rewrites10.4%

    \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \color{blue}{\frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
  12. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \color{blue}{\frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    3. fp-cancel-sub-sign-invN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\pi \cdot \pi\right) \cdot \pi + \left(\mathsf{neg}\left(\frac{1}{8}\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    4. distribute-rgt1-inN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    5. lower-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\left(\left(\mathsf{neg}\left(\frac{1}{8}\right)\right) + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    6. metadata-evalN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\color{blue}{\frac{-1}{8}} + 1\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    7. metadata-eval10.4%

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\color{blue}{\frac{7}{8}} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}} \]
    8. lift-+.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}} \]
    9. lift-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4}} + \pi \cdot \pi}} \]
    10. *-commutativeN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\frac{3}{4} \cdot \left(\pi \cdot \pi\right)} + \pi \cdot \pi}} \]
    11. distribute-lft1-inN/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\frac{3}{4} + 1\right) \cdot \left(\pi \cdot \pi\right)}}} \]
    12. lower-*.f64N/A

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\left(\frac{3}{4} + 1\right) \cdot \left(\pi \cdot \pi\right)}}} \]
    13. metadata-eval10.4%

      \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\color{blue}{\frac{7}{4}} \cdot \left(\pi \cdot \pi\right)}} \]
  13. Applied rewrites10.4%

    \[\leadsto \frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} \cdot \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}{\sin^{-1} \left(x - 1\right) - \color{blue}{\frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}}} \]
  14. Add Preprocessing

Alternative 4: 10.4% accurate, 0.7× speedup?

\[\begin{array}{l} t_0 := \frac{7}{4} \cdot \left(\pi \cdot \pi\right)\\ \frac{t\_0 \cdot \sin^{-1} \left(x - 1\right) + \frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{t\_0} \end{array} \]
(FPCore (x)
  :precision binary64
  (let* ((t_0 (* 7/4 (* PI PI))))
  (/ (+ (* t_0 (asin (- x 1))) (* 7/8 (* (* PI PI) PI))) t_0)))
double code(double x) {
	double t_0 = 1.75 * (((double) M_PI) * ((double) M_PI));
	return ((t_0 * asin((x - 1.0))) + (0.875 * ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI)))) / t_0;
}
public static double code(double x) {
	double t_0 = 1.75 * (Math.PI * Math.PI);
	return ((t_0 * Math.asin((x - 1.0))) + (0.875 * ((Math.PI * Math.PI) * Math.PI))) / t_0;
}
def code(x):
	t_0 = 1.75 * (math.pi * math.pi)
	return ((t_0 * math.asin((x - 1.0))) + (0.875 * ((math.pi * math.pi) * math.pi))) / t_0
function code(x)
	t_0 = Float64(1.75 * Float64(pi * pi))
	return Float64(Float64(Float64(t_0 * asin(Float64(x - 1.0))) + Float64(0.875 * Float64(Float64(pi * pi) * pi))) / t_0)
end
function tmp = code(x)
	t_0 = 1.75 * (pi * pi);
	tmp = ((t_0 * asin((x - 1.0))) + (0.875 * ((pi * pi) * pi))) / t_0;
end
code[x_] := Block[{t$95$0 = N[(7/4 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(t$95$0 * N[ArcSin[N[(x - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(7/8 * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := \frac{7}{4} \cdot \left(\pi \cdot \pi\right)\\
\frac{t\_0 \cdot \sin^{-1} \left(x - 1\right) + \frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{t\_0}
\end{array}
Derivation
  1. Initial program 6.9%

    \[\cos^{-1} \left(1 - x\right) \]
  2. Step-by-step derivation
    1. lift-acos.f64N/A

      \[\leadsto \color{blue}{\cos^{-1} \left(1 - x\right)} \]
    2. acos-asinN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} - \sin^{-1} \left(1 - x\right)} \]
    3. sub-flipN/A

      \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} + \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    4. +-commutativeN/A

      \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}} \]
    5. sum-to-multN/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    6. lower-unsound-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
    7. lower-unsound-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right)} \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    8. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    9. mult-flipN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    10. *-commutativeN/A

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

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    12. metadata-evalN/A

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

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \color{blue}{\pi}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    14. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    15. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    16. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    17. lower-asin.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    18. lower--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
    19. asin-neg-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)} \]
    20. lift--.f64N/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right) \]
    21. sub-negate-revN/A

      \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \color{blue}{\left(x - 1\right)} \]
  3. Applied rewrites6.9%

    \[\leadsto \color{blue}{\left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
  4. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    2. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    3. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi \cdot \color{blue}{\left(1 - \frac{1}{2}\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    4. distribute-rgt-out--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{1 \cdot \pi - \frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    5. *-lft-identityN/A

      \[\leadsto \left(1 + \frac{\color{blue}{\pi} - \frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    6. *-commutativeN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    7. metadata-evalN/A

      \[\leadsto \left(1 + \frac{\pi - \pi \cdot \color{blue}{\frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    8. mult-flipN/A

      \[\leadsto \left(1 + \frac{\pi - \color{blue}{\frac{\pi}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    9. lift-PI.f64N/A

      \[\leadsto \left(1 + \frac{\pi - \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    10. flip3--N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    11. lower-unsound-/.f64N/A

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  5. Applied rewrites10.4%

    \[\leadsto \left(1 + \frac{\color{blue}{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
    2. lift-+.f64N/A

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right)} \cdot \sin^{-1} \left(x - 1\right) \]
    3. lift-/.f64N/A

      \[\leadsto \left(1 + \color{blue}{\frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \sin^{-1} \left(x - 1\right) \]
  7. Applied rewrites10.4%

    \[\leadsto \color{blue}{\frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}} \]
  8. Step-by-step derivation
    1. Applied rewrites10.4%

      \[\leadsto \color{blue}{\frac{\left(\frac{7}{4} \cdot \left(\pi \cdot \pi\right)\right) \cdot \sin^{-1} \left(x - 1\right) + \frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)}} \]
    2. Add Preprocessing

    Alternative 5: 10.4% accurate, 0.7× speedup?

    \[\frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} + \sin^{-1} \left(x - 1\right) \]
    (FPCore (x)
      :precision binary64
      (+ (/ (* 7/8 (* (* PI PI) PI)) (* 7/4 (* PI PI))) (asin (- x 1))))
    double code(double x) {
    	return ((0.875 * ((((double) M_PI) * ((double) M_PI)) * ((double) M_PI))) / (1.75 * (((double) M_PI) * ((double) M_PI)))) + asin((x - 1.0));
    }
    
    public static double code(double x) {
    	return ((0.875 * ((Math.PI * Math.PI) * Math.PI)) / (1.75 * (Math.PI * Math.PI))) + Math.asin((x - 1.0));
    }
    
    def code(x):
    	return ((0.875 * ((math.pi * math.pi) * math.pi)) / (1.75 * (math.pi * math.pi))) + math.asin((x - 1.0))
    
    function code(x)
    	return Float64(Float64(Float64(0.875 * Float64(Float64(pi * pi) * pi)) / Float64(1.75 * Float64(pi * pi))) + asin(Float64(x - 1.0)))
    end
    
    function tmp = code(x)
    	tmp = ((0.875 * ((pi * pi) * pi)) / (1.75 * (pi * pi))) + asin((x - 1.0));
    end
    
    code[x_] := N[(N[(N[(7/8 * N[(N[(Pi * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision] / N[(7/4 * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[ArcSin[N[(x - 1), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
    
    \frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} + \sin^{-1} \left(x - 1\right)
    
    Derivation
    1. Initial program 6.9%

      \[\cos^{-1} \left(1 - x\right) \]
    2. Step-by-step derivation
      1. lift-acos.f64N/A

        \[\leadsto \color{blue}{\cos^{-1} \left(1 - x\right)} \]
      2. acos-asinN/A

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} - \sin^{-1} \left(1 - x\right)} \]
      3. sub-flipN/A

        \[\leadsto \color{blue}{\frac{\mathsf{PI}\left(\right)}{2} + \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
      4. +-commutativeN/A

        \[\leadsto \color{blue}{\left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}} \]
      5. sum-to-multN/A

        \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
      6. lower-unsound-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right)} \]
      7. lower-unsound-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right)} \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      8. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{\frac{\mathsf{PI}\left(\right)}{2}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      9. mult-flipN/A

        \[\leadsto \left(1 + \frac{\color{blue}{\mathsf{PI}\left(\right) \cdot \frac{1}{2}}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      10. *-commutativeN/A

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

        \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \mathsf{PI}\left(\right)}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      12. metadata-evalN/A

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

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \color{blue}{\pi}}{\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      14. asin-neg-revN/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      15. lift--.f64N/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right)}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      16. sub-negate-revN/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      17. lower-asin.f64N/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\color{blue}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      18. lower--.f64N/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \color{blue}{\left(x - 1\right)}}\right) \cdot \left(\mathsf{neg}\left(\sin^{-1} \left(1 - x\right)\right)\right) \]
      19. asin-neg-revN/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \color{blue}{\sin^{-1} \left(\mathsf{neg}\left(\left(1 - x\right)\right)\right)} \]
      20. lift--.f64N/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(\mathsf{neg}\left(\color{blue}{\left(1 - x\right)}\right)\right) \]
      21. sub-negate-revN/A

        \[\leadsto \left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \color{blue}{\left(x - 1\right)} \]
    3. Applied rewrites6.9%

      \[\leadsto \color{blue}{\left(1 + \frac{\frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
    4. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \left(1 + \frac{\color{blue}{\frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      2. *-commutativeN/A

        \[\leadsto \left(1 + \frac{\color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      3. metadata-evalN/A

        \[\leadsto \left(1 + \frac{\pi \cdot \color{blue}{\left(1 - \frac{1}{2}\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      4. distribute-rgt-out--N/A

        \[\leadsto \left(1 + \frac{\color{blue}{1 \cdot \pi - \frac{1}{2} \cdot \pi}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      5. *-lft-identityN/A

        \[\leadsto \left(1 + \frac{\color{blue}{\pi} - \frac{1}{2} \cdot \pi}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      6. *-commutativeN/A

        \[\leadsto \left(1 + \frac{\pi - \color{blue}{\pi \cdot \frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      7. metadata-evalN/A

        \[\leadsto \left(1 + \frac{\pi - \pi \cdot \color{blue}{\frac{1}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      8. mult-flipN/A

        \[\leadsto \left(1 + \frac{\pi - \color{blue}{\frac{\pi}{2}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      9. lift-PI.f64N/A

        \[\leadsto \left(1 + \frac{\pi - \frac{\color{blue}{\mathsf{PI}\left(\right)}}{2}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      10. flip3--N/A

        \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
      11. lower-unsound-/.f64N/A

        \[\leadsto \left(1 + \frac{\color{blue}{\frac{{\pi}^{3} - {\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}^{3}}{\pi \cdot \pi + \left(\frac{\mathsf{PI}\left(\right)}{2} \cdot \frac{\mathsf{PI}\left(\right)}{2} + \pi \cdot \frac{\mathsf{PI}\left(\right)}{2}\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    5. Applied rewrites10.4%

      \[\leadsto \left(1 + \frac{\color{blue}{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right) \cdot \sin^{-1} \left(x - 1\right)} \]
      2. lift-+.f64N/A

        \[\leadsto \color{blue}{\left(1 + \frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}\right)} \cdot \sin^{-1} \left(x - 1\right) \]
      3. lift-/.f64N/A

        \[\leadsto \left(1 + \color{blue}{\frac{\frac{\left(\pi \cdot \pi\right) \cdot \pi - {\left(\pi \cdot \frac{1}{2}\right)}^{3}}{\pi \cdot \pi + \left(\left(\pi \cdot \frac{1}{2}\right) \cdot \left(\pi \cdot \frac{1}{2}\right) + \pi \cdot \left(\pi \cdot \frac{1}{2}\right)\right)}}{\sin^{-1} \left(x - 1\right)}}\right) \cdot \sin^{-1} \left(x - 1\right) \]
    7. Applied rewrites10.4%

      \[\leadsto \color{blue}{\frac{\sin^{-1} \left(x - 1\right) \cdot \sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi} \cdot \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}{\sin^{-1} \left(x - 1\right) - \frac{\left(\pi \cdot \pi\right) \cdot \pi - \frac{1}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\left(\pi \cdot \pi\right) \cdot \frac{3}{4} + \pi \cdot \pi}}} \]
    8. Step-by-step derivation
      1. Applied rewrites10.4%

        \[\leadsto \color{blue}{\frac{\frac{7}{8} \cdot \left(\left(\pi \cdot \pi\right) \cdot \pi\right)}{\frac{7}{4} \cdot \left(\pi \cdot \pi\right)} + \sin^{-1} \left(x - 1\right)} \]
      2. Add Preprocessing

      Alternative 6: 9.5% accurate, 0.7× speedup?

      \[\begin{array}{l} \mathbf{if}\;x \leq \frac{8924260225606735}{162259276829213363391578010288128}:\\ \;\;\;\;\cos^{-1} 0\\ \mathbf{else}:\\ \;\;\;\;\frac{\frac{\left(-3 \cdot \cos^{-1} \left(1 - x\right)\right) \cdot \pi}{-3}}{\pi}\\ \end{array} \]
      (FPCore (x)
        :precision binary64
        (if (<= x 8924260225606735/162259276829213363391578010288128)
        (acos 0)
        (/ (/ (* (* -3 (acos (- 1 x))) PI) -3) PI)))
      double code(double x) {
      	double tmp;
      	if (x <= 5.5e-17) {
      		tmp = acos(0.0);
      	} else {
      		tmp = (((-3.0 * acos((1.0 - x))) * ((double) M_PI)) / -3.0) / ((double) M_PI);
      	}
      	return tmp;
      }
      
      public static double code(double x) {
      	double tmp;
      	if (x <= 5.5e-17) {
      		tmp = Math.acos(0.0);
      	} else {
      		tmp = (((-3.0 * Math.acos((1.0 - x))) * Math.PI) / -3.0) / Math.PI;
      	}
      	return tmp;
      }
      
      def code(x):
      	tmp = 0
      	if x <= 5.5e-17:
      		tmp = math.acos(0.0)
      	else:
      		tmp = (((-3.0 * math.acos((1.0 - x))) * math.pi) / -3.0) / math.pi
      	return tmp
      
      function code(x)
      	tmp = 0.0
      	if (x <= 5.5e-17)
      		tmp = acos(0.0);
      	else
      		tmp = Float64(Float64(Float64(Float64(-3.0 * acos(Float64(1.0 - x))) * pi) / -3.0) / pi);
      	end
      	return tmp
      end
      
      function tmp_2 = code(x)
      	tmp = 0.0;
      	if (x <= 5.5e-17)
      		tmp = acos(0.0);
      	else
      		tmp = (((-3.0 * acos((1.0 - x))) * pi) / -3.0) / pi;
      	end
      	tmp_2 = tmp;
      end
      
      code[x_] := If[LessEqual[x, 8924260225606735/162259276829213363391578010288128], N[ArcCos[0], $MachinePrecision], N[(N[(N[(N[(-3 * N[ArcCos[N[(1 - x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision] / -3), $MachinePrecision] / Pi), $MachinePrecision]]
      
      \begin{array}{l}
      \mathbf{if}\;x \leq \frac{8924260225606735}{162259276829213363391578010288128}:\\
      \;\;\;\;\cos^{-1} 0\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\frac{\left(-3 \cdot \cos^{-1} \left(1 - x\right)\right) \cdot \pi}{-3}}{\pi}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if x < 5.5e-17

        1. Initial program 6.9%

          \[\cos^{-1} \left(1 - x\right) \]
        2. Taylor expanded in x around 0

          \[\leadsto \cos^{-1} \color{blue}{1} \]
        3. Step-by-step derivation
          1. Applied rewrites3.8%

            \[\leadsto \cos^{-1} \color{blue}{1} \]
          2. Taylor expanded in undef-var around zero

            \[\leadsto \cos^{-1} 0 \]
          3. Step-by-step derivation
            1. Applied rewrites6.9%

              \[\leadsto \cos^{-1} 0 \]

            if 5.5e-17 < x

            1. Initial program 6.9%

              \[\cos^{-1} \left(1 - x\right) \]
            2. Step-by-step derivation
              1. lift-acos.f64N/A

                \[\leadsto \color{blue}{\cos^{-1} \left(1 - x\right)} \]
              2. lift--.f64N/A

                \[\leadsto \cos^{-1} \color{blue}{\left(1 - x\right)} \]
              3. sub-negate-revN/A

                \[\leadsto \cos^{-1} \color{blue}{\left(\mathsf{neg}\left(\left(x - 1\right)\right)\right)} \]
              4. acos-negN/A

                \[\leadsto \color{blue}{\mathsf{PI}\left(\right) - \cos^{-1} \left(x - 1\right)} \]
              5. sub-to-multN/A

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

                \[\leadsto \color{blue}{\left(1 - \frac{\cos^{-1} \left(x - 1\right)}{\mathsf{PI}\left(\right)}\right) \cdot \mathsf{PI}\left(\right)} \]
              7. lower-unsound--.f64N/A

                \[\leadsto \color{blue}{\left(1 - \frac{\cos^{-1} \left(x - 1\right)}{\mathsf{PI}\left(\right)}\right)} \cdot \mathsf{PI}\left(\right) \]
              8. lower-unsound-/.f64N/A

                \[\leadsto \left(1 - \color{blue}{\frac{\cos^{-1} \left(x - 1\right)}{\mathsf{PI}\left(\right)}}\right) \cdot \mathsf{PI}\left(\right) \]
              9. lower-acos.f64N/A

                \[\leadsto \left(1 - \frac{\color{blue}{\cos^{-1} \left(x - 1\right)}}{\mathsf{PI}\left(\right)}\right) \cdot \mathsf{PI}\left(\right) \]
              10. lower--.f64N/A

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

                \[\leadsto \left(1 - \frac{\cos^{-1} \left(x - 1\right)}{\color{blue}{\pi}}\right) \cdot \mathsf{PI}\left(\right) \]
              12. lower-PI.f646.9%

                \[\leadsto \left(1 - \frac{\cos^{-1} \left(x - 1\right)}{\pi}\right) \cdot \color{blue}{\pi} \]
            3. Applied rewrites6.9%

              \[\leadsto \color{blue}{\left(1 - \frac{\cos^{-1} \left(x - 1\right)}{\pi}\right) \cdot \pi} \]
            4. Step-by-step derivation
              1. lift-acos.f64N/A

                \[\leadsto \left(1 - \frac{\color{blue}{\cos^{-1} \left(x - 1\right)}}{\pi}\right) \cdot \pi \]
              2. acos-asinN/A

                \[\leadsto \left(1 - \frac{\color{blue}{\frac{\mathsf{PI}\left(\right)}{2} - \sin^{-1} \left(x - 1\right)}}{\pi}\right) \cdot \pi \]
              3. lift-asin.f64N/A

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

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

                \[\leadsto \left(1 - \frac{\frac{\color{blue}{\pi}}{2} - \sin^{-1} \left(x - 1\right)}{\pi}\right) \cdot \pi \]
              6. mult-flipN/A

                \[\leadsto \left(1 - \frac{\color{blue}{\pi \cdot \frac{1}{2}} - \sin^{-1} \left(x - 1\right)}{\pi}\right) \cdot \pi \]
              7. metadata-evalN/A

                \[\leadsto \left(1 - \frac{\pi \cdot \color{blue}{\frac{1}{2}} - \sin^{-1} \left(x - 1\right)}{\pi}\right) \cdot \pi \]
              8. lower-*.f646.9%

                \[\leadsto \left(1 - \frac{\color{blue}{\pi \cdot \frac{1}{2}} - \sin^{-1} \left(x - 1\right)}{\pi}\right) \cdot \pi \]
            5. Applied rewrites6.9%

              \[\leadsto \left(1 - \frac{\color{blue}{\pi \cdot \frac{1}{2} - \sin^{-1} \left(x - 1\right)}}{\pi}\right) \cdot \pi \]
            6. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \color{blue}{\left(1 - \frac{\pi \cdot \frac{1}{2} - \sin^{-1} \left(x - 1\right)}{\pi}\right)} \cdot \pi \]
              2. lift-/.f64N/A

                \[\leadsto \left(1 - \color{blue}{\frac{\pi \cdot \frac{1}{2} - \sin^{-1} \left(x - 1\right)}{\pi}}\right) \cdot \pi \]
              3. metadata-evalN/A

                \[\leadsto \left(\color{blue}{\frac{3}{3}} - \frac{\pi \cdot \frac{1}{2} - \sin^{-1} \left(x - 1\right)}{\pi}\right) \cdot \pi \]
              4. frac-subN/A

                \[\leadsto \color{blue}{\frac{3 \cdot \pi - 3 \cdot \left(\pi \cdot \frac{1}{2} - \sin^{-1} \left(x - 1\right)\right)}{3 \cdot \pi}} \cdot \pi \]
              5. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{3 \cdot \pi - 3 \cdot \left(\pi \cdot \frac{1}{2} - \sin^{-1} \left(x - 1\right)\right)}{3 \cdot \pi}} \cdot \pi \]
            7. Applied rewrites6.9%

              \[\leadsto \color{blue}{\frac{3 \cdot \pi - 3 \cdot \cos^{-1} \left(x - 1\right)}{3 \cdot \pi}} \cdot \pi \]
            8. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\frac{3 \cdot \pi - 3 \cdot \cos^{-1} \left(x - 1\right)}{3 \cdot \pi} \cdot \pi} \]
              2. lift-/.f64N/A

                \[\leadsto \color{blue}{\frac{3 \cdot \pi - 3 \cdot \cos^{-1} \left(x - 1\right)}{3 \cdot \pi}} \cdot \pi \]
              3. associate-*l/N/A

                \[\leadsto \color{blue}{\frac{\left(3 \cdot \pi - 3 \cdot \cos^{-1} \left(x - 1\right)\right) \cdot \pi}{3 \cdot \pi}} \]
              4. lift-*.f64N/A

                \[\leadsto \frac{\left(3 \cdot \pi - 3 \cdot \cos^{-1} \left(x - 1\right)\right) \cdot \pi}{\color{blue}{3 \cdot \pi}} \]
              5. associate-/r*N/A

                \[\leadsto \color{blue}{\frac{\frac{\left(3 \cdot \pi - 3 \cdot \cos^{-1} \left(x - 1\right)\right) \cdot \pi}{3}}{\pi}} \]
              6. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\frac{\left(3 \cdot \pi - 3 \cdot \cos^{-1} \left(x - 1\right)\right) \cdot \pi}{3}}{\pi}} \]
            9. Applied rewrites6.9%

              \[\leadsto \color{blue}{\frac{\frac{\left(-3 \cdot \cos^{-1} \left(1 - x\right)\right) \cdot \pi}{-3}}{\pi}} \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 7: 9.5% accurate, 0.9× speedup?

          \[\begin{array}{l} \mathbf{if}\;x \leq \frac{8924260225606735}{162259276829213363391578010288128}:\\ \;\;\;\;\cos^{-1} 0\\ \mathbf{else}:\\ \;\;\;\;\cos^{-1} \left(1 - x\right)\\ \end{array} \]
          (FPCore (x)
            :precision binary64
            (if (<= x 8924260225606735/162259276829213363391578010288128)
            (acos 0)
            (acos (- 1 x))))
          double code(double x) {
          	double tmp;
          	if (x <= 5.5e-17) {
          		tmp = acos(0.0);
          	} else {
          		tmp = acos((1.0 - x));
          	}
          	return tmp;
          }
          
          module fmin_fmax_functions
              implicit none
              private
              public fmax
              public fmin
          
              interface fmax
                  module procedure fmax88
                  module procedure fmax44
                  module procedure fmax84
                  module procedure fmax48
              end interface
              interface fmin
                  module procedure fmin88
                  module procedure fmin44
                  module procedure fmin84
                  module procedure fmin48
              end interface
          contains
              real(8) function fmax88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(4) function fmax44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, max(x, y), y /= y), x /= x)
              end function
              real(8) function fmax84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmax48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
              end function
              real(8) function fmin88(x, y) result (res)
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(4) function fmin44(x, y) result (res)
                  real(4), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(y, merge(x, min(x, y), y /= y), x /= x)
              end function
              real(8) function fmin84(x, y) result(res)
                  real(8), intent (in) :: x
                  real(4), intent (in) :: y
                  res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
              end function
              real(8) function fmin48(x, y) result(res)
                  real(4), intent (in) :: x
                  real(8), intent (in) :: y
                  res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
              end function
          end module
          
          real(8) function code(x)
          use fmin_fmax_functions
              real(8), intent (in) :: x
              real(8) :: tmp
              if (x <= 5.5d-17) then
                  tmp = acos(0.0d0)
              else
                  tmp = acos((1.0d0 - x))
              end if
              code = tmp
          end function
          
          public static double code(double x) {
          	double tmp;
          	if (x <= 5.5e-17) {
          		tmp = Math.acos(0.0);
          	} else {
          		tmp = Math.acos((1.0 - x));
          	}
          	return tmp;
          }
          
          def code(x):
          	tmp = 0
          	if x <= 5.5e-17:
          		tmp = math.acos(0.0)
          	else:
          		tmp = math.acos((1.0 - x))
          	return tmp
          
          function code(x)
          	tmp = 0.0
          	if (x <= 5.5e-17)
          		tmp = acos(0.0);
          	else
          		tmp = acos(Float64(1.0 - x));
          	end
          	return tmp
          end
          
          function tmp_2 = code(x)
          	tmp = 0.0;
          	if (x <= 5.5e-17)
          		tmp = acos(0.0);
          	else
          		tmp = acos((1.0 - x));
          	end
          	tmp_2 = tmp;
          end
          
          code[x_] := If[LessEqual[x, 8924260225606735/162259276829213363391578010288128], N[ArcCos[0], $MachinePrecision], N[ArcCos[N[(1 - x), $MachinePrecision]], $MachinePrecision]]
          
          \begin{array}{l}
          \mathbf{if}\;x \leq \frac{8924260225606735}{162259276829213363391578010288128}:\\
          \;\;\;\;\cos^{-1} 0\\
          
          \mathbf{else}:\\
          \;\;\;\;\cos^{-1} \left(1 - x\right)\\
          
          
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if x < 5.5e-17

            1. Initial program 6.9%

              \[\cos^{-1} \left(1 - x\right) \]
            2. Taylor expanded in x around 0

              \[\leadsto \cos^{-1} \color{blue}{1} \]
            3. Step-by-step derivation
              1. Applied rewrites3.8%

                \[\leadsto \cos^{-1} \color{blue}{1} \]
              2. Taylor expanded in undef-var around zero

                \[\leadsto \cos^{-1} 0 \]
              3. Step-by-step derivation
                1. Applied rewrites6.9%

                  \[\leadsto \cos^{-1} 0 \]

                if 5.5e-17 < x

                1. Initial program 6.9%

                  \[\cos^{-1} \left(1 - x\right) \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 8: 6.9% accurate, 1.0× speedup?

              \[\cos^{-1} 0 \]
              (FPCore (x)
                :precision binary64
                (acos 0))
              double code(double x) {
              	return acos(0.0);
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  code = acos(0.0d0)
              end function
              
              public static double code(double x) {
              	return Math.acos(0.0);
              }
              
              def code(x):
              	return math.acos(0.0)
              
              function code(x)
              	return acos(0.0)
              end
              
              function tmp = code(x)
              	tmp = acos(0.0);
              end
              
              code[x_] := N[ArcCos[0], $MachinePrecision]
              
              \cos^{-1} 0
              
              Derivation
              1. Initial program 6.9%

                \[\cos^{-1} \left(1 - x\right) \]
              2. Taylor expanded in x around 0

                \[\leadsto \cos^{-1} \color{blue}{1} \]
              3. Step-by-step derivation
                1. Applied rewrites3.8%

                  \[\leadsto \cos^{-1} \color{blue}{1} \]
                2. Taylor expanded in undef-var around zero

                  \[\leadsto \cos^{-1} 0 \]
                3. Step-by-step derivation
                  1. Applied rewrites6.9%

                    \[\leadsto \cos^{-1} 0 \]
                  2. Add Preprocessing

                  Alternative 9: 3.8% accurate, 1.0× speedup?

                  \[\cos^{-1} 1 \]
                  (FPCore (x)
                    :precision binary64
                    (acos 1))
                  double code(double x) {
                  	return acos(1.0);
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      code = acos(1.0d0)
                  end function
                  
                  public static double code(double x) {
                  	return Math.acos(1.0);
                  }
                  
                  def code(x):
                  	return math.acos(1.0)
                  
                  function code(x)
                  	return acos(1.0)
                  end
                  
                  function tmp = code(x)
                  	tmp = acos(1.0);
                  end
                  
                  code[x_] := N[ArcCos[1], $MachinePrecision]
                  
                  \cos^{-1} 1
                  
                  Derivation
                  1. Initial program 6.9%

                    \[\cos^{-1} \left(1 - x\right) \]
                  2. Taylor expanded in x around 0

                    \[\leadsto \cos^{-1} \color{blue}{1} \]
                  3. Step-by-step derivation
                    1. Applied rewrites3.8%

                      \[\leadsto \cos^{-1} \color{blue}{1} \]
                    2. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2025285 -o generate:evaluate
                    (FPCore (x)
                      :name "bug323 (missed optimization)"
                      :precision binary64
                      :pre (and (<= 0 x) (<= x 1/2))
                      (acos (- 1 x)))