Example from Robby

Percentage Accurate: 99.8% → 99.8%
Time: 23.9s
Alternatives: 10
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 10 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.0× speedup?

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

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

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

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

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

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

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

    \[\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. Taylor expanded in ew around 0

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 2: 98.9% accurate, 1.5× speedup?

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

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

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

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

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

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

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

    \[\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. 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| \]
    4. associate-*l*N/A

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

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

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

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

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

Alternative 3: 98.4% accurate, 1.6× speedup?

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

\\
\left|\mathsf{fma}\left(\sin t, ew, eh \cdot \left(\cos t \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right)\right)\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. Applied rewrites89.3%

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

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

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

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

Alternative 4: 89.7% accurate, 1.7× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
t_2 := \frac{eh}{ew \cdot t}\\
\mathbf{if}\;eh \leq 9.5 \cdot 10^{+64}:\\
\;\;\;\;\left|\mathsf{fma}\left(\frac{\sin t}{\sqrt{\mathsf{fma}\left(t\_2, t\_2, 1\right)}}, ew, t\_1 \cdot \sin \tan^{-1} t\_2\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot t\_1\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 9.50000000000000028e64

    1. Initial program 99.8%

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

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

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

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

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

      \[\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. 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| \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

    if 9.50000000000000028e64 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 5: 72.3% accurate, 2.0× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|\\ \mathbf{if}\;eh \leq -1.1 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 2.5 \cdot 10^{-239}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (* (sin (atan (/ eh (* ew (tan t))))) (* eh (cos t))))))
   (if (<= eh -1.1e-26) t_1 (if (<= eh 2.5e-239) (fabs (* ew (sin t))) t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t))));
	double tmp;
	if (eh <= -1.1e-26) {
		tmp = t_1;
	} else if (eh <= 2.5e-239) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = abs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t))))
    if (eh <= (-1.1d-26)) then
        tmp = t_1
    else if (eh <= 2.5d-239) then
        tmp = abs((ew * sin(t)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.abs((Math.sin(Math.atan((eh / (ew * Math.tan(t))))) * (eh * Math.cos(t))));
	double tmp;
	if (eh <= -1.1e-26) {
		tmp = t_1;
	} else if (eh <= 2.5e-239) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs((math.sin(math.atan((eh / (ew * math.tan(t))))) * (eh * math.cos(t))))
	tmp = 0
	if eh <= -1.1e-26:
		tmp = t_1
	elif eh <= 2.5e-239:
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(sin(atan(Float64(eh / Float64(ew * tan(t))))) * Float64(eh * cos(t))))
	tmp = 0.0
	if (eh <= -1.1e-26)
		tmp = t_1;
	elseif (eh <= 2.5e-239)
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs((sin(atan((eh / (ew * tan(t))))) * (eh * cos(t))));
	tmp = 0.0;
	if (eh <= -1.1e-26)
		tmp = t_1;
	elseif (eh <= 2.5e-239)
		tmp = abs((ew * sin(t)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[N[(N[Sin[N[ArcTan[N[(eh / N[(ew * N[Tan[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(eh * N[Cos[t], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[eh, -1.1e-26], t$95$1, If[LessEqual[eh, 2.5e-239], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|\\
\mathbf{if}\;eh \leq -1.1 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;eh \leq 2.5 \cdot 10^{-239}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.1e-26 or 2.5e-239 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

    if -1.1e-26 < eh < 2.5e-239

    1. Initial program 99.7%

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

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

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

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

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

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

    \[\leadsto \begin{array}{l} \mathbf{if}\;eh \leq -1.1 \cdot 10^{-26}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|\\ \mathbf{elif}\;eh \leq 2.5 \cdot 10^{-239}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot \left(eh \cdot \cos t\right)\right|\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 89.2% accurate, 2.0× speedup?

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

\\
\begin{array}{l}
t_1 := eh \cdot \cos t\\
\mathbf{if}\;eh \leq 9.5 \cdot 10^{+64}:\\
\;\;\;\;\left|\mathsf{fma}\left(\sin t, ew, t\_1 \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right)\right|\\

\mathbf{else}:\\
\;\;\;\;\left|\sin \tan^{-1} \left(\frac{eh}{ew \cdot \tan t}\right) \cdot t\_1\right|\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < 9.50000000000000028e64

    1. Initial program 99.8%

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

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

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

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

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

      \[\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. 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| \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

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

    if 9.50000000000000028e64 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

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

Alternative 7: 59.6% accurate, 7.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_1 := \left|-eh\right|\\ \mathbf{if}\;eh \leq -1.15 \cdot 10^{-26}:\\ \;\;\;\;t\_1\\ \mathbf{elif}\;eh \leq 9.5 \cdot 10^{+20}:\\ \;\;\;\;\left|ew \cdot \sin t\right|\\ \mathbf{else}:\\ \;\;\;\;t\_1\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (let* ((t_1 (fabs (- eh))))
   (if (<= eh -1.15e-26) t_1 (if (<= eh 9.5e+20) (fabs (* ew (sin t))) t_1))))
double code(double eh, double ew, double t) {
	double t_1 = fabs(-eh);
	double tmp;
	if (eh <= -1.15e-26) {
		tmp = t_1;
	} else if (eh <= 9.5e+20) {
		tmp = fabs((ew * sin(t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
real(8) function code(eh, ew, t)
    real(8), intent (in) :: eh
    real(8), intent (in) :: ew
    real(8), intent (in) :: t
    real(8) :: t_1
    real(8) :: tmp
    t_1 = abs(-eh)
    if (eh <= (-1.15d-26)) then
        tmp = t_1
    else if (eh <= 9.5d+20) then
        tmp = abs((ew * sin(t)))
    else
        tmp = t_1
    end if
    code = tmp
end function
public static double code(double eh, double ew, double t) {
	double t_1 = Math.abs(-eh);
	double tmp;
	if (eh <= -1.15e-26) {
		tmp = t_1;
	} else if (eh <= 9.5e+20) {
		tmp = Math.abs((ew * Math.sin(t)));
	} else {
		tmp = t_1;
	}
	return tmp;
}
def code(eh, ew, t):
	t_1 = math.fabs(-eh)
	tmp = 0
	if eh <= -1.15e-26:
		tmp = t_1
	elif eh <= 9.5e+20:
		tmp = math.fabs((ew * math.sin(t)))
	else:
		tmp = t_1
	return tmp
function code(eh, ew, t)
	t_1 = abs(Float64(-eh))
	tmp = 0.0
	if (eh <= -1.15e-26)
		tmp = t_1;
	elseif (eh <= 9.5e+20)
		tmp = abs(Float64(ew * sin(t)));
	else
		tmp = t_1;
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	t_1 = abs(-eh);
	tmp = 0.0;
	if (eh <= -1.15e-26)
		tmp = t_1;
	elseif (eh <= 9.5e+20)
		tmp = abs((ew * sin(t)));
	else
		tmp = t_1;
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := Block[{t$95$1 = N[Abs[(-eh)], $MachinePrecision]}, If[LessEqual[eh, -1.15e-26], t$95$1, If[LessEqual[eh, 9.5e+20], N[Abs[N[(ew * N[Sin[t], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], t$95$1]]]
\begin{array}{l}

\\
\begin{array}{l}
t_1 := \left|-eh\right|\\
\mathbf{if}\;eh \leq -1.15 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\

\mathbf{elif}\;eh \leq 9.5 \cdot 10^{+20}:\\
\;\;\;\;\left|ew \cdot \sin t\right|\\

\mathbf{else}:\\
\;\;\;\;t\_1\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if eh < -1.15000000000000004e-26 or 9.5e20 < eh

    1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

        if -1.15000000000000004e-26 < eh < 9.5e20

        1. Initial program 99.7%

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

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

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

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

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

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

      Alternative 8: 44.5% accurate, 18.9× speedup?

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

        1. Initial program 99.7%

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

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

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

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

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

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

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

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

          if -1e143 < ew < 1.15e191

          1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

              if 1.15e191 < ew

              1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

              Alternative 9: 44.5% accurate, 43.4× speedup?

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

                1. Initial program 99.8%

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

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

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

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

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

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

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

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

                  if -2.75000000000000008e150 < ew < 1.15e191

                  1. Initial program 99.8%

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

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

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

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

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

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

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

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

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

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

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

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

                    Alternative 10: 41.9% accurate, 174.0× speedup?

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

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

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

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

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

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

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

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

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

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

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

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

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

                        Reproduce

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