?

Average Error: 14.0 → 1.6
Time: 24.0s
Precision: binary64
Cost: 13384

?

\[\frac{\sin x \cdot \sinh y}{x} \]
\[\begin{array}{l} t_0 := \frac{\sin x \cdot \sinh y}{x}\\ \mathbf{if}\;x \leq -2.5 \cdot 10^{-78}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.36 \cdot 10^{-100}:\\ \;\;\;\;y + 0.16666666666666666 \cdot {y}^{3}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
(FPCore (x y) :precision binary64 (/ (* (sin x) (sinh y)) x))
(FPCore (x y)
 :precision binary64
 (let* ((t_0 (/ (* (sin x) (sinh y)) x)))
   (if (<= x -2.5e-78)
     t_0
     (if (<= x 1.36e-100) (+ y (* 0.16666666666666666 (pow y 3.0))) t_0))))
double code(double x, double y) {
	return (sin(x) * sinh(y)) / x;
}
double code(double x, double y) {
	double t_0 = (sin(x) * sinh(y)) / x;
	double tmp;
	if (x <= -2.5e-78) {
		tmp = t_0;
	} else if (x <= 1.36e-100) {
		tmp = y + (0.16666666666666666 * pow(y, 3.0));
	} else {
		tmp = t_0;
	}
	return tmp;
}
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = (sin(x) * sinh(y)) / x
end function
real(8) function code(x, y)
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    real(8) :: tmp
    t_0 = (sin(x) * sinh(y)) / x
    if (x <= (-2.5d-78)) then
        tmp = t_0
    else if (x <= 1.36d-100) then
        tmp = y + (0.16666666666666666d0 * (y ** 3.0d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y) {
	return (Math.sin(x) * Math.sinh(y)) / x;
}
public static double code(double x, double y) {
	double t_0 = (Math.sin(x) * Math.sinh(y)) / x;
	double tmp;
	if (x <= -2.5e-78) {
		tmp = t_0;
	} else if (x <= 1.36e-100) {
		tmp = y + (0.16666666666666666 * Math.pow(y, 3.0));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y):
	return (math.sin(x) * math.sinh(y)) / x
def code(x, y):
	t_0 = (math.sin(x) * math.sinh(y)) / x
	tmp = 0
	if x <= -2.5e-78:
		tmp = t_0
	elif x <= 1.36e-100:
		tmp = y + (0.16666666666666666 * math.pow(y, 3.0))
	else:
		tmp = t_0
	return tmp
function code(x, y)
	return Float64(Float64(sin(x) * sinh(y)) / x)
end
function code(x, y)
	t_0 = Float64(Float64(sin(x) * sinh(y)) / x)
	tmp = 0.0
	if (x <= -2.5e-78)
		tmp = t_0;
	elseif (x <= 1.36e-100)
		tmp = Float64(y + Float64(0.16666666666666666 * (y ^ 3.0)));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp = code(x, y)
	tmp = (sin(x) * sinh(y)) / x;
end
function tmp_2 = code(x, y)
	t_0 = (sin(x) * sinh(y)) / x;
	tmp = 0.0;
	if (x <= -2.5e-78)
		tmp = t_0;
	elseif (x <= 1.36e-100)
		tmp = y + (0.16666666666666666 * (y ^ 3.0));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_] := N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Sin[x], $MachinePrecision] * N[Sinh[y], $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]}, If[LessEqual[x, -2.5e-78], t$95$0, If[LessEqual[x, 1.36e-100], N[(y + N[(0.16666666666666666 * N[Power[y, 3.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\frac{\sin x \cdot \sinh y}{x}
\begin{array}{l}
t_0 := \frac{\sin x \cdot \sinh y}{x}\\
\mathbf{if}\;x \leq -2.5 \cdot 10^{-78}:\\
\;\;\;\;t_0\\

\mathbf{elif}\;x \leq 1.36 \cdot 10^{-100}:\\
\;\;\;\;y + 0.16666666666666666 \cdot {y}^{3}\\

\mathbf{else}:\\
\;\;\;\;t_0\\


\end{array}

Error?

Try it out?

Your Program's Arguments

Results

Enter valid numbers for all inputs

Target

Original14.0
Target0.2
Herbie1.6
\[\sin x \cdot \frac{\sinh y}{x} \]

Derivation?

  1. Split input into 2 regimes
  2. if x < -2.4999999999999998e-78 or 1.35999999999999996e-100 < x

    1. Initial program 2.0

      \[\frac{\sin x \cdot \sinh y}{x} \]

    if -2.4999999999999998e-78 < x < 1.35999999999999996e-100

    1. Initial program 36.5

      \[\frac{\sin x \cdot \sinh y}{x} \]
    2. Taylor expanded in y around 0 37.3

      \[\leadsto \frac{\color{blue}{0.16666666666666666 \cdot \left({y}^{3} \cdot \sin x\right) + y \cdot \sin x}}{x} \]
    3. Simplified37.3

      \[\leadsto \frac{\color{blue}{\sin x \cdot \left(y + 0.16666666666666666 \cdot {y}^{3}\right)}}{x} \]
      Proof

      [Start]37.3

      \[ \frac{0.16666666666666666 \cdot \left({y}^{3} \cdot \sin x\right) + y \cdot \sin x}{x} \]

      rational.json-simplify-43 [=>]37.3

      \[ \frac{\color{blue}{{y}^{3} \cdot \left(\sin x \cdot 0.16666666666666666\right)} + y \cdot \sin x}{x} \]

      rational.json-simplify-43 [=>]37.3

      \[ \frac{\color{blue}{\sin x \cdot \left(0.16666666666666666 \cdot {y}^{3}\right)} + y \cdot \sin x}{x} \]

      rational.json-simplify-47 [=>]37.3

      \[ \frac{\color{blue}{\sin x \cdot \left(y + 0.16666666666666666 \cdot {y}^{3}\right)}}{x} \]
    4. Taylor expanded in x around 0 0.8

      \[\leadsto \color{blue}{y + 0.16666666666666666 \cdot {y}^{3}} \]
  3. Recombined 2 regimes into one program.
  4. Final simplification1.6

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -2.5 \cdot 10^{-78}:\\ \;\;\;\;\frac{\sin x \cdot \sinh y}{x}\\ \mathbf{elif}\;x \leq 1.36 \cdot 10^{-100}:\\ \;\;\;\;y + 0.16666666666666666 \cdot {y}^{3}\\ \mathbf{else}:\\ \;\;\;\;\frac{\sin x \cdot \sinh y}{x}\\ \end{array} \]

Alternatives

Alternative 1
Error1.0
Cost7048
\[\begin{array}{l} t_0 := \frac{\sin x \cdot y}{x}\\ \mathbf{if}\;x \leq -2.2 \cdot 10^{-8}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 4 \cdot 10^{-22}:\\ \;\;\;\;y + 0.16666666666666666 \cdot {y}^{3}\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 2
Error1.2
Cost6984
\[\begin{array}{l} t_0 := \frac{\sin x \cdot y}{x}\\ \mathbf{if}\;x \leq -2.15 \cdot 10^{-8}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 2 \cdot 10^{-27}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 3
Error16.2
Cost712
\[\begin{array}{l} t_0 := \left(0 - \left(-1 - y\right)\right) - 1\\ \mathbf{if}\;x \leq -1.25 \cdot 10^{+27}:\\ \;\;\;\;t_0\\ \mathbf{elif}\;x \leq 1.36 \cdot 10^{+41}:\\ \;\;\;\;y\\ \mathbf{else}:\\ \;\;\;\;t_0\\ \end{array} \]
Alternative 4
Error31.0
Cost64
\[y \]

Error

Reproduce?

herbie shell --seed 2023077 
(FPCore (x y)
  :name "Linear.Quaternion:$ccosh from linear-1.19.1.3"
  :precision binary64

  :herbie-target
  (* (sin x) (/ (sinh y) x))

  (/ (* (sin x) (sinh y)) x))