Example 2 from Robby

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

Specification

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

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

Sampling outcomes in binary64 precision:

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 13 alternatives:

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

Initial Program: 99.8% accurate, 1.0× speedup?

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

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

Alternative 1: 99.8% accurate, 1.1× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

    \[\leadsto \color{blue}{\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cos-atan99.8%

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{-ew}\right)}}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    3. add-sqr-sqrt45.6%

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

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{\sqrt{\color{blue}{ew \cdot ew}}}\right)}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    6. sqrt-unprod54.2%

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{\color{blue}{\sqrt{ew} \cdot \sqrt{ew}}}\right)}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    7. add-sqr-sqrt99.8%

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

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

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

Alternative 2: 98.9% accurate, 1.1× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
    3. distribute-neg-frac77.6%

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

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

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

Alternative 3: 99.8% accurate, 1.1× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. distribute-rgt-neg-in99.8%

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

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

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. expm1-log1p-u75.8%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. expm1-udef56.5%

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)} - 1\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  6. Applied egg-rr58.0%

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} - 1\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  7. Step-by-step derivation
    1. expm1-def77.4%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. expm1-log1p99.8%

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    3. associate-/l*99.7%

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

    \[\leadsto \left|\color{blue}{\frac{ew}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  9. Final simplification99.7%

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

Alternative 4: 98.9% accurate, 1.3× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. distribute-rgt-neg-in99.8%

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

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

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. expm1-log1p-u75.8%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. expm1-udef56.5%

      \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right)} - 1\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  6. Applied egg-rr58.0%

    \[\leadsto \left|\color{blue}{\left(e^{\mathsf{log1p}\left(\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)} - 1\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  7. Step-by-step derivation
    1. expm1-def77.4%

      \[\leadsto \left|\color{blue}{\mathsf{expm1}\left(\mathsf{log1p}\left(\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}\right)\right)} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. expm1-log1p99.8%

      \[\leadsto \left|\color{blue}{\frac{ew \cdot \cos t}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    3. associate-/l*99.7%

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

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

    \[\leadsto \left|\frac{ew}{\frac{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{ew}\right)}{\cos t}} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \color{blue}{\left(-1 \cdot \frac{eh \cdot t}{ew}\right)}\right| \]
  10. Step-by-step derivation
    1. mul-1-neg77.6%

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
    3. distribute-neg-frac77.6%

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

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

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

Alternative 5: 98.2% accurate, 1.5× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

    \[\leadsto \color{blue}{\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cos-atan99.8%

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{-ew}\right)}}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    3. add-sqr-sqrt45.6%

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

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{\sqrt{\color{blue}{ew \cdot ew}}}\right)}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    6. sqrt-unprod54.2%

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{\color{blue}{\sqrt{ew} \cdot \sqrt{ew}}}\right)}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    7. add-sqr-sqrt99.8%

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

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

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

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

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

Alternative 6: 98.0% accurate, 1.8× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. associate-*l*99.8%

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

    \[\leadsto \color{blue}{\left|ew \cdot \left(\cos t \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. cos-atan99.8%

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\color{blue}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{-ew}\right)}}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    3. add-sqr-sqrt45.6%

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

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

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{\sqrt{\color{blue}{ew \cdot ew}}}\right)}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    6. sqrt-unprod54.2%

      \[\leadsto \left|ew \cdot \left(\cos t \cdot \frac{1}{\mathsf{hypot}\left(1, \tan t \cdot \frac{eh}{\color{blue}{\sqrt{ew} \cdot \sqrt{ew}}}\right)}\right) - \sin t \cdot \left(eh \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right)\right| \]
    7. add-sqr-sqrt99.8%

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

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

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
    3. distribute-neg-frac77.6%

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

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

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

Alternative 7: 79.0% accurate, 1.8× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. distribute-rgt-neg-in99.8%

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

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

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt98.6%

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

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

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

    \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  8. Step-by-step derivation
    1. pow-base-177.6%

      \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. *-lft-identity77.6%

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

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

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

Alternative 8: 79.0% accurate, 2.2× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. distribute-rgt-neg-in99.8%

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

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

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt98.6%

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

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

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

    \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  8. Step-by-step derivation
    1. pow-base-177.6%

      \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. *-lft-identity77.6%

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

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
    3. distribute-neg-frac77.6%

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

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

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

