ENA, Section 1.4, Exercise 1

Percentage Accurate: 94.5% → 99.4%
Time: 6.7s
Alternatives: 5
Speedup: N/A×

Specification

?
\[1.99 \leq x \land x \leq 2.01\]
\[\begin{array}{l} \\ \cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * 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 = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
	return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}

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

\[\begin{array}{l} \\ \cos x \cdot e^{10 \cdot \left(x \cdot x\right)} \end{array} \]
(FPCore (x) :precision binary64 (* (cos x) (exp (* 10.0 (* x x)))))
double code(double x) {
	return cos(x) * exp((10.0 * (x * 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 = cos(x) * exp((10.0d0 * (x * x)))
end function
public static double code(double x) {
	return Math.cos(x) * Math.exp((10.0 * (x * x)));
}
def code(x):
	return math.cos(x) * math.exp((10.0 * (x * x)))
function code(x)
	return Float64(cos(x) * exp(Float64(10.0 * Float64(x * x))))
end
function tmp = code(x)
	tmp = cos(x) * exp((10.0 * (x * x)));
end
code[x_] := N[(N[Cos[x], $MachinePrecision] * N[Exp[N[(10.0 * N[(x * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\cos x \cdot e^{10 \cdot \left(x \cdot x\right)}
\end{array}

Alternative 1: 99.4% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left({\left(e^{10}\right)}^{2}\right)}^{x}\right)}^{\left(\frac{-1 \cdot x}{-2}\right)} \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (fma (sin x) (sin (fma PI 0.5 (/ PI 2.0))) (* (sin (* PI 0.5)) (cos x)))
  (pow (pow (pow (exp 10.0) 2.0) x) (/ (* -1.0 x) -2.0))))
double code(double x) {
	return fma(sin(x), sin(fma(((double) M_PI), 0.5, (((double) M_PI) / 2.0))), (sin((((double) M_PI) * 0.5)) * cos(x))) * pow(pow(pow(exp(10.0), 2.0), x), ((-1.0 * x) / -2.0));
}
function code(x)
	return Float64(fma(sin(x), sin(fma(pi, 0.5, Float64(pi / 2.0))), Float64(sin(Float64(pi * 0.5)) * cos(x))) * (((exp(10.0) ^ 2.0) ^ x) ^ Float64(Float64(-1.0 * x) / -2.0)))
end
code[x_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sin[N[(Pi * 0.5 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Sin[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Power[N[Exp[10.0], $MachinePrecision], 2.0], $MachinePrecision], x], $MachinePrecision], N[(N[(-1.0 * x), $MachinePrecision] / -2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left({\left(e^{10}\right)}^{2}\right)}^{x}\right)}^{\left(\frac{-1 \cdot x}{-2}\right)}
\end{array}
Derivation
  1. Initial program 94.5%

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

      \[\leadsto \color{blue}{\cos x} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    2. sin-+PI/2-revN/A

      \[\leadsto \color{blue}{\sin \left(x + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    3. sin-sumN/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    4. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    5. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\sin x}, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    6. lower-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \color{blue}{\cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    7. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    8. lower-PI.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\color{blue}{\pi}}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    9. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    10. lift-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x} \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    11. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    12. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    13. lower-PI.f6494.5

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\color{blue}{\pi}}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  3. Applied rewrites94.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\pi}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  4. Taylor expanded in x around inf

    \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(\cos x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) + \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot \sin x\right)} \]
  5. Applied rewrites99.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}} \]
  6. Step-by-step derivation
    1. lift-exp.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    2. lift-pow.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    3. pow-expN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left(e^{10 \cdot x}\right)}^{x} \]
    4. lower-pow.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left(e^{10 \cdot x}\right)}^{\color{blue}{x}} \]
    5. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left(e^{x \cdot 10}\right)}^{x} \]
    6. pow-expN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{x}\right)}^{10}\right)}^{x} \]
    7. sqr-powN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left({\left(e^{x}\right)}^{10}\right)}^{\left(\frac{x}{2}\right)} \cdot \color{blue}{{\left({\left(e^{x}\right)}^{10}\right)}^{\left(\frac{x}{2}\right)}}\right) \]
    8. pow-expN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{x \cdot 10}\right)}^{\left(\frac{x}{2}\right)} \cdot {\left({\color{blue}{\left(e^{x}\right)}}^{10}\right)}^{\left(\frac{x}{2}\right)}\right) \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10 \cdot x}\right)}^{\left(\frac{x}{2}\right)} \cdot {\left({\left(e^{\color{blue}{x}}\right)}^{10}\right)}^{\left(\frac{x}{2}\right)}\right) \]
    10. pow-expN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left({\left(e^{10}\right)}^{x}\right)}^{\left(\frac{x}{2}\right)} \cdot {\left({\color{blue}{\left(e^{x}\right)}}^{10}\right)}^{\left(\frac{x}{2}\right)}\right) \]
    11. pow-powN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(x \cdot \frac{x}{2}\right)} \cdot {\color{blue}{\left({\left(e^{x}\right)}^{10}\right)}}^{\left(\frac{x}{2}\right)}\right) \]
    12. associate-/l*N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left({\left(e^{x}\right)}^{\color{blue}{10}}\right)}^{\left(\frac{x}{2}\right)}\right) \]
    13. pow-expN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left(e^{x \cdot 10}\right)}^{\left(\frac{\color{blue}{x}}{2}\right)}\right) \]
    14. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left(e^{10 \cdot x}\right)}^{\left(\frac{x}{2}\right)}\right) \]
    15. pow-expN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{\left(\frac{\color{blue}{x}}{2}\right)}\right) \]
    16. pow-powN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left(e^{10}\right)}^{\color{blue}{\left(x \cdot \frac{x}{2}\right)}}\right) \]
    17. associate-/l*N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left(e^{10}\right)}^{\left(\frac{x \cdot x}{\color{blue}{2}}\right)}\right) \]
    18. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)}\right) \]
    19. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)}\right) \]
    20. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left({\left(e^{10}\right)}^{\left(\frac{x \cdot x}{2}\right)} \cdot {\left(e^{10}\right)}^{\left(\frac{x \cdot x}{\color{blue}{2}}\right)}\right) \]
  7. Applied rewrites99.4%

    \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left({\left(e^{10}\right)}^{2}\right)}^{x}\right)}^{\color{blue}{\left(\frac{-1 \cdot x}{-2}\right)}} \]
  8. Add Preprocessing

