Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 20.4s
Alternatives: 11
Speedup: 1.0×

Specification

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

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Add Preprocessing
  3. Taylor expanded in ew around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 79.4% accurate, 0.4× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := ew \cdot \sin t\\ t_2 := eh \cdot \cos t\\ t_3 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\ t_4 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ t_5 := t\_2 \cdot \sin t\_4 + t\_1 \cdot \cos t\_4\\ \mathbf{if}\;t\_5 \leq -1 \cdot 10^{-20}:\\ \;\;\;\;\left|t\_2 \cdot t\_3\right|\\ \mathbf{elif}\;t\_5 \leq -4 \cdot 10^{-303}:\\ \;\;\;\;\left|\mathsf{fma}\left(eh, t\_3, ew \cdot t\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\mathsf{fma}\left(t\_2, t\_3, t\_1\right)\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (* ew (sin t)))
        (t_2 (* eh (cos t)))
        (t_3 (sin (atan (/ eh (* ew (tan t))))))
        (t_4 (atan (/ (/ eh ew) (tan t))))
        (t_5 (+ (* t_2 (sin t_4)) (* t_1 (cos t_4)))))
   (if (<= t_5 -1e-20)
     (fabs (* t_2 t_3))
     (if (<= t_5 -4e-303) (fabs (fma eh t_3 (* ew t))) (fma t_2 t_3 t_1)))))