Alternative 9: 79.0% accurate, 2.2× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. distribute-rgt-neg-in99.8%

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

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

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt98.6%

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

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

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

    \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  8. Step-by-step derivation
    1. pow-base-177.6%

      \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. *-lft-identity77.6%

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

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
    3. distribute-neg-frac77.6%

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

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\color{blue}{\frac{t}{ew}} \cdot \left(-eh\right)\right)\right| \]
    4. add-sqr-sqrt38.1%

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{t}{ew} \cdot \color{blue}{\left(\sqrt{eh} \cdot \sqrt{eh}\right)}\right)\right| \]
    8. add-sqr-sqrt77.5%

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

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

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

Alternative 10: 63.4% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -5.5 \cdot 10^{-6} \lor \neg \left(t \leq 0.0033\right):\\ \;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \left(t \cdot \frac{\frac{eh}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)}}{-ew}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{t}}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -5.5e-6) (not (<= t 0.0033)))
   (fabs
    (-
     ew
     (* (* eh (sin t)) (* t (/ (/ eh (hypot 1.0 (* t (/ eh ew)))) (- ew))))))
   (fabs (- ew (* (sin (atan (/ (- eh) (/ ew t)))) (* t eh))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -5.5e-6) || !(t <= 0.0033)) {
		tmp = fabs((ew - ((eh * sin(t)) * (t * ((eh / hypot(1.0, (t * (eh / ew)))) / -ew)))));
	} else {
		tmp = fabs((ew - (sin(atan((-eh / (ew / t)))) * (t * eh))));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -5.5e-6) || !(t <= 0.0033)) {
		tmp = Math.abs((ew - ((eh * Math.sin(t)) * (t * ((eh / Math.hypot(1.0, (t * (eh / ew)))) / -ew)))));
	} else {
		tmp = Math.abs((ew - (Math.sin(Math.atan((-eh / (ew / t)))) * (t * eh))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -5.5e-6) or not (t <= 0.0033):
		tmp = math.fabs((ew - ((eh * math.sin(t)) * (t * ((eh / math.hypot(1.0, (t * (eh / ew)))) / -ew)))))
	else:
		tmp = math.fabs((ew - (math.sin(math.atan((-eh / (ew / t)))) * (t * eh))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -5.5e-6) || !(t <= 0.0033))
		tmp = abs(Float64(ew - Float64(Float64(eh * sin(t)) * Float64(t * Float64(Float64(eh / hypot(1.0, Float64(t * Float64(eh / ew)))) / Float64(-ew))))));
	else
		tmp = abs(Float64(ew - Float64(sin(atan(Float64(Float64(-eh) / Float64(ew / t)))) * Float64(t * eh))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -5.5e-6) || ~((t <= 0.0033)))
		tmp = abs((ew - ((eh * sin(t)) * (t * ((eh / hypot(1.0, (t * (eh / ew)))) / -ew)))));
	else
		tmp = abs((ew - (sin(atan((-eh / (ew / t)))) * (t * eh))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -5.5e-6], N[Not[LessEqual[t, 0.0033]], $MachinePrecision]], N[Abs[N[(ew - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(t * N[(N[(eh / N[Sqrt[1.0 ^ 2 + N[(t * N[(eh / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision]), $MachinePrecision] / (-ew)), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[((-eh) / N[(ew / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.5 \cdot 10^{-6} \lor \neg \left(t \leq 0.0033\right):\\
\;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \left(t \cdot \frac{\frac{eh}{\mathsf{hypot}\left(1, t \cdot \frac{eh}{ew}\right)}}{-ew}\right)\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -5.4999999999999999e-6 or 0.0033 < t

    1. Initial program 99.6%

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

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. distribute-rgt-neg-in99.6%

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

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

      \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt98.6%

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

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

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

      \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    8. Step-by-step derivation
      1. pow-base-159.3%

        \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
      2. *-lft-identity59.3%

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

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

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

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

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
      3. distribute-neg-frac59.3%

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

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

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{\frac{-eh}{\frac{ew}{t}}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}}\right| \]
      2. frac-2neg14.5%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{\frac{-\left(-eh\right)}{-\frac{ew}{t}}}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}\right| \]
      3. remove-double-neg14.5%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{\color{blue}{eh}}{-\frac{ew}{t}}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}\right| \]
      4. associate-/l/15.0%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{eh}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}} \cdot \left(-\frac{ew}{t}\right)}}\right| \]
      5. hypot-1-def24.4%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\color{blue}{\mathsf{hypot}\left(1, \frac{-eh}{\frac{ew}{t}}\right)} \cdot \left(-\frac{ew}{t}\right)}\right| \]
      6. div-inv23.5%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, \color{blue}{\left(-eh\right) \cdot \frac{1}{\frac{ew}{t}}}\right) \cdot \left(-\frac{ew}{t}\right)}\right| \]
      7. add-sqr-sqrt10.0%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right) \cdot \left(-\frac{ew}{t}\right)}\right| \]
      8. sqrt-unprod19.6%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, \color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}} \cdot \frac{1}{\frac{ew}{t}}\right) \cdot \left(-\frac{ew}{t}\right)}\right| \]
      9. sqr-neg19.6%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, \sqrt{\color{blue}{eh \cdot eh}} \cdot \frac{1}{\frac{ew}{t}}\right) \cdot \left(-\frac{ew}{t}\right)}\right| \]
      10. sqrt-unprod13.5%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{eh} \cdot \sqrt{eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right) \cdot \left(-\frac{ew}{t}\right)}\right| \]
      11. add-sqr-sqrt23.5%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, \color{blue}{eh} \cdot \frac{1}{\frac{ew}{t}}\right) \cdot \left(-\frac{ew}{t}\right)}\right| \]
      12. clear-num23.4%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{ew}}\right) \cdot \left(-\frac{ew}{t}\right)}\right| \]
      13. distribute-neg-frac23.4%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right) \cdot \color{blue}{\frac{-ew}{t}}}\right| \]
    14. Applied egg-rr23.4%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{eh}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right) \cdot \frac{-ew}{t}}}\right| \]
    15. Step-by-step derivation
      1. associate-/r*23.4%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{\frac{eh}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}}{\frac{-ew}{t}}}\right| \]
      2. associate-/r/25.4%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\left(\frac{\frac{eh}{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}}{-ew} \cdot t\right)}\right| \]
      3. *-commutative25.4%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \left(\frac{\frac{eh}{\mathsf{hypot}\left(1, \color{blue}{\frac{t}{ew} \cdot eh}\right)}}{-ew} \cdot t\right)\right| \]
      4. associate-*l/23.6%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \left(\frac{\frac{eh}{\mathsf{hypot}\left(1, \color{blue}{\frac{t \cdot eh}{ew}}\right)}}{-ew} \cdot t\right)\right| \]
      5. associate-*r/26.0%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \left(\frac{\frac{eh}{\mathsf{hypot}\left(1, \color{blue}{t \cdot \frac{eh}{ew}}\right)}}{-ew} \cdot t\right)\right| \]
    16. Simplified26.0%

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

    if -5.4999999999999999e-6 < t < 0.0033

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. distribute-rgt-neg-in100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{\left(eh \cdot \sin t\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      3. cancel-sign-sub100.0%

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

      \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt98.5%

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

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

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

      \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    8. Step-by-step derivation
      1. pow-base-198.2%

        \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
      2. *-lft-identity98.2%

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

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

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

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

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
      3. distribute-neg-frac98.2%

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

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

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

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

Alternative 11: 63.1% accurate, 2.8× speedup?

\[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;t \leq -7.5 \cdot 10^{-6} \lor \neg \left(t \leq 0.0033\right):\\ \;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}{t}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|ew - \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{t}}\right) \cdot \left(t \cdot eh\right)\right|\\ \end{array} \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (if (or (<= t -7.5e-6) (not (<= t 0.0033)))
   (fabs
    (- ew (* (* eh (sin t)) (/ (/ eh ew) (/ (hypot 1.0 (* eh (/ t ew))) t)))))
   (fabs (- ew (* (sin (atan (/ (- eh) (/ ew t)))) (* t eh))))))
