Trigonometry A

Percentage Accurate: 99.8% → 99.8%
Time: 7.9s
Alternatives: 13
Speedup: 1.0×

Specification

?
\[0 \leq e \land e \leq 1\]
\[\begin{array}{l} \\ \frac{e \cdot \sin v}{1 + e \cdot \cos v} \end{array} \]
(FPCore (e v) :precision binary64 (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))
double code(double e, double v) {
	return (e * sin(v)) / (1.0 + (e * cos(v)));
}
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(e, v)
use fmin_fmax_functions
    real(8), intent (in) :: e
    real(8), intent (in) :: v
    code = (e * sin(v)) / (1.0d0 + (e * cos(v)))
end function
public static double code(double e, double v) {
	return (e * Math.sin(v)) / (1.0 + (e * Math.cos(v)));
}
def code(e, v):
	return (e * math.sin(v)) / (1.0 + (e * math.cos(v)))
function code(e, v)
	return Float64(Float64(e * sin(v)) / Float64(1.0 + Float64(e * cos(v))))
end
function tmp = code(e, v)
	tmp = (e * sin(v)) / (1.0 + (e * cos(v)));
end
code[e_, v_] := N[(N[(e * N[Sin[v], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(e * N[Cos[v], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{e \cdot \sin v}{1 + e \cdot \cos v}
\end{array}

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

The average percentage accuracy by input value. Horizontal axis shows value of an input variable; the variable is choosen in the title. Vertical axis is accuracy; higher is better. Red represent the original program, while blue represents Herbie's suggestion. These can be toggled with buttons below the plot. The line is an average while dots represent individual samples.

Accuracy vs Speed?

Herbie found 13 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: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{e \cdot \sin v}{1 + e \cdot \cos v} \end{array} \]
(FPCore (e v) :precision binary64 (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))
double code(double e, double v) {
	return (e * sin(v)) / (1.0 + (e * cos(v)));
}
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(e, v)
use fmin_fmax_functions
    real(8), intent (in) :: e
    real(8), intent (in) :: v
    code = (e * sin(v)) / (1.0d0 + (e * cos(v)))
end function
public static double code(double e, double v) {
	return (e * Math.sin(v)) / (1.0 + (e * Math.cos(v)));
}
def code(e, v):
	return (e * math.sin(v)) / (1.0 + (e * math.cos(v)))
function code(e, v)
	return Float64(Float64(e * sin(v)) / Float64(1.0 + Float64(e * cos(v))))
end
function tmp = code(e, v)
	tmp = (e * sin(v)) / (1.0 + (e * cos(v)));
end
code[e_, v_] := N[(N[(e * N[Sin[v], $MachinePrecision]), $MachinePrecision] / N[(1.0 + N[(e * N[Cos[v], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{e \cdot \sin v}{1 + e \cdot \cos v}
\end{array}

Alternative 1: 99.8% accurate, 0.3× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := {\left(\cos v \cdot e\right)}^{2}\\ \mathsf{fma}\left(\sin v \cdot \frac{e}{1 - t\_0}, 1, \left(\sin v \cdot \frac{e}{-1 + t\_0}\right) \cdot \left(e \cdot \cos v\right)\right) \end{array} \end{array} \]
(FPCore (e v)
 :precision binary64
 (let* ((t_0 (pow (* (cos v) e) 2.0)))
   (fma
    (* (sin v) (/ e (- 1.0 t_0)))
    1.0
    (* (* (sin v) (/ e (+ -1.0 t_0))) (* e (cos v))))))
double code(double e, double v) {
	double t_0 = pow((cos(v) * e), 2.0);
	return fma((sin(v) * (e / (1.0 - t_0))), 1.0, ((sin(v) * (e / (-1.0 + t_0))) * (e * cos(v))));
}
function code(e, v)
	t_0 = Float64(cos(v) * e) ^ 2.0
	return fma(Float64(sin(v) * Float64(e / Float64(1.0 - t_0))), 1.0, Float64(Float64(sin(v) * Float64(e / Float64(-1.0 + t_0))) * Float64(e * cos(v))))
end
code[e_, v_] := Block[{t$95$0 = N[Power[N[(N[Cos[v], $MachinePrecision] * e), $MachinePrecision], 2.0], $MachinePrecision]}, N[(N[(N[Sin[v], $MachinePrecision] * N[(e / N[(1.0 - t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0 + N[(N[(N[Sin[v], $MachinePrecision] * N[(e / N[(-1.0 + t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(e * N[Cos[v], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := {\left(\cos v \cdot e\right)}^{2}\\
\mathsf{fma}\left(\sin v \cdot \frac{e}{1 - t\_0}, 1, \left(\sin v \cdot \frac{e}{-1 + t\_0}\right) \cdot \left(e \cdot \cos v\right)\right)
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{e \cdot \sin v}{1 + e \cdot \cos v}} \]
    2. lift-+.f64N/A

      \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e \cdot \cos v}} \]
    3. flip-+N/A

      \[\leadsto \frac{e \cdot \sin v}{\color{blue}{\frac{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)}{1 - e \cdot \cos v}}} \]
    4. associate-/r/N/A

      \[\leadsto \color{blue}{\frac{e \cdot \sin v}{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)} \cdot \left(1 - e \cdot \cos v\right)} \]
    5. lift-*.f64N/A

      \[\leadsto \frac{e \cdot \sin v}{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)} \cdot \left(1 - \color{blue}{e \cdot \cos v}\right) \]
    6. fp-cancel-sub-sign-invN/A

      \[\leadsto \frac{e \cdot \sin v}{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)} \cdot \color{blue}{\left(1 + \left(\mathsf{neg}\left(e\right)\right) \cdot \cos v\right)} \]
    7. distribute-lft-inN/A

      \[\leadsto \color{blue}{\frac{e \cdot \sin v}{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)} \cdot 1 + \frac{e \cdot \sin v}{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)} \cdot \left(\left(\mathsf{neg}\left(e\right)\right) \cdot \cos v\right)} \]
    8. lower-fma.f64N/A

      \[\leadsto \color{blue}{\mathsf{fma}\left(\frac{e \cdot \sin v}{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)}, 1, \frac{e \cdot \sin v}{1 \cdot 1 - \left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)} \cdot \left(\left(\mathsf{neg}\left(e\right)\right) \cdot \cos v\right)\right)} \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\mathsf{fma}\left(\sin v \cdot \frac{e}{1 - {\left(\cos v \cdot e\right)}^{2}}, 1, \left(\sin v \cdot \frac{e}{1 - {\left(\cos v \cdot e\right)}^{2}}\right) \cdot \left(\left(-e\right) \cdot \cos v\right)\right)} \]
  5. Final simplification99.8%

    \[\leadsto \mathsf{fma}\left(\sin v \cdot \frac{e}{1 - {\left(\cos v \cdot e\right)}^{2}}, 1, \left(\sin v \cdot \frac{e}{-1 + {\left(\cos v \cdot e\right)}^{2}}\right) \cdot \left(e \cdot \cos v\right)\right) \]
  6. Add Preprocessing

Alternative 2: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{\sin v \cdot e}{\mathsf{fma}\left(\cos v, e, 1\right)} \end{array} \]
(FPCore (e v) :precision binary64 (/ (* (sin v) e) (fma (cos v) e 1.0)))
double code(double e, double v) {
	return (sin(v) * e) / fma(cos(v), e, 1.0);
}
function code(e, v)
	return Float64(Float64(sin(v) * e) / fma(cos(v), e, 1.0))
end
code[e_, v_] := N[(N[(N[Sin[v], $MachinePrecision] * e), $MachinePrecision] / N[(N[Cos[v], $MachinePrecision] * e + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sin v \cdot e}{\mathsf{fma}\left(\cos v, e, 1\right)}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{e \cdot \sin v}}{1 + e \cdot \cos v} \]
    2. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\sin v \cdot e}}{1 + e \cdot \cos v} \]
    3. lower-*.f6499.8

      \[\leadsto \frac{\color{blue}{\sin v \cdot e}}{1 + e \cdot \cos v} \]
    4. lift-+.f64N/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{1 + e \cdot \cos v}} \]
    5. +-commutativeN/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{e \cdot \cos v + 1}} \]
    6. *-rgt-identityN/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{\left(e \cdot \cos v\right) \cdot 1} + 1} \]
    7. *-commutativeN/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{1 \cdot \left(e \cdot \cos v\right)} + 1} \]
    8. *-lft-identityN/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{e \cdot \cos v} + 1} \]
    9. unpow1N/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{{\left(e \cdot \cos v\right)}^{1}} + 1} \]
    10. metadata-evalN/A

      \[\leadsto \frac{\sin v \cdot e}{{\left(e \cdot \cos v\right)}^{\color{blue}{\left(\frac{2}{2}\right)}} + 1} \]
    11. sqrt-pow1N/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{\sqrt{{\left(e \cdot \cos v\right)}^{2}}} + 1} \]
    12. pow2N/A

      \[\leadsto \frac{\sin v \cdot e}{\sqrt{\color{blue}{\left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)}} + 1} \]
    13. rem-sqrt-square-revN/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{\left|e \cdot \cos v\right|} + 1} \]
    14. rem-sqrt-square-revN/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{\sqrt{\left(e \cdot \cos v\right) \cdot \left(e \cdot \cos v\right)}} + 1} \]
    15. pow2N/A

      \[\leadsto \frac{\sin v \cdot e}{\sqrt{\color{blue}{{\left(e \cdot \cos v\right)}^{2}}} + 1} \]
    16. sqrt-pow1N/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{{\left(e \cdot \cos v\right)}^{\left(\frac{2}{2}\right)}} + 1} \]
    17. metadata-evalN/A

      \[\leadsto \frac{\sin v \cdot e}{{\left(e \cdot \cos v\right)}^{\color{blue}{1}} + 1} \]
    18. unpow1N/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{e \cdot \cos v} + 1} \]
    19. lift-*.f64N/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{e \cdot \cos v} + 1} \]
    20. *-commutativeN/A

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{\cos v \cdot e} + 1} \]
    21. lower-fma.f6499.8

      \[\leadsto \frac{\sin v \cdot e}{\color{blue}{\mathsf{fma}\left(\cos v, e, 1\right)}} \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\frac{\sin v \cdot e}{\mathsf{fma}\left(\cos v, e, 1\right)}} \]
  5. Add Preprocessing

