Example 2 from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 19.3s
Alternatives: 9
Speedup: N/A×

Specification

?
\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((-eh * tan(t)) / ew))
    code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
	return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((-eh * math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\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 9 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 99.8% accurate, 1.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\ \left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ (* (- eh) (tan t)) ew))))
   (fabs (- (* (* ew (cos t)) (cos t_1)) (* (* eh (sin t)) (sin t_1))))))
double code(double eh, double ew, double t) {
	double t_1 = atan(((-eh * tan(t)) / ew));
	return fabs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    t_1 = atan(((-eh * tan(t)) / ew))
    code = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))))
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.atan(((-eh * Math.tan(t)) / ew));
	return Math.abs((((ew * Math.cos(t)) * Math.cos(t_1)) - ((eh * Math.sin(t)) * Math.sin(t_1))));
}
def code(eh, ew, t):
	t_1 = math.atan(((-eh * math.tan(t)) / ew))
	return math.fabs((((ew * math.cos(t)) * math.cos(t_1)) - ((eh * math.sin(t)) * math.sin(t_1))))
function code(eh, ew, t)
	t_1 = atan(Float64(Float64(Float64(-eh) * tan(t)) / ew))
	return abs(Float64(Float64(Float64(ew * cos(t)) * cos(t_1)) - Float64(Float64(eh * sin(t)) * sin(t_1))))
end
function tmp = code(eh, ew, t)
	t_1 = atan(((-eh * tan(t)) / ew));
	tmp = abs((((ew * cos(t)) * cos(t_1)) - ((eh * sin(t)) * sin(t_1))));
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(N[((-eh) * N[Tan[t], $MachinePrecision]), $MachinePrecision] / ew), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Cos[t$95$1], $MachinePrecision]), $MachinePrecision] - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Sin[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\\
\left|\left(ew \cdot \cos t\right) \cdot \cos t\_1 - \left(eh \cdot \sin t\right) \cdot \sin t\_1\right|
\end{array}
\end{array}

Alternative 1: 99.8% accurate, 1.1× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(-eh\right) \cdot \frac{\tan t}{ew}\\ \left|\mathsf{fma}\left(eh \cdot \sin t, -\sin \tan^{-1} t\_1, \frac{ew \cdot \cos t}{\sqrt{1 + {t\_1}^{2}}}\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* (- eh) (/ (tan t) ew))))
   (fabs
    (fma
     (* eh (sin t))
     (- (sin (atan t_1)))
     (/ (* ew (cos t)) (sqrt (+ 1.0 (pow t_1 2.0))))))))