double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -7.5e-6) || !(t <= 0.0033)) {
		tmp = fabs((ew - ((eh * sin(t)) * ((eh / ew) / (hypot(1.0, (eh * (t / ew))) / t)))));
	} else {
		tmp = fabs((ew - (sin(atan((-eh / (ew / t)))) * (t * eh))));
	}
	return tmp;
}
public static double code(double eh, double ew, double t) {
	double tmp;
	if ((t <= -7.5e-6) || !(t <= 0.0033)) {
		tmp = Math.abs((ew - ((eh * Math.sin(t)) * ((eh / ew) / (Math.hypot(1.0, (eh * (t / ew))) / t)))));
	} else {
		tmp = Math.abs((ew - (Math.sin(Math.atan((-eh / (ew / t)))) * (t * eh))));
	}
	return tmp;
}
def code(eh, ew, t):
	tmp = 0
	if (t <= -7.5e-6) or not (t <= 0.0033):
		tmp = math.fabs((ew - ((eh * math.sin(t)) * ((eh / ew) / (math.hypot(1.0, (eh * (t / ew))) / t)))))
	else:
		tmp = math.fabs((ew - (math.sin(math.atan((-eh / (ew / t)))) * (t * eh))))
	return tmp
function code(eh, ew, t)
	tmp = 0.0
	if ((t <= -7.5e-6) || !(t <= 0.0033))
		tmp = abs(Float64(ew - Float64(Float64(eh * sin(t)) * Float64(Float64(eh / ew) / Float64(hypot(1.0, Float64(eh * Float64(t / ew))) / t)))));
	else
		tmp = abs(Float64(ew - Float64(sin(atan(Float64(Float64(-eh) / Float64(ew / t)))) * Float64(t * eh))));
	end
	return tmp