double code(double eh, double ew, double t) {
	double t_1 = ew * sin(t);
	double t_2 = eh * cos(t);
	double t_3 = sin(atan((eh / (ew * tan(t)))));
	double t_4 = atan(((eh / ew) / tan(t)));
	double t_5 = (t_2 * sin(t_4)) + (t_1 * cos(t_4));
	double tmp;
	if (t_5 <= -1e-20) {
		tmp = fabs((t_2 * t_3));
	} else if (t_5 <= -4e-303) {
		tmp = fabs(fma(eh, t_3, (ew * t)));
	} else {
		tmp = fma(t_2, t_3, t_1);
	}
	return tmp;
}
function code(eh, ew, t)
	t_1 = Float64(ew * sin(t))
	t_2 = Float64(eh * cos(t))
	t_3 = sin(atan(Float64(eh / Float64(ew * tan(t)))))
	t_4 = atan(Float64(Float64(eh / ew) / tan(t)))
	t_5 = Float64(Float64(t_2 * sin(t_4)) + Float64(t_1 * cos(t_4)))
	tmp = 0.0
	if (t_5 <= -1e-20)
		tmp = abs(Float64(t_2 * t_3));
	elseif (t_5 <= -4e-303)
		tmp = abs(fma(eh, t_3, Float64(ew * t)));
	else
		tmp = fma(t_2, t_3, t_1);
	end
	return tmp
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$5 = N[(N[(t$95$2 * N[Sin[t$95$4], $MachinePrecision]), $MachinePrecision] + N[(t$95$1 * N[Cos[t$95$4], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$5, -1e-20], N[Abs[N[(t$95$2 * t$95$3), $MachinePrecision]], $MachinePrecision], If[LessEqual[t$95$5, -4e-303], N[Abs[N[(eh * t$95$3 + N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[(t$95$2 * t$95$3 + t$95$1), $MachinePrecision]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := ew \cdot \sin t\\
t_2 := eh \cdot \cos t\\
t_3 := \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\\
t_4 := \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\
t_5 := t\_2 \cdot \sin t\_4 + t\_1 \cdot \cos t\_4\\
\mathbf{if}\;t\_5 \leq -1 \cdot 10^{-20}:\\
\;\;\;\;\left|t\_2 \cdot t\_3\right|\\

\mathbf{elif}\;t\_5 \leq -4 \cdot 10^{-303}:\\
\;\;\;\;\left|\mathsf{fma}\left(eh, t\_3, ew \cdot t\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t\_2, t\_3, t\_1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -9.99999999999999945e-21

    1. Initial program 99.7%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. Taylor expanded in ew around 0

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

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

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

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

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

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

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

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

        \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
      9. lower-tan.f6460.9

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

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

    if -9.99999999999999945e-21 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t)))))) < -3.99999999999999972e-303

    1. Initial program 99.9%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

      if -3.99999999999999972e-303 < (+.f64 (*.f64 (*.f64 ew (sin.f64 t)) (cos.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))) (*.f64 (*.f64 eh (cos.f64 t)) (sin.f64 (atan.f64 (/.f64 (/.f64 eh ew) (tan.f64 t))))))

      1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \color{blue}{\mathsf{fma}\left(eh \cdot \cos t, \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right), ew \cdot \sin t\right)} \]
    10. Recombined 3 regimes into one program.
    11. Final simplification79.6%

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

    Alternative 3: 99.1% accurate, 1.1× speedup?

    \[\begin{array}{l} \\ \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (fabs
      (+
       (* (* ew (sin t)) (cos (atan (/ eh (* ew t)))))
       (* (* eh (cos t)) (sin (atan (/ (/ eh ew) (tan t))))))))
    double code(double eh, double ew, double t) {
    	return fabs((((ew * sin(t)) * cos(atan((eh / (ew * t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(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((((ew * sin(t)) * cos(atan((eh / (ew * t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))))
    end function
    
    public static double code(double eh, double ew, double t) {
    	return Math.abs((((ew * Math.sin(t)) * Math.cos(Math.atan((eh / (ew * t))))) + ((eh * Math.cos(t)) * Math.sin(Math.atan(((eh / ew) / Math.tan(t)))))));
    }
    
    def code(eh, ew, t):
    	return math.fabs((((ew * math.sin(t)) * math.cos(math.atan((eh / (ew * t))))) + ((eh * math.cos(t)) * math.sin(math.atan(((eh / ew) / math.tan(t)))))))
    
    function code(eh, ew, t)
    	return abs(Float64(Float64(Float64(ew * sin(t)) * cos(atan(Float64(eh / Float64(ew * t))))) + Float64(Float64(eh * cos(t)) * sin(atan(Float64(Float64(eh / ew) / tan(t)))))))
    end
    
    function tmp = code(eh, ew, t)
    	tmp = abs((((ew * sin(t)) * cos(atan((eh / (ew * t))))) + ((eh * cos(t)) * sin(atan(((eh / ew) / tan(t)))))));
    end
    
    code[eh_, ew_, t_] := N[Abs[N[(N[(N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[Cos[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision] * N[Sin[N[ArcTan[N[(N[(eh / ew), $MachinePrecision] / N[Tan[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
    
    \begin{array}{l}
    
    \\
    \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|
    \end{array}
    
    Derivation
    1. Initial program 99.8%

      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    2. Add Preprocessing
    3. Taylor expanded in t around 0

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

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

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

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

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

      \[\leadsto \left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
    7. Add Preprocessing

    Alternative 4: 98.6% accurate, 1.6× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 5: 74.7% accurate, 2.0× speedup?

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

      1. Initial program 99.7%

        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
      2. Add Preprocessing
      3. Taylor expanded in ew around 0

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

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

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

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

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

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

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

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

          \[\leadsto \left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
        9. lower-tan.f6456.7

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

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

      if -0.00265000000000000001 < t < 8.1999999999999998e-4

      1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        if 8.1999999999999998e-4 < t

        1. Initial program 99.6%

          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        2. Add Preprocessing
        3. Applied rewrites38.0%

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          2. lower-sin.f6452.9

            \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
        6. Applied rewrites52.9%

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

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

      Alternative 6: 75.0% accurate, 2.5× speedup?

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

        1. Initial program 99.6%

          \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
        2. Add Preprocessing
        3. Applied rewrites37.6%

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

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

            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
          2. lower-sin.f6450.7

            \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
        6. Applied rewrites50.7%

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

        if -0.71999999999999997 < t < 8.1999999999999998e-4

        1. Initial program 100.0%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\mathsf{fma}\left(eh, \color{blue}{\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}, t \cdot ew\right)\right| \]
        10. Recombined 2 regimes into one program.
        11. Final simplification75.9%

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

        Alternative 7: 58.5% accurate, 7.2× speedup?

        \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|ew \cdot \sin t\right|\\ \mathbf{if}\;ew \leq -5.1 \cdot 10^{-23}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;ew \leq 5.5 \cdot 10^{-67}:\\ \;\;\;\;\left|-eh\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
        (FPCore (eh ew t)
         :precision binary64
         (let* ((t_1 (fabs (* ew (sin t)))))
           (if (<= ew -5.1e-23) t_1 (if (<= ew 5.5e-67) (fabs (- eh)) t_1))))
        double code(double eh, double ew, double t) {
        	double t_1 = fabs((ew * sin(t)));
        	double tmp;
        	if (ew <= -5.1e-23) {
        		tmp = t_1;
        	} else if (ew <= 5.5e-67) {
        		tmp = fabs(-eh);
        	} 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 * sin(t)))
            if (ew <= (-5.1d-23)) then
                tmp = t_1
            else if (ew <= 5.5d-67) then
                tmp = abs(-eh)
            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.sin(t)));
        	double tmp;
        	if (ew <= -5.1e-23) {
        		tmp = t_1;
        	} else if (ew <= 5.5e-67) {
        		tmp = Math.abs(-eh);
        	} else {
        		tmp = t_1;
        	}
        	return tmp;
        }
        
        def code(eh, ew, t):
        	t_1 = math.fabs((ew * math.sin(t)))
        	tmp = 0
        	if ew <= -5.1e-23:
        		tmp = t_1
        	elif ew <= 5.5e-67:
        		tmp = math.fabs(-eh)
        	else:
        		tmp = t_1
        	return tmp
        
        function code(eh, ew, t)
        	t_1 = abs(Float64(ew * sin(t)))
        	tmp = 0.0
        	if (ew <= -5.1e-23)
        		tmp = t_1;
        	elseif (ew <= 5.5e-67)
        		tmp = abs(Float64(-eh));
        	else
        		tmp = t_1;
        	end
        	return tmp
        end
        
        function tmp_2 = code(eh, ew, t)
        	t_1 = abs((ew * sin(t)));
        	tmp = 0.0;
        	if (ew <= -5.1e-23)
        		tmp = t_1;
        	elseif (ew <= 5.5e-67)
        		tmp = abs(-eh);
        	else
        		tmp = t_1;
        	end
        	tmp_2 = tmp;
        end
        
        code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[ew, -5.1e-23], t$95$1, If[LessEqual[ew, 5.5e-67], N[Abs[(-eh)], $MachinePrecision], t$95$1]]]
        
        \begin{array}{l}
        
        \\
        \begin{array}{l}
        t_1 := \left|ew \cdot \sin t\right|\\
        \mathbf{if}\;ew \leq -5.1 \cdot 10^{-23}:\\
        \;\;\;\;t\_1\\
        
        \mathbf{elif}\;ew \leq 5.5 \cdot 10^{-67}:\\
        \;\;\;\;\left|-eh\right|\\
        
        \mathbf{else}:\\
        \;\;\;\;t\_1\\
        
        
        \end{array}
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if ew < -5.10000000000000011e-23 or 5.5000000000000003e-67 < ew

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          2. Add Preprocessing
          3. Applied rewrites51.8%

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

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

              \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
            2. lower-sin.f6464.1

              \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
          6. Applied rewrites64.1%

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

          if -5.10000000000000011e-23 < ew < 5.5000000000000003e-67

          1. Initial program 99.8%

            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
          2. Add Preprocessing
          3. Taylor expanded in t around 0

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

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

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

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

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

              \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
            6. lower-tan.f6461.6

              \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \color{blue}{\tan t}}\right)\right| \]
          5. Applied rewrites61.6%

            \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}\right| \]
          6. Step-by-step derivation
            1. Applied rewrites3.9%

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

              \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
            3. Step-by-step derivation
              1. Applied rewrites61.6%

                \[\leadsto \left|-eh\right| \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 8: 43.5% accurate, 7.4× speedup?

            \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -6.1 \cdot 10^{-23}:\\ \;\;\;\;\left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right|\\ \mathbf{elif}\;ew \leq 1.4 \cdot 10^{+197}:\\ \;\;\;\;\left|-eh\right|\\ \mathbf{else}:\\ \;\;\;\;ew \cdot \sin t\\ \end{array} \end{array} \]
            (FPCore (eh ew t)
             :precision binary64
             (if (<= ew -6.1e-23)
               (fabs
                (*
                 ew
                 (*
                  t
                  (fma
                   (* t t)
                   (fma
                    (* t t)
                    (fma (* t t) -0.0001984126984126984 0.008333333333333333)
                    -0.16666666666666666)
                   1.0))))
               (if (<= ew 1.4e+197) (fabs (- eh)) (* ew (sin t)))))
            double code(double eh, double ew, double t) {
            	double tmp;
            	if (ew <= -6.1e-23) {
            		tmp = fabs((ew * (t * fma((t * t), fma((t * t), fma((t * t), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0))));
            	} else if (ew <= 1.4e+197) {
            		tmp = fabs(-eh);
            	} else {
            		tmp = ew * sin(t);
            	}
            	return tmp;
            }
            
            function code(eh, ew, t)
            	tmp = 0.0
            	if (ew <= -6.1e-23)
            		tmp = abs(Float64(ew * Float64(t * fma(Float64(t * t), fma(Float64(t * t), fma(Float64(t * t), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0))));
            	elseif (ew <= 1.4e+197)
            		tmp = abs(Float64(-eh));
            	else
            		tmp = Float64(ew * sin(t));
            	end
            	return tmp
            end
            
            code[eh_, ew_, t_] := If[LessEqual[ew, -6.1e-23], N[Abs[N[(ew * N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.4e+197], N[Abs[(-eh)], $MachinePrecision], N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]]]
            
            \begin{array}{l}
            
            \\
            \begin{array}{l}
            \mathbf{if}\;ew \leq -6.1 \cdot 10^{-23}:\\
            \;\;\;\;\left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right|\\
            
            \mathbf{elif}\;ew \leq 1.4 \cdot 10^{+197}:\\
            \;\;\;\;\left|-eh\right|\\
            
            \mathbf{else}:\\
            \;\;\;\;ew \cdot \sin t\\
            
            
            \end{array}
            \end{array}
            
            Derivation
            1. Split input into 3 regimes
            2. if ew < -6.1000000000000005e-23

              1. Initial program 99.7%

                \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
              2. Add Preprocessing
              3. Applied rewrites56.0%

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

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

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

                  \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
              6. Applied rewrites75.3%

                \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
              7. Taylor expanded in t around 0

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

                  \[\leadsto \left|ew \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)}\right)\right| \]

                if -6.1000000000000005e-23 < ew < 1.3999999999999999e197

                1. Initial program 99.8%

                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                2. Add Preprocessing
                3. Taylor expanded in t around 0

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

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

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

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

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

                    \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
                  6. lower-tan.f6453.1

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

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

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

                    \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
                  3. Step-by-step derivation
                    1. Applied rewrites53.3%

                      \[\leadsto \left|-eh\right| \]

                    if 1.3999999999999999e197 < ew

                    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                    7. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \color{blue}{ew \cdot \sin t} \]
                      2. lower-sin.f6457.1

                        \[\leadsto ew \cdot \color{blue}{\sin t} \]
                    8. Applied rewrites57.1%

                      \[\leadsto \color{blue}{ew \cdot \sin t} \]
                  4. Recombined 3 regimes into one program.
                  5. Add Preprocessing

                  Alternative 9: 43.6% accurate, 16.7× speedup?

                  \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -6.1 \cdot 10^{-23}:\\ \;\;\;\;\left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right|\\ \mathbf{elif}\;ew \leq 1.4 \cdot 10^{+197}:\\ \;\;\;\;\left|-eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \end{array} \end{array} \]
                  (FPCore (eh ew t)
                   :precision binary64
                   (if (<= ew -6.1e-23)
                     (fabs
                      (*
                       ew
                       (*
                        t
                        (fma
                         (* t t)
                         (fma
                          (* t t)
                          (fma (* t t) -0.0001984126984126984 0.008333333333333333)
                          -0.16666666666666666)
                         1.0))))
                     (if (<= ew 1.4e+197) (fabs (- eh)) (fabs (* ew t)))))
                  double code(double eh, double ew, double t) {
                  	double tmp;
                  	if (ew <= -6.1e-23) {
                  		tmp = fabs((ew * (t * fma((t * t), fma((t * t), fma((t * t), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0))));
                  	} else if (ew <= 1.4e+197) {
                  		tmp = fabs(-eh);
                  	} else {
                  		tmp = fabs((ew * t));
                  	}
                  	return tmp;
                  }
                  
                  function code(eh, ew, t)
                  	tmp = 0.0
                  	if (ew <= -6.1e-23)
                  		tmp = abs(Float64(ew * Float64(t * fma(Float64(t * t), fma(Float64(t * t), fma(Float64(t * t), -0.0001984126984126984, 0.008333333333333333), -0.16666666666666666), 1.0))));
                  	elseif (ew <= 1.4e+197)
                  		tmp = abs(Float64(-eh));
                  	else
                  		tmp = abs(Float64(ew * t));
                  	end
                  	return tmp
                  end
                  
                  code[eh_, ew_, t_] := If[LessEqual[ew, -6.1e-23], N[Abs[N[(ew * N[(t * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * N[(N[(t * t), $MachinePrecision] * -0.0001984126984126984 + 0.008333333333333333), $MachinePrecision] + -0.16666666666666666), $MachinePrecision] + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], If[LessEqual[ew, 1.4e+197], N[Abs[(-eh)], $MachinePrecision], N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision]]]
                  
                  \begin{array}{l}
                  
                  \\
                  \begin{array}{l}
                  \mathbf{if}\;ew \leq -6.1 \cdot 10^{-23}:\\
                  \;\;\;\;\left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right|\\
                  
                  \mathbf{elif}\;ew \leq 1.4 \cdot 10^{+197}:\\
                  \;\;\;\;\left|-eh\right|\\
                  
                  \mathbf{else}:\\
                  \;\;\;\;\left|ew \cdot t\right|\\
                  
                  
                  \end{array}
                  \end{array}
                  
                  Derivation
                  1. Split input into 3 regimes
                  2. if ew < -6.1000000000000005e-23

                    1. Initial program 99.7%

                      \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                    2. Add Preprocessing
                    3. Applied rewrites56.0%

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

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

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

                        \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                    6. Applied rewrites75.3%

                      \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                    7. Taylor expanded in t around 0

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

                        \[\leadsto \left|ew \cdot \left(t \cdot \color{blue}{\mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)}\right)\right| \]

                      if -6.1000000000000005e-23 < ew < 1.3999999999999999e197

                      1. Initial program 99.8%

                        \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                      2. Add Preprocessing
                      3. Taylor expanded in t around 0

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

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

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

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

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

                          \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
                        6. lower-tan.f6453.1

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

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

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

                          \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
                        3. Step-by-step derivation
                          1. Applied rewrites53.3%

                            \[\leadsto \left|-eh\right| \]

                          if 1.3999999999999999e197 < ew

                          1. Initial program 99.8%

                            \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                          2. Add Preprocessing
                          3. Applied rewrites35.8%

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

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

                              \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                            2. lower-sin.f6473.9

                              \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                          6. Applied rewrites73.9%

                            \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                          7. Taylor expanded in t around 0

                            \[\leadsto \left|ew \cdot \color{blue}{t}\right| \]
                          8. Step-by-step derivation
                            1. Applied rewrites48.4%

                              \[\leadsto \left|t \cdot \color{blue}{ew}\right| \]
                          9. Recombined 3 regimes into one program.
                          10. Final simplification49.8%

                            \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -6.1 \cdot 10^{-23}:\\ \;\;\;\;\left|ew \cdot \left(t \cdot \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, \mathsf{fma}\left(t \cdot t, -0.0001984126984126984, 0.008333333333333333\right), -0.16666666666666666\right), 1\right)\right)\right|\\ \mathbf{elif}\;ew \leq 1.4 \cdot 10^{+197}:\\ \;\;\;\;\left|-eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \end{array} \]
                          11. Add Preprocessing

                          Alternative 10: 44.3% accurate, 43.4× speedup?

                          \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|-eh\right|\\ \mathbf{if}\;eh \leq -1.4 \cdot 10^{-192}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 6.2 \cdot 10^{-95}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
                          (FPCore (eh ew t)
                           :precision binary64
                           (let* ((t_1 (fabs (- eh))))
                             (if (<= eh -1.4e-192) t_1 (if (<= eh 6.2e-95) (fabs (* ew t)) t_1))))
                          double code(double eh, double ew, double t) {
                          	double t_1 = fabs(-eh);
                          	double tmp;
                          	if (eh <= -1.4e-192) {
                          		tmp = t_1;
                          	} else if (eh <= 6.2e-95) {
                          		tmp = fabs((ew * 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(-eh)
                              if (eh <= (-1.4d-192)) then
                                  tmp = t_1
                              else if (eh <= 6.2d-95) then
                                  tmp = abs((ew * 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(-eh);
                          	double tmp;
                          	if (eh <= -1.4e-192) {
                          		tmp = t_1;
                          	} else if (eh <= 6.2e-95) {
                          		tmp = Math.abs((ew * t));
                          	} else {
                          		tmp = t_1;
                          	}
                          	return tmp;
                          }
                          
                          def code(eh, ew, t):
                          	t_1 = math.fabs(-eh)
                          	tmp = 0
                          	if eh <= -1.4e-192:
                          		tmp = t_1
                          	elif eh <= 6.2e-95:
                          		tmp = math.fabs((ew * t))
                          	else:
                          		tmp = t_1
                          	return tmp
                          
                          function code(eh, ew, t)
                          	t_1 = abs(Float64(-eh))
                          	tmp = 0.0
                          	if (eh <= -1.4e-192)
                          		tmp = t_1;
                          	elseif (eh <= 6.2e-95)
                          		tmp = abs(Float64(ew * t));
                          	else
                          		tmp = t_1;
                          	end
                          	return tmp
                          end
                          
                          function tmp_2 = code(eh, ew, t)
                          	t_1 = abs(-eh);
                          	tmp = 0.0;
                          	if (eh <= -1.4e-192)
                          		tmp = t_1;
                          	elseif (eh <= 6.2e-95)
                          		tmp = abs((ew * t));
                          	else
                          		tmp = t_1;
                          	end
                          	tmp_2 = tmp;
                          end
                          
                          code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[(-eh)], $MachinePrecision]}, If[LessEqual[eh, -1.4e-192], t$95$1, If[LessEqual[eh, 6.2e-95], N[Abs[N[(ew * t), $MachinePrecision]], $MachinePrecision], t$95$1]]]
                          
                          \begin{array}{l}
                          
                          \\
                          \begin{array}{l}
                          t_1 := \left|-eh\right|\\
                          \mathbf{if}\;eh \leq -1.4 \cdot 10^{-192}:\\
                          \;\;\;\;t\_1\\
                          
                          \mathbf{elif}\;eh \leq 6.2 \cdot 10^{-95}:\\
                          \;\;\;\;\left|ew \cdot t\right|\\
                          
                          \mathbf{else}:\\
                          \;\;\;\;t\_1\\
                          
                          
                          \end{array}
                          \end{array}
                          
                          Derivation
                          1. Split input into 2 regimes
                          2. if eh < -1.40000000000000002e-192 or 6.19999999999999983e-95 < eh

                            1. Initial program 99.8%

                              \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                            2. Add Preprocessing
                            3. Taylor expanded in t around 0

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

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

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

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

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

                                \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
                              6. lower-tan.f6451.5

                                \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \color{blue}{\tan t}}\right)\right| \]
                            5. Applied rewrites51.5%

                              \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}\right| \]
                            6. Step-by-step derivation
                              1. Applied rewrites11.9%

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

                                \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
                              3. Step-by-step derivation
                                1. Applied rewrites52.0%

                                  \[\leadsto \left|-eh\right| \]

                                if -1.40000000000000002e-192 < eh < 6.19999999999999983e-95

                                1. Initial program 99.9%

                                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                2. Add Preprocessing
                                3. Applied rewrites52.0%

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

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

                                    \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                  2. lower-sin.f6474.6

                                    \[\leadsto \left|ew \cdot \color{blue}{\sin t}\right| \]
                                6. Applied rewrites74.6%

                                  \[\leadsto \left|\color{blue}{ew \cdot \sin t}\right| \]
                                7. Taylor expanded in t around 0

                                  \[\leadsto \left|ew \cdot \color{blue}{t}\right| \]
                                8. Step-by-step derivation
                                  1. Applied rewrites43.4%

                                    \[\leadsto \left|t \cdot \color{blue}{ew}\right| \]
                                9. Recombined 2 regimes into one program.
                                10. Final simplification49.8%

                                  \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.4 \cdot 10^{-192}:\\ \;\;\;\;\left|-eh\right|\\ \mathbf{elif}\;eh \leq 6.2 \cdot 10^{-95}:\\ \;\;\;\;\left|ew \cdot t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|-eh\right|\\ \end{array} \]
                                11. Add Preprocessing

                                Alternative 11: 41.9% accurate, 174.0× speedup?

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

                                  \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
                                2. Add Preprocessing
                                3. Taylor expanded in t around 0

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

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

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

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

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

                                    \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{\color{blue}{ew \cdot \tan t}}\right)\right| \]
                                  6. lower-tan.f6443.9

                                    \[\leadsto \left|eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \color{blue}{\tan t}}\right)\right| \]
                                5. Applied rewrites43.9%

                                  \[\leadsto \left|\color{blue}{eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)}\right| \]
                                6. Step-by-step derivation
                                  1. Applied rewrites10.3%

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

                                    \[\leadsto \left|-1 \cdot \color{blue}{eh}\right| \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites44.4%

                                      \[\leadsto \left|-eh\right| \]
                                    2. Add Preprocessing

                                    Reproduce

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