Alternative 3: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \frac{e}{\mathsf{fma}\left(\cos v, e, 1\right)} \cdot \sin v \end{array} \]
(FPCore (e v) :precision binary64 (* (/ e (fma (cos v) e 1.0)) (sin v)))
double code(double e, double v) {
	return (e / fma(cos(v), e, 1.0)) * sin(v);
}
function code(e, v)
	return Float64(Float64(e / fma(cos(v), e, 1.0)) * sin(v))
end
code[e_, v_] := N[(N[(e / N[(N[Cos[v], $MachinePrecision] * e + 1.0), $MachinePrecision]), $MachinePrecision] * N[Sin[v], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{e}{\mathsf{fma}\left(\cos v, e, 1\right)} \cdot \sin v
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{e \cdot \sin v}{1 + e \cdot \cos v}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{e \cdot \sin v}}{1 + e \cdot \cos v} \]
    3. *-commutativeN/A

      \[\leadsto \frac{\color{blue}{\sin v \cdot e}}{1 + e \cdot \cos v} \]
    4. associate-/l*N/A

      \[\leadsto \color{blue}{\sin v \cdot \frac{e}{1 + e \cdot \cos v}} \]
    5. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{e}{1 + e \cdot \cos v} \cdot \sin v} \]
    6. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{e}{1 + e \cdot \cos v} \cdot \sin v} \]
  4. Applied rewrites99.8%

    \[\leadsto \color{blue}{\frac{e}{\mathsf{fma}\left(\cos v, e, 1\right)} \cdot \sin v} \]
  5. Add Preprocessing