end
function tmp_2 = code(eh, ew, t)
	tmp = 0.0;
	if ((t <= -7.5e-6) || ~((t <= 0.0033)))
		tmp = abs((ew - ((eh * sin(t)) * ((eh / ew) / (hypot(1.0, (eh * (t / ew))) / t)))));
	else
		tmp = abs((ew - (sin(atan((-eh / (ew / t)))) * (t * eh))));
	end
	tmp_2 = tmp;
end
code[eh_, ew_, t_] := If[Or[LessEqual[t, -7.5e-6], N[Not[LessEqual[t, 0.0033]], $MachinePrecision]], N[Abs[N[(ew - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(N[(eh / ew), $MachinePrecision] / N[(N[Sqrt[1.0 ^ 2 + N[(eh * N[(t / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Abs[N[(ew - N[(N[Sin[N[ArcTan[N[((-eh) / N[(ew / t), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] * N[(t * eh), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}

\\
\begin{array}{l}
\mathbf{if}\;t \leq -7.5 \cdot 10^{-6} \lor \neg \left(t \leq 0.0033\right):\\
\;\;\;\;\left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}{t}}\right|\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if t < -7.50000000000000019e-6 or 0.0033 < t

    1. Initial program 99.6%

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

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. distribute-rgt-neg-in99.6%

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

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

      \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt98.6%

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

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

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

      \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    8. Step-by-step derivation
      1. pow-base-159.3%

        \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
      2. *-lft-identity59.3%

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

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

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

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

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
      3. distribute-neg-frac59.3%

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

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

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{\frac{-eh}{\frac{ew}{t}}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}}\right| \]
      2. associate-/r/15.9%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{\frac{-eh}{ew} \cdot t}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}\right| \]
      3. associate-/l*16.6%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{\frac{-eh}{ew}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{t}}}\right| \]
      4. add-sqr-sqrt7.4%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{\color{blue}{\sqrt{-eh} \cdot \sqrt{-eh}}}{ew}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{t}}\right| \]
      5. sqrt-unprod15.2%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{ew}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{t}}\right| \]
      6. sqr-neg15.2%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{\sqrt{\color{blue}{eh \cdot eh}}}{ew}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{t}}\right| \]
      7. sqrt-unprod9.2%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{ew}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{t}}\right| \]
      8. add-sqr-sqrt16.6%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{\color{blue}{eh}}{ew}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{t}}\right| \]
      9. hypot-1-def25.7%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\color{blue}{\mathsf{hypot}\left(1, \frac{-eh}{\frac{ew}{t}}\right)}}{t}}\right| \]
      10. div-inv25.1%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, \color{blue}{\left(-eh\right) \cdot \frac{1}{\frac{ew}{t}}}\right)}{t}}\right| \]
      11. add-sqr-sqrt10.8%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right)}{t}}\right| \]
      12. sqrt-unprod20.1%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, \color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}} \cdot \frac{1}{\frac{ew}{t}}\right)}{t}}\right| \]
      13. sqr-neg20.1%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, \sqrt{\color{blue}{eh \cdot eh}} \cdot \frac{1}{\frac{ew}{t}}\right)}{t}}\right| \]
      14. sqrt-unprod14.2%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{eh} \cdot \sqrt{eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right)}{t}}\right| \]
      15. add-sqr-sqrt25.1%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, \color{blue}{eh} \cdot \frac{1}{\frac{ew}{t}}\right)}{t}}\right| \]
      16. clear-num25.0%

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\frac{eh}{ew}}{\frac{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{ew}}\right)}{t}}\right| \]
    14. Applied egg-rr25.0%

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

    if -7.50000000000000019e-6 < t < 0.0033

    1. Initial program 100.0%

      \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
    2. Step-by-step derivation
      1. sub-neg100.0%

        \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      2. distribute-rgt-neg-in100.0%

        \[\leadsto \left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \color{blue}{\left(eh \cdot \sin t\right) \cdot \left(-\sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
      3. cancel-sign-sub100.0%

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

      \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
    4. Add Preprocessing
    5. Step-by-step derivation
      1. add-cube-cbrt98.5%

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

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

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

      \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    8. Step-by-step derivation
      1. pow-base-198.2%

        \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
      2. *-lft-identity98.2%

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

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

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

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

        \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
      3. distribute-neg-frac98.2%

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

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

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

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

Alternative 12: 60.5% accurate, 2.9× speedup?

\[\begin{array}{l} \\ \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}{\frac{t}{ew}}}\right| \end{array} \]
(FPCore (eh ew t)
 :precision binary64
 (fabs
  (- ew (* (* eh (sin t)) (/ eh (/ (hypot 1.0 (* eh (/ t ew))) (/ t ew)))))))
double code(double eh, double ew, double t) {
	return fabs((ew - ((eh * sin(t)) * (eh / (hypot(1.0, (eh * (t / ew))) / (t / ew))))));
}
public static double code(double eh, double ew, double t) {
	return Math.abs((ew - ((eh * Math.sin(t)) * (eh / (Math.hypot(1.0, (eh * (t / ew))) / (t / ew))))));
}
def code(eh, ew, t):
	return math.fabs((ew - ((eh * math.sin(t)) * (eh / (math.hypot(1.0, (eh * (t / ew))) / (t / ew))))))
function code(eh, ew, t)
	return abs(Float64(ew - Float64(Float64(eh * sin(t)) * Float64(eh / Float64(hypot(1.0, Float64(eh * Float64(t / ew))) / Float64(t / ew))))))
end
function tmp = code(eh, ew, t)
	tmp = abs((ew - ((eh * sin(t)) * (eh / (hypot(1.0, (eh * (t / ew))) / (t / ew))))));
end
code[eh_, ew_, t_] := N[Abs[N[(ew - N[(N[(eh * N[Sin[t], $MachinePrecision]), $MachinePrecision] * N[(eh / N[(N[Sqrt[1.0 ^ 2 + N[(eh * N[(t / ew), $MachinePrecision]), $MachinePrecision] ^ 2], $MachinePrecision] / N[(t / ew), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. distribute-rgt-neg-in99.8%

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

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

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt98.6%

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

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

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

    \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  8. Step-by-step derivation
    1. pow-base-177.6%

      \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. *-lft-identity77.6%

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

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
    3. distribute-neg-frac77.6%

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{\frac{-eh}{\frac{ew}{t}}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}}\right| \]
    2. div-inv47.8%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{\left(-eh\right) \cdot \frac{1}{\frac{ew}{t}}}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}\right| \]
    3. clear-num47.8%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\left(-eh\right) \cdot \color{blue}{\frac{t}{ew}}}{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}\right| \]
    4. associate-/l*48.1%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{-eh}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{\frac{t}{ew}}}}\right| \]
    5. add-sqr-sqrt23.1%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{\sqrt{-eh} \cdot \sqrt{-eh}}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{\frac{t}{ew}}}\right| \]
    6. sqrt-unprod40.7%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{\frac{t}{ew}}}\right| \]
    7. sqr-neg40.7%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\sqrt{\color{blue}{eh \cdot eh}}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{\frac{t}{ew}}}\right| \]
    8. sqrt-unprod24.9%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{\sqrt{eh} \cdot \sqrt{eh}}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{\frac{t}{ew}}}\right| \]
    9. add-sqr-sqrt48.1%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{\color{blue}{eh}}{\frac{\sqrt{1 + \frac{-eh}{\frac{ew}{t}} \cdot \frac{-eh}{\frac{ew}{t}}}}{\frac{t}{ew}}}\right| \]
    10. hypot-1-def56.0%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\color{blue}{\mathsf{hypot}\left(1, \frac{-eh}{\frac{ew}{t}}\right)}}{\frac{t}{ew}}}\right| \]
    11. div-inv56.0%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, \color{blue}{\left(-eh\right) \cdot \frac{1}{\frac{ew}{t}}}\right)}{\frac{t}{ew}}}\right| \]
    12. add-sqr-sqrt28.3%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{-eh} \cdot \sqrt{-eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right)}{\frac{t}{ew}}}\right| \]
    13. sqrt-unprod46.2%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, \color{blue}{\sqrt{\left(-eh\right) \cdot \left(-eh\right)}} \cdot \frac{1}{\frac{ew}{t}}\right)}{\frac{t}{ew}}}\right| \]
    14. sqr-neg46.2%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, \sqrt{\color{blue}{eh \cdot eh}} \cdot \frac{1}{\frac{ew}{t}}\right)}{\frac{t}{ew}}}\right| \]
    15. sqrt-unprod27.6%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, \color{blue}{\left(\sqrt{eh} \cdot \sqrt{eh}\right)} \cdot \frac{1}{\frac{ew}{t}}\right)}{\frac{t}{ew}}}\right| \]
    16. add-sqr-sqrt56.0%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, \color{blue}{eh} \cdot \frac{1}{\frac{ew}{t}}\right)}{\frac{t}{ew}}}\right| \]
    17. clear-num56.0%

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, eh \cdot \color{blue}{\frac{t}{ew}}\right)}{\frac{t}{ew}}}\right| \]
  14. Applied egg-rr56.0%

    \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \color{blue}{\frac{eh}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}{\frac{t}{ew}}}}\right| \]
  15. Final simplification56.0%

    \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \frac{eh}{\frac{\mathsf{hypot}\left(1, eh \cdot \frac{t}{ew}\right)}{\frac{t}{ew}}}\right| \]
  16. Add Preprocessing

