Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 15.3s
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}{\tan t \cdot ew}\right)\\ \left|\mathsf{fma}\left(\sin t\_1 \cdot \cos t, eh, \left(\cos t\_1 \cdot ew\right) \cdot \sin t\right)\right| \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (atan (/ eh (* (tan t) ew)))))
   (fabs (fma (* (sin t_1) (cos t)) eh (* (* (cos t_1) ew) (sin t))))))
double code(double eh, double ew, double t) {
	double t_1 = atan((eh / (tan(t) * ew)));
	return fabs(fma((sin(t_1) * cos(t)), eh, ((cos(t_1) * ew) * sin(t))));
}
function code(eh, ew, t)
	t_1 = atan(Float64(eh / Float64(tan(t) * ew)))
	return abs(fma(Float64(sin(t_1) * cos(t)), eh, Float64(Float64(cos(t_1) * ew) * sin(t))))
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[ArcTan[N[(eh / N[(N[Tan[t], $MachinePrecision] * ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Abs[N[(N[(N[Sin[t$95$1], $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision] * eh + N[(N[(N[Cos[t$95$1], $MachinePrecision] * ew), $MachinePrecision] * N[Sin[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right)\\
\left|\mathsf{fma}\left(\sin t\_1 \cdot \cos t, eh, \left(\cos t\_1 \cdot ew\right) \cdot \sin t\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. Step-by-step derivation
    1. lift-/.f64N/A

      \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

      \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
    3. associate-/l/N/A

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    4. lower-/.f64N/A

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    5. lower-*.f6499.8

      \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
  5. Applied rewrites99.8%

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

Alternative 2: 99.8% accurate, 1.1× speedup?

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

\\
\left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot \cos t, eh, \frac{\sin t \cdot ew}{\sqrt{{\left(\frac{eh}{ew \cdot \tan t}\right)}^{2} + 1}}\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|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

      \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
    3. associate-/l/N/A

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    4. lower-/.f64N/A

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    5. lower-*.f6499.8

      \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
  5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 3: 99.1% accurate, 1.1× speedup?

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

\\
\left|\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{eh}{t \cdot ew}\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-*.f6499.3

      \[\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 rewrites99.3%

    \[\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 simplification99.3%

    \[\leadsto \left|\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{eh}{t \cdot ew}\right)\right| \]
  7. Add Preprocessing

Alternative 4: 99.1% accurate, 1.3× speedup?

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

\\
\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{\sin t \cdot ew}{\sqrt{{\left(\frac{\frac{eh}{ew}}{t}\right)}^{2} + 1}}\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-*.f6499.3

      \[\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 rewrites99.3%

    \[\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. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \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| \]
    2. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\left(ew \cdot \sin t\right)} \cdot \cos \tan^{-1} \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| \]
    3. *-commutativeN/A

      \[\leadsto \left|\color{blue}{\left(\sin t \cdot ew\right)} \cdot \cos \tan^{-1} \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| \]
    4. lift-*.f64N/A

      \[\leadsto \left|\color{blue}{\left(\sin t \cdot ew\right)} \cdot \cos \tan^{-1} \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| \]
    5. lift-cos.f64N/A

      \[\leadsto \left|\left(\sin t \cdot ew\right) \cdot \color{blue}{\cos \tan^{-1} \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. lift-atan.f64N/A

      \[\leadsto \left|\left(\sin t \cdot ew\right) \cdot \cos \color{blue}{\tan^{-1} \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| \]
    7. cos-atanN/A

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

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

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

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

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

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

Alternative 5: 98.4% accurate, 1.6× speedup?

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

\\
\left|\mathsf{fma}\left(\sin \tan^{-1} \left(\frac{eh}{\tan t \cdot ew}\right) \cdot \cos t, eh, \frac{\sin t \cdot ew}{1}\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|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
    2. lift-/.f64N/A

      \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
    3. associate-/l/N/A

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    4. lower-/.f64N/A

      \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
    5. lower-*.f6499.8

      \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
  4. Applied rewrites99.8%

    \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
  5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

    Alternative 6: 72.3% accurate, 1.9× speedup?

    \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{+211} \lor \neg \left(ew \leq 5.4 \cdot 10^{+23}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(0.16666666666666666, \left(t \cdot eh\right) \cdot t, eh\right)}{t} \cdot \frac{\cos t}{ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \end{array} \end{array} \]
    (FPCore (eh ew t)
     :precision binary64
     (if (or (<= ew -2.2e+211) (not (<= ew 5.4e+23)))
       (fabs (* (sin t) ew))
       (fabs
        (*
         (sin
          (atan
           (* (/ (fma 0.16666666666666666 (* (* t eh) t) eh) t) (/ (cos t) ew))))
         (* (cos t) eh)))))
    double code(double eh, double ew, double t) {
    	double tmp;
    	if ((ew <= -2.2e+211) || !(ew <= 5.4e+23)) {
    		tmp = fabs((sin(t) * ew));
    	} else {
    		tmp = fabs((sin(atan(((fma(0.16666666666666666, ((t * eh) * t), eh) / t) * (cos(t) / ew)))) * (cos(t) * eh)));
    	}
    	return tmp;
    }
    
    function code(eh, ew, t)
    	tmp = 0.0
    	if ((ew <= -2.2e+211) || !(ew <= 5.4e+23))
    		tmp = abs(Float64(sin(t) * ew));
    	else
    		tmp = abs(Float64(sin(atan(Float64(Float64(fma(0.16666666666666666, Float64(Float64(t * eh) * t), eh) / t) * Float64(cos(t) / ew)))) * Float64(cos(t) * eh)));
    	end
    	return tmp
    end
    
    code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.2e+211], N[Not[LessEqual[ew, 5.4e+23]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(N[(N[(0.16666666666666666 * N[(N[(t * eh), $MachinePrecision] * t), $MachinePrecision] + eh), $MachinePrecision] / t), $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] / ew), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(N[Cos[t], $MachinePrecision] * eh), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
    
    \begin{array}{l}
    
    \\
    \begin{array}{l}
    \mathbf{if}\;ew \leq -2.2 \cdot 10^{+211} \lor \neg \left(ew \leq 5.4 \cdot 10^{+23}\right):\\
    \;\;\;\;\left|\sin t \cdot ew\right|\\
    
    \mathbf{else}:\\
    \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(0.16666666666666666, \left(t \cdot eh\right) \cdot t, eh\right)}{t} \cdot \frac{\cos t}{ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if ew < -2.20000000000000004e211 or 5.3999999999999997e23 < 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|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
        2. lift-/.f64N/A

          \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
        3. associate-/l/N/A

          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
        4. lower-/.f64N/A

          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
        5. lower-*.f6499.8

          \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
      4. Applied rewrites99.8%

        \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
      5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
        2. lower-*.f64N/A

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

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

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

      if -2.20000000000000004e211 < ew < 5.3999999999999997e23

      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|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
        2. lift-/.f64N/A

          \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
        3. associate-/l/N/A

          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
        4. lower-/.f64N/A

          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
        5. lower-*.f6499.8

          \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
      4. Applied rewrites99.8%

        \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
      5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \left|\sin \tan^{-1} \left(\frac{eh + \frac{1}{6} \cdot \left(eh \cdot {t}^{2}\right)}{t} \cdot \frac{\cos t}{ew}\right) \cdot \left(\cos t \cdot eh\right)\right| \]
      10. Step-by-step derivation
        1. Applied rewrites75.2%

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

        \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{+211} \lor \neg \left(ew \leq 5.4 \cdot 10^{+23}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{\mathsf{fma}\left(0.16666666666666666, \left(t \cdot eh\right) \cdot t, eh\right)}{t} \cdot \frac{\cos t}{ew}\right) \cdot \left(\cos t \cdot eh\right)\right|\\ \end{array} \]
      13. Add Preprocessing

      Alternative 7: 72.2% accurate, 2.0× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{+211} \lor \neg \left(ew \leq 5.4 \cdot 10^{+23}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot eh\right) \cdot \cos t\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (or (<= ew -2.2e+211) (not (<= ew 5.4e+23)))
         (fabs (* (sin t) ew))
         (fabs (* (* (sin (atan (/ eh (* ew (tan t))))) eh) (cos t)))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if ((ew <= -2.2e+211) || !(ew <= 5.4e+23)) {
      		tmp = fabs((sin(t) * ew));
      	} else {
      		tmp = fabs(((sin(atan((eh / (ew * tan(t))))) * eh) * cos(t)));
      	}
      	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) :: tmp
          if ((ew <= (-2.2d+211)) .or. (.not. (ew <= 5.4d+23))) then
              tmp = abs((sin(t) * ew))
          else
              tmp = abs(((sin(atan((eh / (ew * tan(t))))) * eh) * cos(t)))
          end if
          code = tmp
      end function
      
      public static double code(double eh, double ew, double t) {
      	double tmp;
      	if ((ew <= -2.2e+211) || !(ew <= 5.4e+23)) {
      		tmp = Math.abs((Math.sin(t) * ew));
      	} else {
      		tmp = Math.abs(((Math.sin(Math.atan((eh / (ew * Math.tan(t))))) * eh) * Math.cos(t)));
      	}
      	return tmp;
      }
      
      def code(eh, ew, t):
      	tmp = 0
      	if (ew <= -2.2e+211) or not (ew <= 5.4e+23):
      		tmp = math.fabs((math.sin(t) * ew))
      	else:
      		tmp = math.fabs(((math.sin(math.atan((eh / (ew * math.tan(t))))) * eh) * math.cos(t)))
      	return tmp
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if ((ew <= -2.2e+211) || !(ew <= 5.4e+23))
      		tmp = abs(Float64(sin(t) * ew));
      	else
      		tmp = abs(Float64(Float64(sin(atan(Float64(eh / Float64(ew * tan(t))))) * eh) * cos(t)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(eh, ew, t)
      	tmp = 0.0;
      	if ((ew <= -2.2e+211) || ~((ew <= 5.4e+23)))
      		tmp = abs((sin(t) * ew));
      	else
      		tmp = abs(((sin(atan((eh / (ew * tan(t))))) * eh) * cos(t)));
      	end
      	tmp_2 = tmp;
      end
      
      code[eh_, ew_, t_] := If[Or[LessEqual[ew, -2.2e+211], N[Not[LessEqual[ew, 5.4e+23]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[(N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision] * N[Cos[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;ew \leq -2.2 \cdot 10^{+211} \lor \neg \left(ew \leq 5.4 \cdot 10^{+23}\right):\\
      \;\;\;\;\left|\sin t \cdot ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot eh\right) \cdot \cos t\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if ew < -2.20000000000000004e211 or 5.3999999999999997e23 < 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|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
          2. lift-/.f64N/A

            \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
          3. associate-/l/N/A

            \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
          4. lower-/.f64N/A

            \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
          5. lower-*.f6499.8

            \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
        4. Applied rewrites99.8%

          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
        5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
          2. lower-*.f64N/A

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

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

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

        if -2.20000000000000004e211 < ew < 5.3999999999999997e23

        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|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
          2. lift-/.f64N/A

            \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
          3. associate-/l/N/A

            \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
          4. lower-/.f64N/A

            \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
          5. lower-*.f6499.8

            \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
        4. Applied rewrites99.8%

          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
        5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

          \[\leadsto \left|\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot eh\right) \cdot \color{blue}{\cos t}\right| \]
      3. Recombined 2 regimes into one program.
      4. Final simplification75.2%

        \[\leadsto \begin{array}{l} \mathbf{if}\;ew \leq -2.2 \cdot 10^{+211} \lor \neg \left(ew \leq 5.4 \cdot 10^{+23}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\left(\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot eh\right) \cdot \cos t\right|\\ \end{array} \]
      5. Add Preprocessing

      Alternative 8: 58.8% accurate, 3.5× speedup?

      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.75 \cdot 10^{-131} \lor \neg \left(t \leq 1.25 \cdot 10^{-64}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{\mathsf{fma}\left(\left(ew \cdot t\right) \cdot t, 0.3333333333333333, ew\right) \cdot t}\right) \cdot eh\right|\\ \end{array} \end{array} \]
      (FPCore (eh ew t)
       :precision binary64
       (if (or (<= t -1.75e-131) (not (<= t 1.25e-64)))
         (fabs (* (sin t) ew))
         (fabs
          (*
           (sin (atan (/ eh (* (fma (* (* ew t) t) 0.3333333333333333 ew) t))))
           eh))))
      double code(double eh, double ew, double t) {
      	double tmp;
      	if ((t <= -1.75e-131) || !(t <= 1.25e-64)) {
      		tmp = fabs((sin(t) * ew));
      	} else {
      		tmp = fabs((sin(atan((eh / (fma(((ew * t) * t), 0.3333333333333333, ew) * t)))) * eh));
      	}
      	return tmp;
      }
      
      function code(eh, ew, t)
      	tmp = 0.0
      	if ((t <= -1.75e-131) || !(t <= 1.25e-64))
      		tmp = abs(Float64(sin(t) * ew));
      	else
      		tmp = abs(Float64(sin(atan(Float64(eh / Float64(fma(Float64(Float64(ew * t) * t), 0.3333333333333333, ew) * t)))) * eh));
      	end
      	return tmp
      end
      
      code[eh_, ew_, t_] := If[Or[LessEqual[t, -1.75e-131], N[Not[LessEqual[t, 1.25e-64]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(eh / N[(N[(N[(N[(ew * t), $MachinePrecision] * t), $MachinePrecision] * 0.3333333333333333 + ew), $MachinePrecision] * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]
      
      \begin{array}{l}
      
      \\
      \begin{array}{l}
      \mathbf{if}\;t \leq -1.75 \cdot 10^{-131} \lor \neg \left(t \leq 1.25 \cdot 10^{-64}\right):\\
      \;\;\;\;\left|\sin t \cdot ew\right|\\
      
      \mathbf{else}:\\
      \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{\mathsf{fma}\left(\left(ew \cdot t\right) \cdot t, 0.3333333333333333, ew\right) \cdot t}\right) \cdot eh\right|\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 2 regimes
      2. if t < -1.7500000000000001e-131 or 1.25000000000000008e-64 < t

        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. Step-by-step derivation
          1. lift-/.f64N/A

            \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
          2. lift-/.f64N/A

            \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
          3. associate-/l/N/A

            \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
          4. lower-/.f64N/A

            \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
          5. lower-*.f6499.7

            \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
        4. Applied rewrites99.7%

          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
        5. Applied rewrites99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
          2. lower-*.f64N/A

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

            \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
        10. Applied rewrites59.4%

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

        if -1.7500000000000001e-131 < t < 1.25000000000000008e-64

        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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            \[\leadsto \left|\sin \tan^{-1} \left(\frac{eh}{t \cdot \left(ew + \frac{1}{3} \cdot \left(ew \cdot {t}^{2}\right)\right)}\right) \cdot eh\right| \]
          3. Step-by-step derivation
            1. Applied rewrites80.0%

              \[\leadsto \left|\sin \tan^{-1} \left(\frac{eh}{\mathsf{fma}\left(\left(ew \cdot t\right) \cdot t, 0.3333333333333333, ew\right) \cdot t}\right) \cdot eh\right| \]
          4. Recombined 2 regimes into one program.
          5. Final simplification66.7%

            \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.75 \cdot 10^{-131} \lor \neg \left(t \leq 1.25 \cdot 10^{-64}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{\mathsf{fma}\left(\left(ew \cdot t\right) \cdot t, 0.3333333333333333, ew\right) \cdot t}\right) \cdot eh\right|\\ \end{array} \]
          6. Add Preprocessing

          Alternative 9: 58.8% accurate, 3.7× speedup?

          \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -1.75 \cdot 10^{-131} \lor \neg \left(t \leq 1.25 \cdot 10^{-64}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\right|\\ \end{array} \end{array} \]
          (FPCore (eh ew t)
           :precision binary64
           (if (or (<= t -1.75e-131) (not (<= t 1.25e-64)))
             (fabs (* (sin t) ew))
             (fabs (* (sin (atan (/ eh (* ew t)))) eh))))
          double code(double eh, double ew, double t) {
          	double tmp;
          	if ((t <= -1.75e-131) || !(t <= 1.25e-64)) {
          		tmp = fabs((sin(t) * ew));
          	} else {
          		tmp = fabs((sin(atan((eh / (ew * t)))) * eh));
          	}
          	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) :: tmp
              if ((t <= (-1.75d-131)) .or. (.not. (t <= 1.25d-64))) then
                  tmp = abs((sin(t) * ew))
              else
                  tmp = abs((sin(atan((eh / (ew * t)))) * eh))
              end if
              code = tmp
          end function
          
          public static double code(double eh, double ew, double t) {
          	double tmp;
          	if ((t <= -1.75e-131) || !(t <= 1.25e-64)) {
          		tmp = Math.abs((Math.sin(t) * ew));
          	} else {
          		tmp = Math.abs((Math.sin(Math.atan((eh / (ew * t)))) * eh));
          	}
          	return tmp;
          }
          
          def code(eh, ew, t):
          	tmp = 0
          	if (t <= -1.75e-131) or not (t <= 1.25e-64):
          		tmp = math.fabs((math.sin(t) * ew))
          	else:
          		tmp = math.fabs((math.sin(math.atan((eh / (ew * t)))) * eh))
          	return tmp
          
          function code(eh, ew, t)
          	tmp = 0.0
          	if ((t <= -1.75e-131) || !(t <= 1.25e-64))
          		tmp = abs(Float64(sin(t) * ew));
          	else
          		tmp = abs(Float64(sin(atan(Float64(eh / Float64(ew * t)))) * eh));
          	end
          	return tmp
          end
          
          function tmp_2 = code(eh, ew, t)
          	tmp = 0.0;
          	if ((t <= -1.75e-131) || ~((t <= 1.25e-64)))
          		tmp = abs((sin(t) * ew));
          	else
          		tmp = abs((sin(atan((eh / (ew * t)))) * eh));
          	end
          	tmp_2 = tmp;
          end
          
          code[eh_, ew_, t_] := If[Or[LessEqual[t, -1.75e-131], N[Not[LessEqual[t, 1.25e-64]], $MachinePrecision]], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[N[ArcTan[N[(eh / N[(ew * t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision]]
          
          \begin{array}{l}
          
          \\
          \begin{array}{l}
          \mathbf{if}\;t \leq -1.75 \cdot 10^{-131} \lor \neg \left(t \leq 1.25 \cdot 10^{-64}\right):\\
          \;\;\;\;\left|\sin t \cdot ew\right|\\
          
          \mathbf{else}:\\
          \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\right|\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if t < -1.7500000000000001e-131 or 1.25000000000000008e-64 < t

            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. Step-by-step derivation
              1. lift-/.f64N/A

                \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
              2. lift-/.f64N/A

                \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
              3. associate-/l/N/A

                \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
              4. lower-/.f64N/A

                \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
              5. lower-*.f6499.7

                \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
            4. Applied rewrites99.7%

              \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
            5. Applied rewrites99.7%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
              2. lower-*.f64N/A

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

                \[\leadsto \left|\color{blue}{\sin t} \cdot ew\right| \]
            10. Applied rewrites59.4%

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

            if -1.7500000000000001e-131 < t < 1.25000000000000008e-64

            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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                  \[\leadsto \left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\right| \]
              4. Recombined 2 regimes into one program.
              5. Final simplification66.7%

                \[\leadsto \begin{array}{l} \mathbf{if}\;t \leq -1.75 \cdot 10^{-131} \lor \neg \left(t \leq 1.25 \cdot 10^{-64}\right):\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right) \cdot eh\right|\\ \end{array} \]
              6. Add Preprocessing

              Alternative 10: 41.8% accurate, 4.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} t_1 := \left(\frac{eh}{ew} \cdot -0.3333333333333333\right) \cdot t\\ \mathbf{if}\;eh \leq -3.85 \cdot 10^{+186}:\\ \;\;\;\;\left|\frac{t\_1}{\sqrt{{t\_1}^{2} + 1}} \cdot eh\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin t \cdot ew\right|\\ \end{array} \end{array} \]
              (FPCore (eh ew t)
               :precision binary64
               (let* ((t_1 (* (* (/ eh ew) -0.3333333333333333) t)))
                 (if (<= eh -3.85e+186)
                   (fabs (* (/ t_1 (sqrt (+ (pow t_1 2.0) 1.0))) eh))
                   (fabs (* (sin t) ew)))))
              double code(double eh, double ew, double t) {
              	double t_1 = ((eh / ew) * -0.3333333333333333) * t;
              	double tmp;
              	if (eh <= -3.85e+186) {
              		tmp = fabs(((t_1 / sqrt((pow(t_1, 2.0) + 1.0))) * eh));
              	} else {
              		tmp = fabs((sin(t) * ew));
              	}
              	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 = ((eh / ew) * (-0.3333333333333333d0)) * t
                  if (eh <= (-3.85d+186)) then
                      tmp = abs(((t_1 / sqrt(((t_1 ** 2.0d0) + 1.0d0))) * eh))
                  else
                      tmp = abs((sin(t) * ew))
                  end if
                  code = tmp
              end function
              
              public static double code(double eh, double ew, double t) {
              	double t_1 = ((eh / ew) * -0.3333333333333333) * t;
              	double tmp;
              	if (eh <= -3.85e+186) {
              		tmp = Math.abs(((t_1 / Math.sqrt((Math.pow(t_1, 2.0) + 1.0))) * eh));
              	} else {
              		tmp = Math.abs((Math.sin(t) * ew));
              	}
              	return tmp;
              }
              
              def code(eh, ew, t):
              	t_1 = ((eh / ew) * -0.3333333333333333) * t
              	tmp = 0
              	if eh <= -3.85e+186:
              		tmp = math.fabs(((t_1 / math.sqrt((math.pow(t_1, 2.0) + 1.0))) * eh))
              	else:
              		tmp = math.fabs((math.sin(t) * ew))
              	return tmp
              
              function code(eh, ew, t)
              	t_1 = Float64(Float64(Float64(eh / ew) * -0.3333333333333333) * t)
              	tmp = 0.0
              	if (eh <= -3.85e+186)
              		tmp = abs(Float64(Float64(t_1 / sqrt(Float64((t_1 ^ 2.0) + 1.0))) * eh));
              	else
              		tmp = abs(Float64(sin(t) * ew));
              	end
              	return tmp
              end
              
              function tmp_2 = code(eh, ew, t)
              	t_1 = ((eh / ew) * -0.3333333333333333) * t;
              	tmp = 0.0;
              	if (eh <= -3.85e+186)
              		tmp = abs(((t_1 / sqrt(((t_1 ^ 2.0) + 1.0))) * eh));
              	else
              		tmp = abs((sin(t) * ew));
              	end
              	tmp_2 = tmp;
              end
              
              code[eh_, ew_, t_] := Block[{t$95$1 = N[(N[(N[(eh / ew), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] * t), $MachinePrecision]}, If[LessEqual[eh, -3.85e+186], N[Abs[N[(N[(t$95$1 / N[Sqrt[N[(N[Power[t$95$1, 2.0], $MachinePrecision] + 1.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] * eh), $MachinePrecision]], $MachinePrecision], N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              t_1 := \left(\frac{eh}{ew} \cdot -0.3333333333333333\right) \cdot t\\
              \mathbf{if}\;eh \leq -3.85 \cdot 10^{+186}:\\
              \;\;\;\;\left|\frac{t\_1}{\sqrt{{t\_1}^{2} + 1}} \cdot eh\right|\\
              
              \mathbf{else}:\\
              \;\;\;\;\left|\sin t \cdot ew\right|\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if eh < -3.85000000000000019e186

                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. Taylor expanded in t around 0

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left|\frac{\left(\frac{eh}{ew} \cdot -0.3333333333333333\right) \cdot t}{\sqrt{{\left(\left(\frac{eh}{ew} \cdot -0.3333333333333333\right) \cdot t\right)}^{2} + 1}} \cdot eh\right| \]

                      if -3.85000000000000019e186 < 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. Step-by-step derivation
                        1. lift-/.f64N/A

                          \[\leadsto \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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                        2. lift-/.f64N/A

                          \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
                        3. associate-/l/N/A

                          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
                        4. lower-/.f64N/A

                          \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
                        5. lower-*.f6499.8

                          \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
                      4. Applied rewrites99.8%

                        \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
                      5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                          \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                        2. lower-*.f64N/A

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

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

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

                    Alternative 11: 41.2% accurate, 8.1× speedup?

                    \[\begin{array}{l} \\ \left|\sin t \cdot ew\right| \end{array} \]
                    (FPCore (eh ew t) :precision binary64 (fabs (* (sin t) ew)))
                    double code(double eh, double ew, double t) {
                    	return fabs((sin(t) * ew));
                    }
                    
                    real(8) function code(eh, ew, t)
                        real(8), intent (in) :: eh
                        real(8), intent (in) :: ew
                        real(8), intent (in) :: t
                        code = abs((sin(t) * ew))
                    end function
                    
                    public static double code(double eh, double ew, double t) {
                    	return Math.abs((Math.sin(t) * ew));
                    }
                    
                    def code(eh, ew, t):
                    	return math.fabs((math.sin(t) * ew))
                    
                    function code(eh, ew, t)
                    	return abs(Float64(sin(t) * ew))
                    end
                    
                    function tmp = code(eh, ew, t)
                    	tmp = abs((sin(t) * ew));
                    end
                    
                    code[eh_, ew_, t_] := N[Abs[N[(N[Sin[t], $MachinePrecision] * ew), $MachinePrecision]], $MachinePrecision]
                    
                    \begin{array}{l}
                    
                    \\
                    \left|\sin t \cdot ew\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|\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} \color{blue}{\left(\frac{\frac{eh}{ew}}{\tan t}\right)}\right| \]
                      2. lift-/.f64N/A

                        \[\leadsto \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{\color{blue}{\frac{eh}{ew}}}{\tan t}\right)\right| \]
                      3. associate-/l/N/A

                        \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
                      4. lower-/.f64N/A

                        \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
                      5. lower-*.f6499.8

                        \[\leadsto \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{eh}{\color{blue}{\tan t \cdot ew}}\right)\right| \]
                    4. Applied rewrites99.8%

                      \[\leadsto \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} \color{blue}{\left(\frac{eh}{\tan t \cdot ew}\right)}\right| \]
                    5. Applied rewrites99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

                        \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                      2. lower-*.f64N/A

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

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

                      \[\leadsto \left|\color{blue}{\sin t \cdot ew}\right| \]
                    11. Add Preprocessing

                    Reproduce

                    ?
                    herbie shell --seed 2024303 
                    (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))))))))