Alternative 4: 98.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \frac{e \cdot \sin v}{1 + e} \end{array} \]
(FPCore (e v) :precision binary64 (/ (* e (sin v)) (+ 1.0 e)))
double code(double e, double v) {
	return (e * sin(v)) / (1.0 + e);
}
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(e, v)
use fmin_fmax_functions
    real(8), intent (in) :: e
    real(8), intent (in) :: v
    code = (e * sin(v)) / (1.0d0 + e)
end function
public static double code(double e, double v) {
	return (e * Math.sin(v)) / (1.0 + e);
}
def code(e, v):
	return (e * math.sin(v)) / (1.0 + e)
function code(e, v)
	return Float64(Float64(e * sin(v)) / Float64(1.0 + e))
end
function tmp = code(e, v)
	tmp = (e * sin(v)) / (1.0 + e);
end
code[e_, v_] := N[(N[(e * N[Sin[v], $MachinePrecision]), $MachinePrecision] / N[(1.0 + e), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}

\\
\frac{e \cdot \sin v}{1 + e}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Add Preprocessing
  3. Taylor expanded in v around 0

    \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
  4. Step-by-step derivation
    1. lower-+.f6498.5

      \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
  5. Applied rewrites98.5%

    \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
  6. Add Preprocessing

Alternative 5: 98.7% accurate, 1.9× speedup?

\[\begin{array}{l} \\ \frac{\sin v}{1 + e} \cdot e \end{array} \]
(FPCore (e v) :precision binary64 (* (/ (sin v) (+ 1.0 e)) e))
double code(double e, double v) {
	return (sin(v) / (1.0 + e)) * e;
}
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(e, v)
use fmin_fmax_functions
    real(8), intent (in) :: e
    real(8), intent (in) :: v
    code = (sin(v) / (1.0d0 + e)) * e
end function
public static double code(double e, double v) {
	return (Math.sin(v) / (1.0 + e)) * e;
}
def code(e, v):
	return (math.sin(v) / (1.0 + e)) * e
function code(e, v)
	return Float64(Float64(sin(v) / Float64(1.0 + e)) * e)
end
function tmp = code(e, v)
	tmp = (sin(v) / (1.0 + e)) * e;
end
code[e_, v_] := N[(N[(N[Sin[v], $MachinePrecision] / N[(1.0 + e), $MachinePrecision]), $MachinePrecision] * e), $MachinePrecision]
\begin{array}{l}

\\
\frac{\sin v}{1 + e} \cdot e
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Add Preprocessing
  3. Taylor expanded in v around 0

    \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
  4. Step-by-step derivation
    1. lower-+.f6498.5

      \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
  5. Applied rewrites98.5%

    \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
  6. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \color{blue}{\frac{e \cdot \sin v}{1 + e}} \]
    2. lift-*.f64N/A

      \[\leadsto \frac{\color{blue}{e \cdot \sin v}}{1 + e} \]
    3. associate-/l*N/A

      \[\leadsto \color{blue}{e \cdot \frac{\sin v}{1 + e}} \]
    4. *-commutativeN/A

      \[\leadsto \color{blue}{\frac{\sin v}{1 + e} \cdot e} \]
    5. lower-*.f64N/A

      \[\leadsto \color{blue}{\frac{\sin v}{1 + e} \cdot e} \]
    6. lower-/.f6498.5

      \[\leadsto \color{blue}{\frac{\sin v}{1 + e}} \cdot e \]
  7. Applied rewrites98.5%

    \[\leadsto \color{blue}{\frac{\sin v}{1 + e} \cdot e} \]
  8. Add Preprocessing

Alternative 6: 97.6% accurate, 2.1× speedup?

\[\begin{array}{l} \\ \sin v \cdot e \end{array} \]
(FPCore (e v) :precision binary64 (* (sin v) e))
double code(double e, double v) {
	return sin(v) * e;
}
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(e, v)
use fmin_fmax_functions
    real(8), intent (in) :: e
    real(8), intent (in) :: v
    code = sin(v) * e
end function
public static double code(double e, double v) {
	return Math.sin(v) * e;
}
def code(e, v):
	return math.sin(v) * e
function code(e, v)
	return Float64(sin(v) * e)
end
function tmp = code(e, v)
	tmp = sin(v) * e;
end
code[e_, v_] := N[(N[Sin[v], $MachinePrecision] * e), $MachinePrecision]
\begin{array}{l}

\\
\sin v \cdot e
\end{array}
Derivation
  1. Initial program 99.8%

    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
  2. Add Preprocessing
  3. Taylor expanded in e around 0

    \[\leadsto \color{blue}{e \cdot \sin v} \]
  4. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \color{blue}{\sin v \cdot e} \]
    2. lower-*.f64N/A

      \[\leadsto \color{blue}{\sin v \cdot e} \]
    3. lower-sin.f6497.3

      \[\leadsto \color{blue}{\sin v} \cdot e \]
  5. Applied rewrites97.3%

    \[\leadsto \color{blue}{\sin v \cdot e} \]
  6. Add Preprocessing