Alternative 2: 99.2% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (fma (sin x) (sin (fma PI 0.5 (/ PI 2.0))) (* (sin (* PI 0.5)) (cos x)))
  (pow (pow (exp 10.0) x) x)))
double code(double x) {
	return fma(sin(x), sin(fma(((double) M_PI), 0.5, (((double) M_PI) / 2.0))), (sin((((double) M_PI) * 0.5)) * cos(x))) * pow(pow(exp(10.0), x), x);
}
function code(x)
	return Float64(fma(sin(x), sin(fma(pi, 0.5, Float64(pi / 2.0))), Float64(sin(Float64(pi * 0.5)) * cos(x))) * ((exp(10.0) ^ x) ^ x))
end
code[x_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sin[N[(Pi * 0.5 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Sin[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Exp[10.0], $MachinePrecision], x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}
\end{array}
Derivation
  1. Initial program 94.5%

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

      \[\leadsto \color{blue}{\cos x} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    2. sin-+PI/2-revN/A

      \[\leadsto \color{blue}{\sin \left(x + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    3. sin-sumN/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    4. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    5. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\sin x}, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    6. lower-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \color{blue}{\cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    7. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    8. lower-PI.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\color{blue}{\pi}}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    9. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    10. lift-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x} \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    11. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    12. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    13. lower-PI.f6494.5

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\color{blue}{\pi}}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  3. Applied rewrites94.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\pi}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  4. Taylor expanded in x around inf

    \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(\cos x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) + \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot \sin x\right)} \]
  5. Applied rewrites99.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}} \]
  6. Add Preprocessing

