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

Error

Try it out

Your Program's Arguments

Results

Enter valid numbers for all inputs

Derivation

  1. Initial program 0.1

    \[\left|\left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
  2. Applied egg-rr0.1

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

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

Alternatives

Alternative 1
Error0.2
Cost52480
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{\sin t}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{ew}}\right| \]
Alternative 2
Error0.2
Cost52480
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{eh}{ew \cdot \tan t}\right)}{\sin t}}\right| \]
Alternative 3
Error0.5
Cost52416
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(ew \cdot \sin t\right) \cdot \cos \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right| \]
Alternative 4
Error0.6
Cost46080
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{ew}{\frac{\mathsf{hypot}\left(1, \frac{\frac{eh}{ew}}{t}\right)}{\sin t}}\right| \]
Alternative 5
Error0.9
Cost39232
\[\left|ew \cdot \sin t + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
Alternative 6
Error29.6
Cost33608
\[\begin{array}{l} t_1 := \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ t_2 := \left|t_1 + \frac{ew \cdot t}{eh} \cdot \frac{t}{\frac{1}{ew}}\right|\\ \mathbf{if}\;ew \leq -2.401039687460894 \cdot 10^{+56}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;ew \leq 6.08572972542101 \cdot 10^{-165}:\\ \;\;\;\;\left|t_1 + \frac{t}{\frac{eh}{t \cdot \left(ew \cdot ew\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 7
Error29.7
Cost33480
\[\begin{array}{l} t_1 := \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \mathbf{if}\;ew \leq -1.0215112718678355 \cdot 10^{+98}:\\ \;\;\;\;\left|t_1 + \frac{t \cdot \left(ew \cdot t\right)}{\frac{eh}{ew}}\right|\\ \mathbf{elif}\;ew \leq 6.08572972542101 \cdot 10^{-165}:\\ \;\;\;\;\left|t_1 + \frac{t}{\frac{eh}{t \cdot \left(ew \cdot ew\right)}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 + \left(ew \cdot t\right) \cdot \left(t \cdot \frac{ew}{eh}\right)\right|\\ \end{array} \]
Alternative 8
Error31.0
Cost33348
\[\begin{array}{l} t_1 := \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ \mathbf{if}\;ew \leq -1.0215112718678355 \cdot 10^{+98}:\\ \;\;\;\;\left|t_1 + \frac{t \cdot \left(ew \cdot t\right)}{\frac{eh}{ew}}\right|\\ \mathbf{else}:\\ \;\;\;\;\left|t_1 + t \cdot \left(t \cdot \left(ew \cdot \frac{ew}{eh}\right)\right)\right|\\ \end{array} \]
Alternative 9
Error34.9
Cost33216
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + ew \cdot \frac{t \cdot t}{\frac{eh}{ew}}\right| \]
Alternative 10
Error32.8
Cost33216
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \frac{t \cdot \left(ew \cdot t\right)}{\frac{eh}{ew}}\right| \]
Alternative 11
Error31.4
Cost33216
\[\left|\left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right) + \left(ew \cdot t\right) \cdot \left(t \cdot \frac{ew}{eh}\right)\right| \]
Alternative 12
Error35.3
Cost27080
\[\begin{array}{l} t_1 := \left|\left(t \cdot t\right) \cdot \left(ew \cdot \frac{ew}{eh}\right) + \left(eh \cdot \cos t\right) \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{t}}{ew}\right)\right|\\ \mathbf{if}\;t \leq -599743214284.4546:\\ \;\;\;\;t_1\\ \mathbf{elif}\;t \leq 2.086454824013422 \cdot 10^{-54}:\\ \;\;\;\;\left|\frac{ew \cdot \left(t \cdot t\right)}{\frac{eh}{ew}} + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t_1\\ \end{array} \]
Alternative 13
Error39.3
Cost26952
\[\begin{array}{l} t_1 := eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\\ t_2 := \left|\frac{ew \cdot \left(t \cdot t\right)}{\frac{eh}{ew}} + t_1\right|\\ \mathbf{if}\;ew \leq -2.763104388671107 \cdot 10^{+164}:\\ \;\;\;\;t_2\\ \mathbf{elif}\;ew \leq 6.636034152841054 \cdot 10^{+124}:\\ \;\;\;\;\left|t_1 + t \cdot \left(\left(ew \cdot ew\right) \cdot \frac{t}{eh}\right)\right|\\ \mathbf{else}:\\ \;\;\;\;t_2\\ \end{array} \]
Alternative 14
Error40.0
Cost26688
\[\left|\frac{ew \cdot \left(t \cdot t\right)}{\frac{eh}{ew}} + eh \cdot \sin \tan^{-1} \left(\frac{\frac{eh}{ew}}{\tan t}\right)\right| \]
Alternative 15
Error41.2
Cost20288
\[\left|\left(t \cdot t\right) \cdot \left(ew \cdot \frac{ew}{eh}\right) + eh \cdot \sin \tan^{-1} \left(\frac{eh}{ew \cdot t}\right)\right| \]

Error

Reproduce

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