Alternative 7: 52.1% accurate, 3.6× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;v \leq 3.2:\\ \;\;\;\;\frac{\mathsf{fma}\left(v, e, \left(\left(\mathsf{fma}\left(0.008333333333333333, \left(v \cdot v\right) \cdot e, -0.16666666666666666 \cdot e\right) \cdot v\right) \cdot v\right) \cdot v\right)}{1 + e}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-e\right) \cdot v\right) \cdot e\\ \end{array} \end{array} \]
(FPCore (e v)
 :precision binary64
 (if (<= v 3.2)
   (/
    (fma
     v
     e
     (*
      (*
       (*
        (fma 0.008333333333333333 (* (* v v) e) (* -0.16666666666666666 e))
        v)
       v)
      v))
    (+ 1.0 e))
   (* (* (- e) v) e)))
double code(double e, double v) {
	double tmp;
	if (v <= 3.2) {
		tmp = fma(v, e, (((fma(0.008333333333333333, ((v * v) * e), (-0.16666666666666666 * e)) * v) * v) * v)) / (1.0 + e);
	} else {
		tmp = (-e * v) * e;
	}
	return tmp;
}
function code(e, v)
	tmp = 0.0
	if (v <= 3.2)
		tmp = Float64(fma(v, e, Float64(Float64(Float64(fma(0.008333333333333333, Float64(Float64(v * v) * e), Float64(-0.16666666666666666 * e)) * v) * v) * v)) / Float64(1.0 + e));
	else
		tmp = Float64(Float64(Float64(-e) * v) * e);
	end
	return tmp