double code(double eh, double ew, double t) {
	double t_1 = -eh * (tan(t) / ew);
	return fabs(fma((eh * sin(t)), -sin(atan(t_1)), ((ew * cos(t)) / sqrt((1.0 + pow(t_1, 2.0))))));
}
function code(eh, ew, t)
	t_1 = Float64(Float64(-eh) * Float64(tan(t) / ew))
	return abs(fma(Float64(eh * sin(t)), Float64(-sin(atan(t_1))), Float64(Float64(ew * cos(t)) / sqrt(Float64(1.0 + (t_1 ^ 2.0))))))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[((-eh) * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]}, N[Abs[N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * (-N[Sin[N[ArcTan[t$95$1], $MachinePrecision]], $MachinePrecision]) + N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[t$95$1, 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left(-eh\right) \cdot \frac{\tan t}{ew}\\
\left|\mathsf{fma}\left(eh \cdot \sin t, -\sin \tan^{-1} t\_1, \frac{ew \cdot \cos t}{\sqrt{1 + {t\_1}^{2}}}\right)\right|
\end{array}
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
    2. sub-negN/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    3. +-commutativeN/A

      \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
    4. lift-*.f64N/A

      \[\leadsto \left|\left(\mathsf{neg}\left(\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    5. distribute-rgt-neg-inN/A

      \[\leadsto \left|\color{blue}{\left(eh \cdot \sin t\right) \cdot \left(\mathsf{neg}\left(\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)} + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    6. lower-fma.f64N/A

      \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh \cdot \sin t, \mathsf{neg}\left(\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right), \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh \cdot \sin t, -\sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
  5. Add Preprocessing

Alternative 2: 98.4% accurate, 1.5× speedup?

\[\begin{array}{l} \\ \left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (fma
   (- (* eh (tan t)))
   (cos t)
   (/ (* ew (cos t)) (sqrt (+ 1.0 (pow (* (- eh) (/ (tan t) ew)) 2.0)))))))
double code(double eh, double ew, double t) {
	return fabs(fma(-(eh * tan(t)), cos(t), ((ew * cos(t)) / sqrt((1.0 + pow((-eh * (tan(t) / ew)), 2.0))))));
}
function code(eh, ew, t)
	return abs(fma(Float64(-Float64(eh * tan(t))), cos(t), Float64(Float64(ew * cos(t)) / sqrt(Float64(1.0 + (Float64(Float64(-eh) * Float64(tan(t) / ew)) ^ 2.0))))))
end
code[eh_, ew_, t_] := N[Abs[N[((-N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]) * N[Cos[t], $MachinePrecision] + N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / N[Sqrt[N[(1.0 + N[Power[N[((-eh) * N[(N[Tan[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
    2. sub-negN/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    3. +-commutativeN/A

      \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
  4. Applied rewrites75.4%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \frac{1}{ew \cdot \sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}} \cdot \left(eh \cdot \left(-\sin t\right)\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
  5. Taylor expanded in eh around -inf

    \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
  6. Step-by-step derivation
    1. lower-cos.f6498.3

      \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
  7. Applied rewrites98.3%

    \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
  8. Final simplification98.3%

    \[\leadsto \left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
  9. Add Preprocessing

Alternative 3: 98.0% accurate, 2.6× speedup?

\[\begin{array}{l} \\ \left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{1}\right)\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs (fma (- (* eh (tan t))) (cos t) (/ (* ew (cos t)) 1.0))))
double code(double eh, double ew, double t) {
	return fabs(fma(-(eh * tan(t)), cos(t), ((ew * cos(t)) / 1.0)));
}
function code(eh, ew, t)
	return abs(fma(Float64(-Float64(eh * tan(t))), cos(t), Float64(Float64(ew * cos(t)) / 1.0)))
end
code[eh_, ew_, t_] := N[Abs[N[((-N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]) * N[Cos[t], $MachinePrecision] + N[(N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{1}\right)\right|
\end{array}
Derivation
  1. Initial program 99.8%

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Add Preprocessing
  3. Step-by-step derivation
    1. lift--.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
    2. sub-negN/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
    3. +-commutativeN/A

      \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
  4. Applied rewrites75.4%

    \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \frac{1}{ew \cdot \sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}} \cdot \left(eh \cdot \left(-\sin t\right)\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
  5. Taylor expanded in eh around -inf

    \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
  6. Step-by-step derivation
    1. lower-cos.f6498.3

      \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
  7. Applied rewrites98.3%

    \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
  8. Taylor expanded in eh around 0

    \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\color{blue}{1}}\right)\right| \]
  9. Step-by-step derivation
    1. Applied rewrites97.9%

      \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\color{blue}{1}}\right)\right| \]
    2. Final simplification97.9%

      \[\leadsto \left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{1}\right)\right| \]
    3. Add Preprocessing

    Alternative 4: 74.7% accurate, 3.4× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{+24}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+73}:\\ \;\;\;\;\left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{\mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)}{1}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin t\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (if (<= t -8e+24)
       (fabs (* ew (cos t)))
       (if (<= t 7.2e+73)
         (fabs
          (fma (- (* eh (tan t))) (cos t) (/ (fma -0.5 (* ew (* t t)) ew) 1.0)))
         (fabs (* eh (sin t))))))
    double code(double eh, double ew, double t) {
    	double tmp;
    	if (t <= -8e+24) {
    		tmp = fabs((ew * cos(t)));
    	} else if (t <= 7.2e+73) {
    		tmp = fabs(fma(-(eh * tan(t)), cos(t), (fma(-0.5, (ew * (t * t)), ew) / 1.0)));
    	} else {
    		tmp = fabs((eh * sin(t)));
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	tmp = 0.0
    	if (t <= -8e+24)
    		tmp = abs(Float64(ew * cos(t)));
    	elseif (t <= 7.2e+73)
    		tmp = abs(fma(Float64(-Float64(eh * tan(t))), cos(t), Float64(fma(-0.5, Float64(ew * Float64(t * t)), ew) / 1.0)));
    	else
    		tmp = abs(Float64(eh * sin(t)));
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := If[LessEqual[t, -8e+24], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 7.2e+73], N[Abs[N[((-N[(eh * N[Tan[t], $MachinePrecision]), $MachinePrecision]) * N[Cos[t], $MachinePrecision] + N[(N[(-0.5 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision] / 1.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;t \leq -8 \cdot 10^{+24}:\\
    \;\;\;\;\left|ew \cdot \cos t\right|\\
    
    \mathbf{elif}\;t \leq 7.2 \cdot 10^{+73}:\\
    \;\;\;\;\left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{\mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)}{1}\right)\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|eh \cdot \sin t\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if t < -7.9999999999999999e24

      1. Initial program 99.6%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
        2. lift-*.f64N/A

          \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        3. lift-cos.f64N/A

          \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        4. lift-atan.f64N/A

          \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        5. cos-atanN/A

          \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        6. un-div-invN/A

          \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        7. lift-*.f64N/A

          \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
        8. *-commutativeN/A

          \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)}\right| \]
      4. Applied rewrites76.4%

        \[\leadsto \color{blue}{\left|\frac{ew \cdot \cos t - eh \cdot \left(\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \sin t\right)}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|} \]
      5. Taylor expanded in ew around inf

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
      6. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
        2. lower-cos.f6456.3

          \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
      7. Applied rewrites56.3%

        \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

      if -7.9999999999999999e24 < t < 7.1999999999999998e73

      1. Initial program 99.9%

        \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
      2. Add Preprocessing
      3. Step-by-step derivation
        1. lift--.f64N/A

          \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
        2. sub-negN/A

          \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
        3. +-commutativeN/A

          \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
      4. Applied rewrites78.5%

        \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \frac{1}{ew \cdot \sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}} \cdot \left(eh \cdot \left(-\sin t\right)\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
      5. Taylor expanded in eh around -inf

        \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
      6. Step-by-step derivation
        1. lower-cos.f6498.3

          \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
      7. Applied rewrites98.3%

        \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \color{blue}{\cos t}, \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)\right| \]
      8. Taylor expanded in eh around 0

        \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\color{blue}{1}}\right)\right| \]
      9. Step-by-step derivation
        1. Applied rewrites98.3%

          \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{ew \cdot \cos t}{\color{blue}{1}}\right)\right| \]
        2. Taylor expanded in t around 0

          \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\color{blue}{ew + \frac{-1}{2} \cdot \left(ew \cdot {t}^{2}\right)}}{1}\right)\right| \]
        3. Step-by-step derivation
          1. associate-*r*N/A

            \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{ew + \color{blue}{\left(\frac{-1}{2} \cdot ew\right) \cdot {t}^{2}}}{1}\right)\right| \]
          2. +-commutativeN/A

            \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\color{blue}{\left(\frac{-1}{2} \cdot ew\right) \cdot {t}^{2} + ew}}{1}\right)\right| \]
          3. associate-*r*N/A

            \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\color{blue}{\frac{-1}{2} \cdot \left(ew \cdot {t}^{2}\right)} + ew}{1}\right)\right| \]
          4. lower-fma.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\color{blue}{\mathsf{fma}\left(\frac{-1}{2}, ew \cdot {t}^{2}, ew\right)}}{1}\right)\right| \]
          5. lower-*.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\mathsf{fma}\left(\frac{-1}{2}, \color{blue}{ew \cdot {t}^{2}}, ew\right)}{1}\right)\right| \]
          6. unpow2N/A

            \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\mathsf{fma}\left(\frac{-1}{2}, ew \cdot \color{blue}{\left(t \cdot t\right)}, ew\right)}{1}\right)\right| \]
          7. lower-*.f6493.9

            \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\mathsf{fma}\left(-0.5, ew \cdot \color{blue}{\left(t \cdot t\right)}, ew\right)}{1}\right)\right| \]
        4. Applied rewrites93.9%

          \[\leadsto \left|\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \cos t, \frac{\color{blue}{\mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)}}{1}\right)\right| \]

        if 7.1999999999999998e73 < t

        1. Initial program 99.8%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
          2. lift-*.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          3. lift-cos.f64N/A

            \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          4. lift-atan.f64N/A

            \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          5. cos-atanN/A

            \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          6. un-div-invN/A

            \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          7. lift-*.f64N/A

            \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
          8. *-commutativeN/A

            \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)}\right| \]
        4. Applied rewrites57.6%

          \[\leadsto \color{blue}{\left|\frac{ew \cdot \cos t - eh \cdot \left(\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \sin t\right)}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|} \]
        5. Taylor expanded in ew around 0

          \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
          2. lower-sin.f6467.0

            \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
        7. Applied rewrites67.0%

          \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
      10. Recombined 3 regimes into one program.
      11. Final simplification79.7%

        \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -8 \cdot 10^{+24}:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;t \leq 7.2 \cdot 10^{+73}:\\ \;\;\;\;\left|\mathsf{fma}\left(-eh \cdot \tan t, \cos t, \frac{\mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)}{1}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin t\right|\\ \end{array} \]
      12. Add Preprocessing

      Alternative 5: 75.5% accurate, 3.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -0.075:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;t \leq 0.00035:\\ \;\;\;\;\left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right), ew\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin t\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (<= t -0.075)
         (fabs (* ew (cos t)))
         (if (<= t 0.00035)
           (fabs (fma (- eh) (* t (sin (atan (/ (* eh t) (- ew))))) ew))
           (fabs (* eh (sin t))))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if (t <= -0.075) {
      		tmp = fabs((ew * cos(t)));
      	} else if (t <= 0.00035) {
      		tmp = fabs(fma(-eh, (t * sin(atan(((eh * t) / -ew)))), ew));
      	} else {
      		tmp = fabs((eh * sin(t)));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if (t <= -0.075)
      		tmp = abs(Float64(ew * cos(t)));
      	elseif (t <= 0.00035)
      		tmp = abs(fma(Float64(-eh), Float64(t * sin(atan(Float64(Float64(eh * t) / Float64(-ew))))), ew));
      	else
      		tmp = abs(Float64(eh * sin(t)));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := If[LessEqual[t, -0.075], N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[t, 0.00035], N[Abs[N[((-eh) * N[(t * N[Sin[N[ArcTan[N[(N[(eh * t), $MachinePrecision] / (-ew)), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -0.075:\\
      \;\;\;\;\left|ew \cdot \cos t\right|\\
      
      \mathbf{elif}\;t \leq 0.00035:\\
      \;\;\;\;\left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right), ew\right)\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|eh \cdot \sin t\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if t < -0.0749999999999999972

        1. Initial program 99.6%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
          2. lift-*.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          3. lift-cos.f64N/A

            \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          4. lift-atan.f64N/A

            \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          5. cos-atanN/A

            \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          6. un-div-invN/A

            \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          7. lift-*.f64N/A

            \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
          8. *-commutativeN/A

            \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)}\right| \]
        4. Applied rewrites75.2%

          \[\leadsto \color{blue}{\left|\frac{ew \cdot \cos t - eh \cdot \left(\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \sin t\right)}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|} \]
        5. Taylor expanded in ew around inf

          \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
        6. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
          2. lower-cos.f6455.2

            \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
        7. Applied rewrites55.2%

          \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

        if -0.0749999999999999972 < t < 3.49999999999999996e-4

        1. Initial program 100.0%

          \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
        2. Add Preprocessing
        3. Step-by-step derivation
          1. lift--.f64N/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
          2. sub-negN/A

            \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
          3. +-commutativeN/A

            \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
          4. lift-*.f64N/A

            \[\leadsto \left|\left(\mathsf{neg}\left(\color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          5. distribute-rgt-neg-inN/A

            \[\leadsto \left|\color{blue}{\left(eh \cdot \sin t\right) \cdot \left(\mathsf{neg}\left(\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)} + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          6. lower-fma.f64N/A

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh \cdot \sin t, \mathsf{neg}\left(\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right), \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
        4. Applied rewrites100.0%

          \[\leadsto \left|\color{blue}{\mathsf{fma}\left(eh \cdot \sin t, -\sin \tan^{-1} \left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
        5. Taylor expanded in t around 0

          \[\leadsto \left|\color{blue}{ew + -1 \cdot \left(eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right)}\right| \]
        6. Step-by-step derivation
          1. +-commutativeN/A

            \[\leadsto \left|\color{blue}{-1 \cdot \left(eh \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)\right) + ew}\right| \]
          2. associate-*r*N/A

            \[\leadsto \left|\color{blue}{\left(-1 \cdot eh\right) \cdot \left(t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)\right)} + ew\right| \]
          3. lower-fma.f64N/A

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(-1 \cdot eh, t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right), ew\right)}\right| \]
          4. mul-1-negN/A

            \[\leadsto \left|\mathsf{fma}\left(\color{blue}{\mathsf{neg}\left(eh\right)}, t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right), ew\right)\right| \]
          5. lower-neg.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(\color{blue}{-eh}, t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right), ew\right)\right| \]
          6. lower-*.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(-eh, \color{blue}{t \cdot \sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}, ew\right)\right| \]
          7. lower-sin.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \color{blue}{\sin \tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}, ew\right)\right| \]
          8. lower-atan.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \color{blue}{\tan^{-1} \left(-1 \cdot \frac{eh \cdot \tan t}{ew}\right)}, ew\right)\right| \]
          9. mul-1-negN/A

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \color{blue}{\left(\mathsf{neg}\left(\frac{eh \cdot \tan t}{ew}\right)\right)}, ew\right)\right| \]
          10. lower-neg.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \color{blue}{\left(-\frac{eh \cdot \tan t}{ew}\right)}, ew\right)\right| \]
          11. lower-/.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh \cdot \tan t}{ew}}\right), ew\right)\right| \]
          12. lower-*.f64N/A

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(-\frac{\color{blue}{eh \cdot \tan t}}{ew}\right), ew\right)\right| \]
          13. lower-tan.f6498.0

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(-\frac{eh \cdot \color{blue}{\tan t}}{ew}\right), ew\right)\right| \]
        7. Applied rewrites98.0%

          \[\leadsto \left|\color{blue}{\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(-\frac{eh \cdot \tan t}{ew}\right), ew\right)}\right| \]
        8. Taylor expanded in t around 0

          \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(-\frac{eh \cdot t}{ew}\right), ew\right)\right| \]
        9. Step-by-step derivation
          1. Applied rewrites98.0%

            \[\leadsto \left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(-\frac{t \cdot eh}{ew}\right), ew\right)\right| \]

          if 3.49999999999999996e-4 < t

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            2. lift-*.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            3. lift-cos.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            4. lift-atan.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            5. cos-atanN/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            6. un-div-invN/A

              \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            7. lift-*.f64N/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            8. *-commutativeN/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)}\right| \]
          4. Applied rewrites53.6%

            \[\leadsto \color{blue}{\left|\frac{ew \cdot \cos t - eh \cdot \left(\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \sin t\right)}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|} \]
          5. Taylor expanded in ew around 0

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
            2. lower-sin.f6469.4

              \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
          7. Applied rewrites69.4%

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
        10. Recombined 3 regimes into one program.
        11. Final simplification79.3%

          \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -0.075:\\ \;\;\;\;\left|ew \cdot \cos t\right|\\ \mathbf{elif}\;t \leq 0.00035:\\ \;\;\;\;\left|\mathsf{fma}\left(-eh, t \cdot \sin \tan^{-1} \left(\frac{eh \cdot t}{-ew}\right), ew\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|eh \cdot \sin t\right|\\ \end{array} \]
        12. Add Preprocessing

        Alternative 6: 74.4% accurate, 7.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \cos t\right|\\ \mathbf{if}\;ew \leq -3.9 \cdot 10^{-74}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 4.2 \cdot 10^{-41}:\\ \;\;\;\;\left|eh \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (fabs (* ew (cos t)))))
           (if (<= ew -3.9e-74) t_1 (if (<= ew 4.2e-41) (fabs (* eh (sin t))) t_1))))
        double code(double eh, double ew, double t) {
        	double t_1 = fabs((ew * cos(t)));
        	double tmp;
        	if (ew <= -3.9e-74) {
        		tmp = t_1;
        	} else if (ew <= 4.2e-41) {
        		tmp = fabs((eh * sin(t)));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        real(8) function code(eh, ew, t)
            real(8), intent (in) :: eh
            real(8), intent (in) :: ew
            real(8), intent (in) :: t
            real(8) :: t_1
            real(8) :: tmp
            t_1 = abs((ew * cos(t)))
            if (ew <= (-3.9d-74)) then
                tmp = t_1
            else if (ew <= 4.2d-41) then
                tmp = abs((eh * sin(t)))
            else
                tmp = t_1
            end if
            code = tmp
        end function
        
        public static double code(double eh, double ew, double t) {
        	double t_1 = Math.abs((ew * Math.cos(t)));
        	double tmp;
        	if (ew <= -3.9e-74) {
        		tmp = t_1;
        	} else if (ew <= 4.2e-41) {
        		tmp = Math.abs((eh * Math.sin(t)));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(eh, ew, t):
        	t_1 = math.fabs((ew * math.cos(t)))
        	tmp = 0
        	if ew <= -3.9e-74:
        		tmp = t_1
        	elif ew <= 4.2e-41:
        		tmp = math.fabs((eh * math.sin(t)))
        	else:
        		tmp = t_1
        	return tmp
        
        function code(eh, ew, t)
        	t_1 = abs(Float64(ew * cos(t)))
        	tmp = 0.0
        	if (ew <= -3.9e-74)
        		tmp = t_1;
        	elseif (ew <= 4.2e-41)
        		tmp = abs(Float64(eh * sin(t)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(eh, ew, t)
        	t_1 = abs((ew * cos(t)));
        	tmp = 0.0;
        	if (ew <= -3.9e-74)
        		tmp = t_1;
        	elseif (ew <= 4.2e-41)
        		tmp = abs((eh * sin(t)));
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -3.9e-74], t$95$1, If[LessEqual[ew, 4.2e-41], N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left|ew \cdot \cos t\right|\\
        \mathbf{if}\;ew \leq -3.9 \cdot 10^{-74}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;ew \leq 4.2 \cdot 10^{-41}:\\
        \;\;\;\;\left|eh \cdot \sin t\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if ew < -3.9000000000000001e-74 or 4.20000000000000025e-41 < ew

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            2. lift-*.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            3. lift-cos.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            4. lift-atan.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            5. cos-atanN/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            6. un-div-invN/A

              \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            7. lift-*.f64N/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            8. *-commutativeN/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)}\right| \]
          4. Applied rewrites90.8%

            \[\leadsto \color{blue}{\left|\frac{ew \cdot \cos t - eh \cdot \left(\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \sin t\right)}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|} \]
          5. Taylor expanded in ew around inf

            \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]
            2. lower-cos.f6477.3

              \[\leadsto \left|ew \cdot \color{blue}{\cos t}\right| \]
          7. Applied rewrites77.3%

            \[\leadsto \left|\color{blue}{ew \cdot \cos t}\right| \]

          if -3.9000000000000001e-74 < ew < 4.20000000000000025e-41

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            2. lift-*.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            3. lift-cos.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            4. lift-atan.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            5. cos-atanN/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            6. un-div-invN/A

              \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            7. lift-*.f64N/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            8. *-commutativeN/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)}\right| \]
          4. Applied rewrites47.8%

            \[\leadsto \color{blue}{\left|\frac{ew \cdot \cos t - eh \cdot \left(\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \sin t\right)}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|} \]
          5. Taylor expanded in ew around 0

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
            2. lower-sin.f6477.0

              \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
          7. Applied rewrites77.0%

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
        3. Recombined 2 regimes into one program.
        4. Add Preprocessing

        Alternative 7: 60.5% accurate, 7.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|eh \cdot \sin t\right|\\ \mathbf{if}\;t \leq -1.02 \cdot 10^{-47}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;t \leq 8.2 \cdot 10^{-118}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh \cdot \left(eh \cdot \frac{t \cdot t}{ew}\right), 0.5, \mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (fabs (* eh (sin t)))))
           (if (<= t -1.02e-47)
             t_1
             (if (<= t 8.2e-118)
               (fabs
                (fma (* eh (* eh (/ (* t t) ew))) 0.5 (fma -0.5 (* ew (* t t)) ew)))
               t_1))))
        double code(double eh, double ew, double t) {
        	double t_1 = fabs((eh * sin(t)));
        	double tmp;
        	if (t <= -1.02e-47) {
        		tmp = t_1;
        	} else if (t <= 8.2e-118) {
        		tmp = fabs(fma((eh * (eh * ((t * t) / ew))), 0.5, fma(-0.5, (ew * (t * t)), ew)));
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        function code(eh, ew, t)
        	t_1 = abs(Float64(eh * sin(t)))
        	tmp = 0.0
        	if (t <= -1.02e-47)
        		tmp = t_1;
        	elseif (t <= 8.2e-118)
        		tmp = abs(fma(Float64(eh * Float64(eh * Float64(Float64(t * t) / ew))), 0.5, fma(-0.5, Float64(ew * Float64(t * t)), ew)));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[t, -1.02e-47], t$95$1, If[LessEqual[t, 8.2e-118], N[Abs[N[(N[(eh * N[(eh * N[(N[(t * t), $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 0.5 + N[(-0.5 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left|eh \cdot \sin t\right|\\
        \mathbf{if}\;t \leq -1.02 \cdot 10^{-47}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;t \leq 8.2 \cdot 10^{-118}:\\
        \;\;\;\;\left|\mathsf{fma}\left(eh \cdot \left(eh \cdot \frac{t \cdot t}{ew}\right), 0.5, \mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)\right)\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if t < -1.02000000000000002e-47 or 8.2000000000000006e-118 < t

          1. Initial program 99.7%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            2. lift-*.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            3. lift-cos.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            4. lift-atan.f64N/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \color{blue}{\tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            5. cos-atanN/A

              \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \color{blue}{\frac{1}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            6. un-div-invN/A

              \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            7. lift-*.f64N/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            8. *-commutativeN/A

              \[\leadsto \left|\frac{ew \cdot \cos t}{\sqrt{1 + \frac{\left(-eh\right) \cdot \tan t}{ew} \cdot \frac{\left(-eh\right) \cdot \tan t}{ew}}} - \color{blue}{\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) \cdot \left(eh \cdot \sin t\right)}\right| \]
          4. Applied rewrites66.0%

            \[\leadsto \color{blue}{\left|\frac{ew \cdot \cos t - eh \cdot \left(\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right) \cdot \sin t\right)}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right|} \]
          5. Taylor expanded in ew around 0

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
          6. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]
            2. lower-sin.f6458.4

              \[\leadsto \left|eh \cdot \color{blue}{\sin t}\right| \]
          7. Applied rewrites58.4%

            \[\leadsto \left|\color{blue}{eh \cdot \sin t}\right| \]

          if -1.02000000000000002e-47 < t < 8.2000000000000006e-118

          1. Initial program 100.0%

            \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
          2. Add Preprocessing
          3. Step-by-step derivation
            1. lift--.f64N/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            2. sub-negN/A

              \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
            3. +-commutativeN/A

              \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
          4. Applied rewrites87.6%

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \frac{1}{ew \cdot \sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}} \cdot \left(eh \cdot \left(-\sin t\right)\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
          5. Taylor expanded in t around 0

            \[\leadsto \left|\color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)\right)}\right| \]
          6. Step-by-step derivation
            1. +-commutativeN/A

              \[\leadsto \left|\color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)\right) + ew}\right| \]
            2. lower-fma.f64N/A

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)}\right| \]
            3. unpow2N/A

              \[\leadsto \left|\mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
            4. lower-*.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
            5. lower-fma.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, ew, \frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)}, ew\right)\right| \]
            6. distribute-lft1-inN/A

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\left(\frac{-1}{2} + 1\right) \cdot \frac{{eh}^{2}}{ew}}\right), ew\right)\right| \]
            7. metadata-evalN/A

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{1}{2}} \cdot \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
            8. associate-*r/N/A

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{\frac{1}{2} \cdot {eh}^{2}}{ew}}\right), ew\right)\right| \]
            9. lower-/.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{\frac{1}{2} \cdot {eh}^{2}}{ew}}\right), ew\right)\right| \]
            10. lower-*.f64N/A

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \frac{\color{blue}{\frac{1}{2} \cdot {eh}^{2}}}{ew}\right), ew\right)\right| \]
            11. unpow2N/A

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \frac{\frac{1}{2} \cdot \color{blue}{\left(eh \cdot eh\right)}}{ew}\right), ew\right)\right| \]
            12. lower-*.f6467.5

              \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(-0.5, ew, \frac{0.5 \cdot \color{blue}{\left(eh \cdot eh\right)}}{ew}\right), ew\right)\right| \]
          7. Applied rewrites67.5%

            \[\leadsto \left|\color{blue}{\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(-0.5, ew, \frac{0.5 \cdot \left(eh \cdot eh\right)}{ew}\right), ew\right)}\right| \]
          8. Taylor expanded in eh around 0

            \[\leadsto \left|ew + \color{blue}{\left(\frac{-1}{2} \cdot \left(ew \cdot {t}^{2}\right) + \frac{1}{2} \cdot \frac{{eh}^{2} \cdot {t}^{2}}{ew}\right)}\right| \]
          9. Step-by-step derivation
            1. Applied rewrites68.8%

              \[\leadsto \left|ew + \color{blue}{\mathsf{fma}\left(0.5, \left(eh \cdot eh\right) \cdot \frac{t \cdot t}{ew}, -0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right)}\right| \]
            2. Step-by-step derivation
              1. Applied rewrites78.3%

                \[\leadsto \left|\mathsf{fma}\left(eh \cdot \left(eh \cdot \frac{t \cdot t}{ew}\right), 0.5, \mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)\right)\right| \]
            3. Recombined 2 regimes into one program.
            4. Add Preprocessing

            Alternative 8: 39.1% accurate, 45.4× speedup?

            \[\begin{array}{l} \\ \left|\mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)\right| \end{array} \]
            (FPCore (eh ew t) :precision binary64 (fabs (fma -0.5 (* ew (* t t)) ew)))
            double code(double eh, double ew, double t) {
            	return fabs(fma(-0.5, (ew * (t * t)), ew));
            }
            
            function code(eh, ew, t)
            	return abs(fma(-0.5, Float64(ew * Float64(t * t)), ew))
            end
            
            code[eh_, ew_, t_] := N[Abs[N[(-0.5 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision] + ew), $MachinePrecision]], $MachinePrecision]
            
            \begin{array}{l}
            
            \\
            \left|\mathsf{fma}\left(-0.5, ew \cdot \left(t \cdot t\right), ew\right)\right|
            \end{array}
            
            Derivation
            1. Initial program 99.8%

              \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
            2. Add Preprocessing
            3. Step-by-step derivation
              1. lift--.f64N/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
              2. sub-negN/A

                \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
              3. +-commutativeN/A

                \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
            4. Applied rewrites75.4%

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \frac{1}{ew \cdot \sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}} \cdot \left(eh \cdot \left(-\sin t\right)\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
            5. Taylor expanded in t around 0

              \[\leadsto \left|\color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)\right)}\right| \]
            6. Step-by-step derivation
              1. +-commutativeN/A

                \[\leadsto \left|\color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)\right) + ew}\right| \]
              2. lower-fma.f64N/A

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)}\right| \]
              3. unpow2N/A

                \[\leadsto \left|\mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
              4. lower-*.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
              5. lower-fma.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, ew, \frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)}, ew\right)\right| \]
              6. distribute-lft1-inN/A

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\left(\frac{-1}{2} + 1\right) \cdot \frac{{eh}^{2}}{ew}}\right), ew\right)\right| \]
              7. metadata-evalN/A

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{1}{2}} \cdot \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
              8. associate-*r/N/A

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{\frac{1}{2} \cdot {eh}^{2}}{ew}}\right), ew\right)\right| \]
              9. lower-/.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{\frac{1}{2} \cdot {eh}^{2}}{ew}}\right), ew\right)\right| \]
              10. lower-*.f64N/A

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \frac{\color{blue}{\frac{1}{2} \cdot {eh}^{2}}}{ew}\right), ew\right)\right| \]
              11. unpow2N/A

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \frac{\frac{1}{2} \cdot \color{blue}{\left(eh \cdot eh\right)}}{ew}\right), ew\right)\right| \]
              12. lower-*.f6431.2

                \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(-0.5, ew, \frac{0.5 \cdot \color{blue}{\left(eh \cdot eh\right)}}{ew}\right), ew\right)\right| \]
            7. Applied rewrites31.2%

              \[\leadsto \left|\color{blue}{\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(-0.5, ew, \frac{0.5 \cdot \left(eh \cdot eh\right)}{ew}\right), ew\right)}\right| \]
            8. Taylor expanded in eh around 0

              \[\leadsto \left|ew + \color{blue}{\frac{-1}{2} \cdot \left(ew \cdot {t}^{2}\right)}\right| \]
            9. Step-by-step derivation
              1. Applied rewrites35.9%

                \[\leadsto \left|\mathsf{fma}\left(-0.5, \color{blue}{ew \cdot \left(t \cdot t\right)}, ew\right)\right| \]
              2. Add Preprocessing

              Alternative 9: 4.9% accurate, 47.9× speedup?

              \[\begin{array}{l} \\ \left|-0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right| \end{array} \]
              (FPCore (eh ew t) :precision binary64 (fabs (* -0.5 (* ew (* t t)))))
              double code(double eh, double ew, double t) {
              	return fabs((-0.5 * (ew * (t * t))));
              }
              
              real(8) function code(eh, ew, t)
                  real(8), intent (in) :: eh
                  real(8), intent (in) :: ew
                  real(8), intent (in) :: t
                  code = abs(((-0.5d0) * (ew * (t * t))))
              end function
              
              public static double code(double eh, double ew, double t) {
              	return Math.abs((-0.5 * (ew * (t * t))));
              }
              
              def code(eh, ew, t):
              	return math.fabs((-0.5 * (ew * (t * t))))
              
              function code(eh, ew, t)
              	return abs(Float64(-0.5 * Float64(ew * Float64(t * t))))
              end
              
              function tmp = code(eh, ew, t)
              	tmp = abs((-0.5 * (ew * (t * t))));
              end
              
              code[eh_, ew_, t_] := N[Abs[N[(-0.5 * N[(ew * N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
              
              \begin{array}{l}
              
              \\
              \left|-0.5 \cdot \left(ew \cdot \left(t \cdot t\right)\right)\right|
              \end{array}
              
              Derivation
              1. Initial program 99.8%

                \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
              2. Add Preprocessing
              3. Step-by-step derivation
                1. lift--.f64N/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
                2. sub-negN/A

                  \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right)}\right| \]
                3. +-commutativeN/A

                  \[\leadsto \left|\color{blue}{\left(\mathsf{neg}\left(\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)\right) + \left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)}\right| \]
              4. Applied rewrites75.4%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(\left(-eh\right) \cdot \tan t, \frac{1}{ew \cdot \sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}} \cdot \left(eh \cdot \left(-\sin t\right)\right), \frac{ew \cdot \cos t}{\sqrt{1 + {\left(\left(-eh\right) \cdot \frac{\tan t}{ew}\right)}^{2}}}\right)}\right| \]
              5. Taylor expanded in t around 0

                \[\leadsto \left|\color{blue}{ew + {t}^{2} \cdot \left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)\right)}\right| \]
              6. Step-by-step derivation
                1. +-commutativeN/A

                  \[\leadsto \left|\color{blue}{{t}^{2} \cdot \left(\frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)\right) + ew}\right| \]
                2. lower-fma.f64N/A

                  \[\leadsto \left|\color{blue}{\mathsf{fma}\left({t}^{2}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)}\right| \]
                3. unpow2N/A

                  \[\leadsto \left|\mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
                4. lower-*.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(\color{blue}{t \cdot t}, \frac{-1}{2} \cdot ew + \left(\frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
                5. lower-fma.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \color{blue}{\mathsf{fma}\left(\frac{-1}{2}, ew, \frac{-1}{2} \cdot \frac{{eh}^{2}}{ew} + \frac{{eh}^{2}}{ew}\right)}, ew\right)\right| \]
                6. distribute-lft1-inN/A

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\left(\frac{-1}{2} + 1\right) \cdot \frac{{eh}^{2}}{ew}}\right), ew\right)\right| \]
                7. metadata-evalN/A

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{1}{2}} \cdot \frac{{eh}^{2}}{ew}\right), ew\right)\right| \]
                8. associate-*r/N/A

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{\frac{1}{2} \cdot {eh}^{2}}{ew}}\right), ew\right)\right| \]
                9. lower-/.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \color{blue}{\frac{\frac{1}{2} \cdot {eh}^{2}}{ew}}\right), ew\right)\right| \]
                10. lower-*.f64N/A

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \frac{\color{blue}{\frac{1}{2} \cdot {eh}^{2}}}{ew}\right), ew\right)\right| \]
                11. unpow2N/A

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(\frac{-1}{2}, ew, \frac{\frac{1}{2} \cdot \color{blue}{\left(eh \cdot eh\right)}}{ew}\right), ew\right)\right| \]
                12. lower-*.f6431.2

                  \[\leadsto \left|\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(-0.5, ew, \frac{0.5 \cdot \color{blue}{\left(eh \cdot eh\right)}}{ew}\right), ew\right)\right| \]
              7. Applied rewrites31.2%

                \[\leadsto \left|\color{blue}{\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(-0.5, ew, \frac{0.5 \cdot \left(eh \cdot eh\right)}{ew}\right), ew\right)}\right| \]
              8. Taylor expanded in eh around 0

                \[\leadsto \left|ew + \color{blue}{\frac{-1}{2} \cdot \left(ew \cdot {t}^{2}\right)}\right| \]
              9. Step-by-step derivation
                1. Applied rewrites35.9%

                  \[\leadsto \left|\mathsf{fma}\left(-0.5, \color{blue}{ew \cdot \left(t \cdot t\right)}, ew\right)\right| \]
                2. Taylor expanded in t around inf

                  \[\leadsto \left|\frac{-1}{2} \cdot \left(ew \cdot \color{blue}{{t}^{2}}\right)\right| \]
                3. Step-by-step derivation
                  1. Applied rewrites4.8%

                    \[\leadsto \left|-0.5 \cdot \left(ew \cdot \color{blue}{\left(t \cdot t\right)}\right)\right| \]
                  2. Add Preprocessing

                  Reproduce

                  ?
                  herbie shell --seed 2024221 
                  (FPCore (eh ew t)
                    :name "Example 2 from Robby"
                    :precision binary64
                    (fabs (- (* (* ew (cos t)) (cos (atan (/ (* (- eh) (tan t)) ew)))) (* (* eh (sin t)) (sin (atan (/ (* (- eh) (tan t)) ew)))))))