Alternative 3: 99.0% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{fma}\left(\sin x, \cos \left(\pi \cdot 0.5\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \end{array} \]
(FPCore (x)
 :precision binary64
 (*
  (fma (sin x) (cos (* PI 0.5)) (* (sin (* PI 0.5)) (cos x)))
  (pow (pow (exp 10.0) x) x)))
double code(double x) {
	return fma(sin(x), cos((((double) M_PI) * 0.5)), (sin((((double) M_PI) * 0.5)) * cos(x))) * pow(pow(exp(10.0), x), x);
}
function code(x)
	return Float64(fma(sin(x), cos(Float64(pi * 0.5)), Float64(sin(Float64(pi * 0.5)) * cos(x))) * ((exp(10.0) ^ x) ^ x))
end
code[x_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Cos[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision] + N[(N[Sin[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision] * N[Cos[x], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Exp[10.0], $MachinePrecision], x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\mathsf{fma}\left(\sin x, \cos \left(\pi \cdot 0.5\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}
\end{array}
Derivation
  1. Initial program 94.5%

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

      \[\leadsto \color{blue}{\cos x} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    2. sin-+PI/2-revN/A

      \[\leadsto \color{blue}{\sin \left(x + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    3. sin-sumN/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    4. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    5. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\sin x}, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    6. lower-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \color{blue}{\cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    7. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    8. lower-PI.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\color{blue}{\pi}}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    9. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    10. lift-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x} \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    11. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    12. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    13. lower-PI.f6494.5

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\color{blue}{\pi}}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  3. Applied rewrites94.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\pi}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  4. Taylor expanded in x around inf

    \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(\cos x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) + \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot \sin x\right)} \]
  5. Applied rewrites99.2%

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

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

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\mathsf{PI}\left(\right), \frac{1}{2}, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    3. lift-fma.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{PI}\left(\right) \cdot \frac{1}{2} + \frac{\pi}{2}\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    4. lift-PI.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{PI}\left(\right) \cdot \frac{1}{2} + \frac{\mathsf{PI}\left(\right)}{2}\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    5. lift-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \sin \left(\mathsf{PI}\left(\right) \cdot \frac{1}{2} + \frac{\mathsf{PI}\left(\right)}{2}\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    6. sin-+PI/2N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{\color{blue}{x}}\right)}^{x} \]
    7. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    8. lower-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{\color{blue}{x}}\right)}^{x} \]
    9. *-commutativeN/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    10. lift-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\mathsf{PI}\left(\right) \cdot \frac{1}{2}\right), \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    11. lift-PI.f6498.8

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\pi \cdot 0.5\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
  7. Applied rewrites98.8%

    \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\pi \cdot 0.5\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{\color{blue}{x}}\right)}^{x} \]
  8. Add Preprocessing

Alternative 4: 98.9% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\pi \cdot 0.5\right)\\ t_1 := t\_0 \cdot \cos x\\ t_2 := \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\\ \frac{\mathsf{fma}\left({\cos x}^{3}, {t\_0}^{3}, {t\_2}^{3}\right)}{\mathsf{fma}\left(t\_1, t\_1, t\_2 \cdot t\_2 - t\_1 \cdot t\_2\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (sin (* PI 0.5)))
        (t_1 (* t_0 (cos x)))
        (t_2 (* (sin (fma PI 0.5 (/ PI 2.0))) (sin x))))
   (*
    (/
     (fma (pow (cos x) 3.0) (pow t_0 3.0) (pow t_2 3.0))
     (fma t_1 t_1 (- (* t_2 t_2) (* t_1 t_2))))
    (pow (pow (exp 10.0) x) x))))
double code(double x) {
	double t_0 = sin((((double) M_PI) * 0.5));
	double t_1 = t_0 * cos(x);
	double t_2 = sin(fma(((double) M_PI), 0.5, (((double) M_PI) / 2.0))) * sin(x);
	return (fma(pow(cos(x), 3.0), pow(t_0, 3.0), pow(t_2, 3.0)) / fma(t_1, t_1, ((t_2 * t_2) - (t_1 * t_2)))) * pow(pow(exp(10.0), x), x);
}
function code(x)
	t_0 = sin(Float64(pi * 0.5))
	t_1 = Float64(t_0 * cos(x))
	t_2 = Float64(sin(fma(pi, 0.5, Float64(pi / 2.0))) * sin(x))
	return Float64(Float64(fma((cos(x) ^ 3.0), (t_0 ^ 3.0), (t_2 ^ 3.0)) / fma(t_1, t_1, Float64(Float64(t_2 * t_2) - Float64(t_1 * t_2)))) * ((exp(10.0) ^ x) ^ x))