end
code[e_, v_] := If[LessEqual[v, 3.2], N[(N[(v * e + N[(N[(N[(N[(0.008333333333333333 * N[(N[(v * v), $MachinePrecision] * e), $MachinePrecision] + N[(-0.16666666666666666 * e), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision] * v), $MachinePrecision] * v), $MachinePrecision]), $MachinePrecision] / N[(1.0 + e), $MachinePrecision]), $MachinePrecision], N[(N[((-e) * v), $MachinePrecision] * e), $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;v \leq 3.2:\\
\;\;\;\;\frac{\mathsf{fma}\left(v, e, \left(\left(\mathsf{fma}\left(0.008333333333333333, \left(v \cdot v\right) \cdot e, -0.16666666666666666 \cdot e\right) \cdot v\right) \cdot v\right) \cdot v\right)}{1 + e}\\

\mathbf{else}:\\
\;\;\;\;\left(\left(-e\right) \cdot v\right) \cdot e\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if v < 3.2000000000000002

    1. Initial program 99.8%

      \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
    2. Add Preprocessing
    3. Taylor expanded in v around 0

      \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
    4. Step-by-step derivation
      1. lower-+.f6499.2

        \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
    5. Applied rewrites99.2%

      \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
    6. Taylor expanded in v around 0

      \[\leadsto \frac{\color{blue}{v \cdot \left(e + {v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right)\right)}}{1 + e} \]
    7. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left(e + {v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right)\right) \cdot v}}{1 + e} \]
      2. lower-*.f64N/A

        \[\leadsto \frac{\color{blue}{\left(e + {v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right)\right) \cdot v}}{1 + e} \]
      3. +-commutativeN/A

        \[\leadsto \frac{\color{blue}{\left({v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right) + e\right)} \cdot v}{1 + e} \]
      4. *-commutativeN/A

        \[\leadsto \frac{\left(\color{blue}{\left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right) \cdot {v}^{2}} + e\right) \cdot v}{1 + e} \]
      5. lower-fma.f64N/A

        \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right), {v}^{2}, e\right)} \cdot v}{1 + e} \]
      6. +-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{1}{120} \cdot \left(e \cdot {v}^{2}\right) + \frac{-1}{6} \cdot e}, {v}^{2}, e\right) \cdot v}{1 + e} \]
      7. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(e \cdot {v}^{2}\right) \cdot \frac{1}{120}} + \frac{-1}{6} \cdot e, {v}^{2}, e\right) \cdot v}{1 + e} \]
      8. lower-fma.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(e \cdot {v}^{2}, \frac{1}{120}, \frac{-1}{6} \cdot e\right)}, {v}^{2}, e\right) \cdot v}{1 + e} \]
      9. *-commutativeN/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{{v}^{2} \cdot e}, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
      10. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{{v}^{2} \cdot e}, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
      11. unpow2N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(v \cdot v\right)} \cdot e, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
      12. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(v \cdot v\right)} \cdot e, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
      13. lower-*.f64N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, \frac{1}{120}, \color{blue}{\frac{-1}{6} \cdot e}\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
      14. unpow2N/A

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, \frac{1}{120}, \frac{-1}{6} \cdot e\right), \color{blue}{v \cdot v}, e\right) \cdot v}{1 + e} \]
      15. lower-*.f6462.3

        \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, 0.008333333333333333, -0.16666666666666666 \cdot e\right), \color{blue}{v \cdot v}, e\right) \cdot v}{1 + e} \]
    8. Applied rewrites62.3%

      \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, 0.008333333333333333, -0.16666666666666666 \cdot e\right), v \cdot v, e\right) \cdot v}}{1 + e} \]
    9. Step-by-step derivation
      1. Applied rewrites62.3%

        \[\leadsto \frac{\mathsf{fma}\left(v, \color{blue}{e}, \left(\left(\mathsf{fma}\left(0.008333333333333333, \left(v \cdot v\right) \cdot e, -0.16666666666666666 \cdot e\right) \cdot v\right) \cdot v\right) \cdot v\right)}{1 + e} \]

      if 3.2000000000000002 < v

      1. Initial program 99.7%

        \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
      2. Add Preprocessing
      3. Taylor expanded in v around 0

        \[\leadsto \color{blue}{\frac{e \cdot v}{1 + e}} \]
      4. Step-by-step derivation
        1. associate-*l/N/A

          \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
        2. lower-*.f64N/A

          \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
        3. lower-/.f64N/A

          \[\leadsto \color{blue}{\frac{e}{1 + e}} \cdot v \]
        4. lower-+.f643.7

          \[\leadsto \frac{e}{\color{blue}{1 + e}} \cdot v \]
      5. Applied rewrites3.7%

        \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
      6. Taylor expanded in e around 0

        \[\leadsto e \cdot \color{blue}{v} \]
      7. Step-by-step derivation
        1. Applied rewrites3.7%

          \[\leadsto e \cdot \color{blue}{v} \]
        2. Taylor expanded in e around 0

          \[\leadsto e \cdot \color{blue}{\left(v + -1 \cdot \left(e \cdot v\right)\right)} \]
        3. Step-by-step derivation
          1. Applied rewrites3.7%

            \[\leadsto \left(\left(1 - e\right) \cdot v\right) \cdot \color{blue}{e} \]
          2. Taylor expanded in e around inf

            \[\leadsto \left(-1 \cdot \left(e \cdot v\right)\right) \cdot e \]
          3. Step-by-step derivation
            1. Applied rewrites5.9%

              \[\leadsto \left(\left(-e\right) \cdot v\right) \cdot e \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 8: 52.1% accurate, 4.1× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;v \leq 3.2:\\ \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(v \cdot v\right) \cdot 0.008333333333333333 - 0.16666666666666666\right) \cdot e, v \cdot v, e\right) \cdot v}{1 + e}\\ \mathbf{else}:\\ \;\;\;\;\left(\left(-e\right) \cdot v\right) \cdot e\\ \end{array} \end{array} \]
          (FPCore (e v)
           :precision binary64
           (if (<= v 3.2)
             (/
              (*
               (fma
                (* (- (* (* v v) 0.008333333333333333) 0.16666666666666666) e)
                (* v v)
                e)
               v)
              (+ 1.0 e))
             (* (* (- e) v) e)))
          double code(double e, double v) {
          	double tmp;
          	if (v <= 3.2) {
          		tmp = (fma(((((v * v) * 0.008333333333333333) - 0.16666666666666666) * e), (v * v), e) * v) / (1.0 + e);
          	} else {
          		tmp = (-e * v) * e;
          	}
          	return tmp;
          }
          
          function code(e, v)
          	tmp = 0.0
          	if (v <= 3.2)
          		tmp = Float64(Float64(fma(Float64(Float64(Float64(Float64(v * v) * 0.008333333333333333) - 0.16666666666666666) * e), Float64(v * v), e) * v) / Float64(1.0 + e));
          	else
          		tmp = Float64(Float64(Float64(-e) * v) * e);
          	end
          	return tmp
          end
          
          code[e_, v_] := If[LessEqual[v, 3.2], N[(N[(N[(N[(N[(N[(N[(v * v), $MachinePrecision] * 0.008333333333333333), $MachinePrecision] - 0.16666666666666666), $MachinePrecision] * e), $MachinePrecision] * N[(v * v), $MachinePrecision] + e), $MachinePrecision] * v), $MachinePrecision] / N[(1.0 + e), $MachinePrecision]), $MachinePrecision], N[(N[((-e) * v), $MachinePrecision] * e), $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;v \leq 3.2:\\
          \;\;\;\;\frac{\mathsf{fma}\left(\left(\left(v \cdot v\right) \cdot 0.008333333333333333 - 0.16666666666666666\right) \cdot e, v \cdot v, e\right) \cdot v}{1 + e}\\
          
          \mathbf{else}:\\
          \;\;\;\;\left(\left(-e\right) \cdot v\right) \cdot e\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if v < 3.2000000000000002

            1. Initial program 99.8%

              \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
            2. Add Preprocessing
            3. Taylor expanded in v around 0

              \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
            4. Step-by-step derivation
              1. lower-+.f6499.2

                \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
            5. Applied rewrites99.2%

              \[\leadsto \frac{e \cdot \sin v}{\color{blue}{1 + e}} \]
            6. Taylor expanded in v around 0

              \[\leadsto \frac{\color{blue}{v \cdot \left(e + {v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right)\right)}}{1 + e} \]
            7. Step-by-step derivation
              1. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{\left(e + {v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right)\right) \cdot v}}{1 + e} \]
              2. lower-*.f64N/A

                \[\leadsto \frac{\color{blue}{\left(e + {v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right)\right) \cdot v}}{1 + e} \]
              3. +-commutativeN/A

                \[\leadsto \frac{\color{blue}{\left({v}^{2} \cdot \left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right) + e\right)} \cdot v}{1 + e} \]
              4. *-commutativeN/A

                \[\leadsto \frac{\left(\color{blue}{\left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right)\right) \cdot {v}^{2}} + e\right) \cdot v}{1 + e} \]
              5. lower-fma.f64N/A

                \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{6} \cdot e + \frac{1}{120} \cdot \left(e \cdot {v}^{2}\right), {v}^{2}, e\right)} \cdot v}{1 + e} \]
              6. +-commutativeN/A

                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\frac{1}{120} \cdot \left(e \cdot {v}^{2}\right) + \frac{-1}{6} \cdot e}, {v}^{2}, e\right) \cdot v}{1 + e} \]
              7. *-commutativeN/A

                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\left(e \cdot {v}^{2}\right) \cdot \frac{1}{120}} + \frac{-1}{6} \cdot e, {v}^{2}, e\right) \cdot v}{1 + e} \]
              8. lower-fma.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\color{blue}{\mathsf{fma}\left(e \cdot {v}^{2}, \frac{1}{120}, \frac{-1}{6} \cdot e\right)}, {v}^{2}, e\right) \cdot v}{1 + e} \]
              9. *-commutativeN/A

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{{v}^{2} \cdot e}, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
              10. lower-*.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{{v}^{2} \cdot e}, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
              11. unpow2N/A

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(v \cdot v\right)} \cdot e, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
              12. lower-*.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\color{blue}{\left(v \cdot v\right)} \cdot e, \frac{1}{120}, \frac{-1}{6} \cdot e\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
              13. lower-*.f64N/A

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, \frac{1}{120}, \color{blue}{\frac{-1}{6} \cdot e}\right), {v}^{2}, e\right) \cdot v}{1 + e} \]
              14. unpow2N/A

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, \frac{1}{120}, \frac{-1}{6} \cdot e\right), \color{blue}{v \cdot v}, e\right) \cdot v}{1 + e} \]
              15. lower-*.f6462.3

                \[\leadsto \frac{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, 0.008333333333333333, -0.16666666666666666 \cdot e\right), \color{blue}{v \cdot v}, e\right) \cdot v}{1 + e} \]
            8. Applied rewrites62.3%

              \[\leadsto \frac{\color{blue}{\mathsf{fma}\left(\mathsf{fma}\left(\left(v \cdot v\right) \cdot e, 0.008333333333333333, -0.16666666666666666 \cdot e\right), v \cdot v, e\right) \cdot v}}{1 + e} \]
            9. Taylor expanded in e around 0

              \[\leadsto \frac{\mathsf{fma}\left(e \cdot \left(\frac{1}{120} \cdot {v}^{2} - \frac{1}{6}\right), v \cdot v, e\right) \cdot v}{1 + e} \]
            10. Step-by-step derivation
              1. Applied rewrites62.3%

                \[\leadsto \frac{\mathsf{fma}\left(\left(\left(v \cdot v\right) \cdot 0.008333333333333333 - 0.16666666666666666\right) \cdot e, v \cdot v, e\right) \cdot v}{1 + e} \]

              if 3.2000000000000002 < v

              1. Initial program 99.7%

                \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
              2. Add Preprocessing
              3. Taylor expanded in v around 0

                \[\leadsto \color{blue}{\frac{e \cdot v}{1 + e}} \]
              4. Step-by-step derivation
                1. associate-*l/N/A

                  \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                2. lower-*.f64N/A

                  \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                3. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{e}{1 + e}} \cdot v \]
                4. lower-+.f643.7

                  \[\leadsto \frac{e}{\color{blue}{1 + e}} \cdot v \]
              5. Applied rewrites3.7%

                \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
              6. Taylor expanded in e around 0

                \[\leadsto e \cdot \color{blue}{v} \]
              7. Step-by-step derivation
                1. Applied rewrites3.7%

                  \[\leadsto e \cdot \color{blue}{v} \]
                2. Taylor expanded in e around 0

                  \[\leadsto e \cdot \color{blue}{\left(v + -1 \cdot \left(e \cdot v\right)\right)} \]
                3. Step-by-step derivation
                  1. Applied rewrites3.7%

                    \[\leadsto \left(\left(1 - e\right) \cdot v\right) \cdot \color{blue}{e} \]
                  2. Taylor expanded in e around inf

                    \[\leadsto \left(-1 \cdot \left(e \cdot v\right)\right) \cdot e \]
                  3. Step-by-step derivation
                    1. Applied rewrites5.9%

                      \[\leadsto \left(\left(-e\right) \cdot v\right) \cdot e \]
                  4. Recombined 2 regimes into one program.
                  5. Add Preprocessing

                  Alternative 9: 51.7% accurate, 11.3× speedup?

                  \[\begin{array}{l} \\ \frac{e \cdot v}{1 + e} \end{array} \]
                  (FPCore (e v) :precision binary64 (/ (* e v) (+ 1.0 e)))
                  double code(double e, double v) {
                  	return (e * v) / (1.0 + e);
                  }
                  
                  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(e, v)
                  use fmin_fmax_functions
                      real(8), intent (in) :: e
                      real(8), intent (in) :: v
                      code = (e * v) / (1.0d0 + e)
                  end function
                  
                  public static double code(double e, double v) {
                  	return (e * v) / (1.0 + e);
                  }
                  
                  def code(e, v):
                  	return (e * v) / (1.0 + e)
                  
                  function code(e, v)
                  	return Float64(Float64(e * v) / Float64(1.0 + e))
                  end
                  
                  function tmp = code(e, v)
                  	tmp = (e * v) / (1.0 + e);
                  end
                  
                  code[e_, v_] := N[(N[(e * v), $MachinePrecision] / N[(1.0 + e), $MachinePrecision]), $MachinePrecision]
                  
                  \begin{array}{l}
                  
                  \\
                  \frac{e \cdot v}{1 + e}
                  \end{array}
                  
                  Derivation
                  1. Initial program 99.8%

                    \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
                  2. Add Preprocessing
                  3. Taylor expanded in v around 0

                    \[\leadsto \color{blue}{\frac{e \cdot v}{1 + e}} \]
                  4. Step-by-step derivation
                    1. associate-*l/N/A

                      \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                    2. lower-*.f64N/A

                      \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                    3. lower-/.f64N/A

                      \[\leadsto \color{blue}{\frac{e}{1 + e}} \cdot v \]
                    4. lower-+.f6447.6

                      \[\leadsto \frac{e}{\color{blue}{1 + e}} \cdot v \]
                  5. Applied rewrites47.6%

                    \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                  6. Step-by-step derivation
                    1. Applied rewrites47.6%

                      \[\leadsto \frac{e \cdot v}{\color{blue}{1 + e}} \]
                    2. Add Preprocessing

                    Alternative 10: 51.7% accurate, 11.3× speedup?

                    \[\begin{array}{l} \\ \frac{e}{1 + e} \cdot v \end{array} \]
                    (FPCore (e v) :precision binary64 (* (/ e (+ 1.0 e)) v))
                    double code(double e, double v) {
                    	return (e / (1.0 + e)) * v;
                    }
                    
                    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(e, v)
                    use fmin_fmax_functions
                        real(8), intent (in) :: e
                        real(8), intent (in) :: v
                        code = (e / (1.0d0 + e)) * v
                    end function
                    
                    public static double code(double e, double v) {
                    	return (e / (1.0 + e)) * v;
                    }
                    
                    def code(e, v):
                    	return (e / (1.0 + e)) * v
                    
                    function code(e, v)
                    	return Float64(Float64(e / Float64(1.0 + e)) * v)
                    end
                    
                    function tmp = code(e, v)
                    	tmp = (e / (1.0 + e)) * v;
                    end
                    
                    code[e_, v_] := N[(N[(e / N[(1.0 + e), $MachinePrecision]), $MachinePrecision] * v), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \frac{e}{1 + e} \cdot v
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
                    2. Add Preprocessing
                    3. Taylor expanded in v around 0

                      \[\leadsto \color{blue}{\frac{e \cdot v}{1 + e}} \]
                    4. Step-by-step derivation
                      1. associate-*l/N/A

                        \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                      3. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{e}{1 + e}} \cdot v \]
                      4. lower-+.f6447.6

                        \[\leadsto \frac{e}{\color{blue}{1 + e}} \cdot v \]
                    5. Applied rewrites47.6%

                      \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                    6. Add Preprocessing

                    Alternative 11: 51.4% accurate, 11.3× speedup?

                    \[\begin{array}{l} \\ \left(\mathsf{fma}\left(e - 1, e, 1\right) \cdot e\right) \cdot v \end{array} \]
                    (FPCore (e v) :precision binary64 (* (* (fma (- e 1.0) e 1.0) e) v))
                    double code(double e, double v) {
                    	return (fma((e - 1.0), e, 1.0) * e) * v;
                    }
                    
                    function code(e, v)
                    	return Float64(Float64(fma(Float64(e - 1.0), e, 1.0) * e) * v)
                    end
                    
                    code[e_, v_] := N[(N[(N[(N[(e - 1.0), $MachinePrecision] * e + 1.0), $MachinePrecision] * e), $MachinePrecision] * v), $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \left(\mathsf{fma}\left(e - 1, e, 1\right) \cdot e\right) \cdot v
                    \end{array}
                    
                    Derivation
                    1. Initial program 99.8%

                      \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
                    2. Add Preprocessing
                    3. Taylor expanded in v around 0

                      \[\leadsto \color{blue}{\frac{e \cdot v}{1 + e}} \]
                    4. Step-by-step derivation
                      1. associate-*l/N/A

                        \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                      2. lower-*.f64N/A

                        \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                      3. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{e}{1 + e}} \cdot v \]
                      4. lower-+.f6447.6

                        \[\leadsto \frac{e}{\color{blue}{1 + e}} \cdot v \]
                    5. Applied rewrites47.6%

                      \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                    6. Taylor expanded in e around 0

                      \[\leadsto \left(e \cdot \left(1 + e \cdot \left(e - 1\right)\right)\right) \cdot v \]
                    7. Step-by-step derivation
                      1. Applied rewrites46.9%

                        \[\leadsto \left(\mathsf{fma}\left(e - 1, e, 1\right) \cdot e\right) \cdot v \]
                      2. Add Preprocessing

                      Alternative 12: 51.2% accurate, 16.1× speedup?

                      \[\begin{array}{l} \\ \left(\left(1 - e\right) \cdot v\right) \cdot e \end{array} \]
                      (FPCore (e v) :precision binary64 (* (* (- 1.0 e) v) e))
                      double code(double e, double v) {
                      	return ((1.0 - e) * v) * e;
                      }
                      
                      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(e, v)
                      use fmin_fmax_functions
                          real(8), intent (in) :: e
                          real(8), intent (in) :: v
                          code = ((1.0d0 - e) * v) * e
                      end function
                      
                      public static double code(double e, double v) {
                      	return ((1.0 - e) * v) * e;
                      }
                      
                      def code(e, v):
                      	return ((1.0 - e) * v) * e
                      
                      function code(e, v)
                      	return Float64(Float64(Float64(1.0 - e) * v) * e)
                      end
                      
                      function tmp = code(e, v)
                      	tmp = ((1.0 - e) * v) * e;
                      end
                      
                      code[e_, v_] := N[(N[(N[(1.0 - e), $MachinePrecision] * v), $MachinePrecision] * e), $MachinePrecision]
                      
                      \begin{array}{l}
                      
                      \\
                      \left(\left(1 - e\right) \cdot v\right) \cdot e
                      \end{array}
                      
                      Derivation
                      1. Initial program 99.8%

                        \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
                      2. Add Preprocessing
                      3. Taylor expanded in v around 0

                        \[\leadsto \color{blue}{\frac{e \cdot v}{1 + e}} \]
                      4. Step-by-step derivation
                        1. associate-*l/N/A

                          \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                        2. lower-*.f64N/A

                          \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                        3. lower-/.f64N/A

                          \[\leadsto \color{blue}{\frac{e}{1 + e}} \cdot v \]
                        4. lower-+.f6447.6

                          \[\leadsto \frac{e}{\color{blue}{1 + e}} \cdot v \]
                      5. Applied rewrites47.6%

                        \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                      6. Taylor expanded in e around 0

                        \[\leadsto e \cdot \color{blue}{v} \]
                      7. Step-by-step derivation
                        1. Applied rewrites46.4%

                          \[\leadsto e \cdot \color{blue}{v} \]
                        2. Taylor expanded in e around 0

                          \[\leadsto e \cdot \color{blue}{\left(v + -1 \cdot \left(e \cdot v\right)\right)} \]
                        3. Step-by-step derivation
                          1. Applied rewrites46.7%

                            \[\leadsto \left(\left(1 - e\right) \cdot v\right) \cdot \color{blue}{e} \]
                          2. Add Preprocessing

                          Alternative 13: 50.6% accurate, 37.5× speedup?

                          \[\begin{array}{l} \\ e \cdot v \end{array} \]
                          (FPCore (e v) :precision binary64 (* e v))
                          double code(double e, double v) {
                          	return e * v;
                          }
                          
                          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(e, v)
                          use fmin_fmax_functions
                              real(8), intent (in) :: e
                              real(8), intent (in) :: v
                              code = e * v
                          end function
                          
                          public static double code(double e, double v) {
                          	return e * v;
                          }
                          
                          def code(e, v):
                          	return e * v
                          
                          function code(e, v)
                          	return Float64(e * v)
                          end
                          
                          function tmp = code(e, v)
                          	tmp = e * v;
                          end
                          
                          code[e_, v_] := N[(e * v), $MachinePrecision]
                          
                          \begin{array}{l}
                          
                          \\
                          e \cdot v
                          \end{array}
                          
                          Derivation
                          1. Initial program 99.8%

                            \[\frac{e \cdot \sin v}{1 + e \cdot \cos v} \]
                          2. Add Preprocessing
                          3. Taylor expanded in v around 0

                            \[\leadsto \color{blue}{\frac{e \cdot v}{1 + e}} \]
                          4. Step-by-step derivation
                            1. associate-*l/N/A

                              \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                            2. lower-*.f64N/A

                              \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                            3. lower-/.f64N/A

                              \[\leadsto \color{blue}{\frac{e}{1 + e}} \cdot v \]
                            4. lower-+.f6447.6

                              \[\leadsto \frac{e}{\color{blue}{1 + e}} \cdot v \]
                          5. Applied rewrites47.6%

                            \[\leadsto \color{blue}{\frac{e}{1 + e} \cdot v} \]
                          6. Taylor expanded in e around 0

                            \[\leadsto e \cdot \color{blue}{v} \]
                          7. Step-by-step derivation
                            1. Applied rewrites46.4%

                              \[\leadsto e \cdot \color{blue}{v} \]
                            2. Add Preprocessing

                            Reproduce

                            ?
                            herbie shell --seed 2024359 
                            (FPCore (e v)
                              :name "Trigonometry A"
                              :precision binary64
                              :pre (and (<= 0.0 e) (<= e 1.0))
                              (/ (* e (sin v)) (+ 1.0 (* e (cos v)))))