Alternative 13: 54.4% accurate, 3.0× speedup?

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

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

    \[\left|\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right| \]
  2. Step-by-step derivation
    1. sub-neg99.8%

      \[\leadsto \left|\color{blue}{\left(ew \cdot \cos t\right) \cdot \cos \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right) + \left(-\left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\frac{\left(-eh\right) \cdot \tan t}{ew}\right)\right)}\right| \]
    2. distribute-rgt-neg-in99.8%

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

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

    \[\leadsto \color{blue}{\left|\cos t \cdot \left(ew \cdot \cos \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right) - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right|} \]
  4. Add Preprocessing
  5. Step-by-step derivation
    1. add-cube-cbrt98.6%

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

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

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

    \[\leadsto \left|\color{blue}{{1}^{0.3333333333333333} \cdot ew} - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
  8. Step-by-step derivation
    1. pow-base-177.6%

      \[\leadsto \left|\color{blue}{1} \cdot ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(\tan t \cdot \frac{eh}{-ew}\right)\right| \]
    2. *-lft-identity77.6%

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

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

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

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

      \[\leadsto \left|ew - \left(eh \cdot \sin t\right) \cdot \sin \tan^{-1} \left(-\color{blue}{\frac{eh}{\frac{ew}{t}}}\right)\right| \]
    3. distribute-neg-frac77.6%

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

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

    \[\leadsto \left|ew - \color{blue}{\left(eh \cdot t\right)} \cdot \sin \tan^{-1} \left(\frac{-eh}{\frac{ew}{t}}\right)\right| \]
  14. Final simplification51.4%

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

Reproduce

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