end
code[x_] := Block[{t$95$0 = N[Sin[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(t$95$0 * N[Cos[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(Pi * 0.5 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[Power[N[Cos[x], $MachinePrecision], 3.0], $MachinePrecision] * N[Power[t$95$0, 3.0], $MachinePrecision] + N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$1 * t$95$1 + N[(N[(t$95$2 * t$95$2), $MachinePrecision] - N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Exp[10.0], $MachinePrecision], x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(\pi \cdot 0.5\right)\\
t_1 := t\_0 \cdot \cos x\\
t_2 := \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\\
\frac{\mathsf{fma}\left({\cos x}^{3}, {t\_0}^{3}, {t\_2}^{3}\right)}{\mathsf{fma}\left(t\_1, t\_1, t\_2 \cdot t\_2 - t\_1 \cdot t\_2\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}
\end{array}
\end{array}
Derivation
  1. Initial program 94.5%

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

      \[\leadsto \color{blue}{\cos x} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    2. sin-+PI/2-revN/A

      \[\leadsto \color{blue}{\sin \left(x + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    3. sin-sumN/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    4. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    5. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\sin x}, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    6. lower-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \color{blue}{\cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    7. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    8. lower-PI.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\color{blue}{\pi}}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    9. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    10. lift-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x} \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    11. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    12. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    13. lower-PI.f6494.5

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\color{blue}{\pi}}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  3. Applied rewrites94.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\pi}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  4. Taylor expanded in x around inf

    \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(\cos x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) + \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot \sin x\right)} \]
  5. Applied rewrites99.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}} \]
  6. Applied rewrites99.0%

    \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{3}, {\sin \left(\pi \cdot 0.5\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x, \sin \left(\pi \cdot 0.5\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\color{blue}{\left({\left(e^{10}\right)}^{x}\right)}}^{x} \]
  7. Add Preprocessing

Alternative 5: 98.8% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\\ t_1 := \sin \left(\pi \cdot 0.5\right)\\ t_2 := t\_1 \cdot \cos x\\ \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{1}, {t\_1}^{3}, {t\_0}^{3}\right)}{\mathsf{fma}\left(t\_2, t\_2, t\_0 \cdot t\_0 - t\_2 \cdot t\_0\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \end{array} \end{array} \]
(FPCore (x)
 :precision binary64
 (let* ((t_0 (* (sin (fma PI 0.5 (/ PI 2.0))) (sin x)))
        (t_1 (sin (* PI 0.5)))
        (t_2 (* t_1 (cos x))))
   (*
    (/
     (fma (* (pow (cos x) 2.0) (pow (cos x) 1.0)) (pow t_1 3.0) (pow t_0 3.0))
     (fma t_2 t_2 (- (* t_0 t_0) (* t_2 t_0))))
    (pow (pow (exp 10.0) x) x))))
double code(double x) {
	double t_0 = sin(fma(((double) M_PI), 0.5, (((double) M_PI) / 2.0))) * sin(x);
	double t_1 = sin((((double) M_PI) * 0.5));
	double t_2 = t_1 * cos(x);
	return (fma((pow(cos(x), 2.0) * pow(cos(x), 1.0)), pow(t_1, 3.0), pow(t_0, 3.0)) / fma(t_2, t_2, ((t_0 * t_0) - (t_2 * t_0)))) * pow(pow(exp(10.0), x), x);
}
function code(x)
	t_0 = Float64(sin(fma(pi, 0.5, Float64(pi / 2.0))) * sin(x))
	t_1 = sin(Float64(pi * 0.5))
	t_2 = Float64(t_1 * cos(x))
	return Float64(Float64(fma(Float64((cos(x) ^ 2.0) * (cos(x) ^ 1.0)), (t_1 ^ 3.0), (t_0 ^ 3.0)) / fma(t_2, t_2, Float64(Float64(t_0 * t_0) - Float64(t_2 * t_0)))) * ((exp(10.0) ^ x) ^ x))
end
code[x_] := Block[{t$95$0 = N[(N[Sin[N[(Pi * 0.5 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] * N[Sin[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(Pi * 0.5), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[Cos[x], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[(N[(N[Power[N[Cos[x], $MachinePrecision], 2.0], $MachinePrecision] * N[Power[N[Cos[x], $MachinePrecision], 1.0], $MachinePrecision]), $MachinePrecision] * N[Power[t$95$1, 3.0], $MachinePrecision] + N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision] / N[(t$95$2 * t$95$2 + N[(N[(t$95$0 * t$95$0), $MachinePrecision] - N[(t$95$2 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[Power[N[Power[N[Exp[10.0], $MachinePrecision], x], $MachinePrecision], x], $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\\
t_1 := \sin \left(\pi \cdot 0.5\right)\\
t_2 := t\_1 \cdot \cos x\\
\frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{1}, {t\_1}^{3}, {t\_0}^{3}\right)}{\mathsf{fma}\left(t\_2, t\_2, t\_0 \cdot t\_0 - t\_2 \cdot t\_0\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}
\end{array}
\end{array}
Derivation
  1. Initial program 94.5%

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

      \[\leadsto \color{blue}{\cos x} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    2. sin-+PI/2-revN/A

      \[\leadsto \color{blue}{\sin \left(x + \frac{\mathsf{PI}\left(\right)}{2}\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    3. sin-sumN/A

      \[\leadsto \color{blue}{\left(\sin x \cdot \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right) + \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    4. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    5. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\color{blue}{\sin x}, \cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    6. lower-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \color{blue}{\cos \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    7. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}, \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    8. lower-PI.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\color{blue}{\pi}}{2}\right), \cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    9. lower-*.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    10. lift-cos.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \color{blue}{\cos x} \cdot \sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    11. lower-sin.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    12. lower-/.f64N/A

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \color{blue}{\left(\frac{\mathsf{PI}\left(\right)}{2}\right)}\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
    13. lower-PI.f6494.5

      \[\leadsto \mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\color{blue}{\pi}}{2}\right)\right) \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  3. Applied rewrites94.5%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \cos \left(\frac{\pi}{2}\right), \cos x \cdot \sin \left(\frac{\pi}{2}\right)\right)} \cdot e^{10 \cdot \left(x \cdot x\right)} \]
  4. Taylor expanded in x around inf

    \[\leadsto \color{blue}{e^{10 \cdot {x}^{2}} \cdot \left(\cos x \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) + \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) \cdot \sin x\right)} \]
  5. Applied rewrites99.2%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin x, \sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right), \sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x}} \]
  6. Applied rewrites99.0%

    \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{3}, {\sin \left(\pi \cdot 0.5\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x, \sin \left(\pi \cdot 0.5\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\color{blue}{\left({\left(e^{10}\right)}^{x}\right)}}^{x} \]
  7. Step-by-step derivation
    1. lift-cos.f64N/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{3}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    2. lift-pow.f64N/A

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

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{\left(2 + 1\right)}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    4. unpow-prod-upN/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{1}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{\color{blue}{10}}\right)}^{x}\right)}^{x} \]
    5. metadata-evalN/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{\left(\frac{2}{2}\right)}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    6. lower-*.f64N/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{\left(\frac{2}{2}\right)}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{\color{blue}{10}}\right)}^{x}\right)}^{x} \]
    7. lower-pow.f64N/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{\left(\frac{2}{2}\right)}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    8. lift-cos.f64N/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{\left(\frac{2}{2}\right)}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    9. metadata-evalN/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{1}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    10. lower-pow.f64N/A

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{1}, {\sin \left(\pi \cdot \frac{1}{2}\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot \frac{1}{2}\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, \frac{1}{2}, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
    11. lift-cos.f6498.9

      \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{1}, {\sin \left(\pi \cdot 0.5\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x, \sin \left(\pi \cdot 0.5\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{10}\right)}^{x}\right)}^{x} \]
  8. Applied rewrites98.9%

    \[\leadsto \frac{\mathsf{fma}\left({\cos x}^{2} \cdot {\cos x}^{1}, {\sin \left(\pi \cdot 0.5\right)}^{3}, {\left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)}^{3}\right)}{\mathsf{fma}\left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x, \sin \left(\pi \cdot 0.5\right) \cdot \cos x, \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right) - \left(\sin \left(\pi \cdot 0.5\right) \cdot \cos x\right) \cdot \left(\sin \left(\mathsf{fma}\left(\pi, 0.5, \frac{\pi}{2}\right)\right) \cdot \sin x\right)\right)} \cdot {\left({\left(e^{\color{blue}{10}}\right)}^{x}\right)}^{x} \]
  9. Add Preprocessing

Reproduce

?
herbie shell --seed 2025093 
(FPCore (x)
  :name "ENA, Section 1.4, Exercise 1"
  :precision binary64
  :pre (and (<= 1.99 x) (<= x 2.01))
  (* (cos x) (exp (* 10.0 (* x x)))))