Linear.Quaternion:$ccos from linear-1.19.1.3

Percentage Accurate: 100.0% → 100.0%
Time: 5.1s
Alternatives: 11
Speedup: 1.0×

Specification

?
\[\sin x \cdot \frac{\sinh y}{y} \]
(FPCore (x y)
  :precision binary64
  (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
	return sin(x) * (sinh(y) / y);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
	return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y):
	return math.sin(x) * (math.sinh(y) / y)
function code(x, y)
	return Float64(sin(x) * Float64(sinh(y) / y))
end
function tmp = code(x, y)
	tmp = sin(x) * (sinh(y) / y);
end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\sin x \cdot \frac{\sinh y}{y}

Local Percentage Accuracy vs ?

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

Accuracy vs Speed?

Herbie found 11 alternatives:

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

Initial Program: 100.0% accurate, 1.0× speedup?

\[\sin x \cdot \frac{\sinh y}{y} \]
(FPCore (x y)
  :precision binary64
  (* (sin x) (/ (sinh y) y)))
double code(double x, double y) {
	return sin(x) * (sinh(y) / y);
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sin(x) * (sinh(y) / y)
end function
public static double code(double x, double y) {
	return Math.sin(x) * (Math.sinh(y) / y);
}
def code(x, y):
	return math.sin(x) * (math.sinh(y) / y)
function code(x, y)
	return Float64(sin(x) * Float64(sinh(y) / y))
end
function tmp = code(x, y)
	tmp = sin(x) * (sinh(y) / y);
end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\sin x \cdot \frac{\sinh y}{y}

Alternative 1: 93.5% accurate, 1.3× speedup?

\[\begin{array}{l} t_0 := \left(\left(y \cdot y\right) \cdot y\right) \cdot y\\ \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\right) \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (* (* (* y y) y) y)))
  (*
   (sin x)
   (+ 1.0 (* 0.16666666666666666 (sqrt (sqrt (* t_0 t_0))))))))
double code(double x, double y) {
	double t_0 = ((y * y) * y) * y;
	return sin(x) * (1.0 + (0.16666666666666666 * sqrt(sqrt((t_0 * t_0)))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8) :: t_0
    t_0 = ((y * y) * y) * y
    code = sin(x) * (1.0d0 + (0.16666666666666666d0 * sqrt(sqrt((t_0 * t_0)))))
end function
public static double code(double x, double y) {
	double t_0 = ((y * y) * y) * y;
	return Math.sin(x) * (1.0 + (0.16666666666666666 * Math.sqrt(Math.sqrt((t_0 * t_0)))));
}
def code(x, y):
	t_0 = ((y * y) * y) * y
	return math.sin(x) * (1.0 + (0.16666666666666666 * math.sqrt(math.sqrt((t_0 * t_0)))))
function code(x, y)
	t_0 = Float64(Float64(Float64(y * y) * y) * y)
	return Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * sqrt(sqrt(Float64(t_0 * t_0))))))
end
function tmp = code(x, y)
	t_0 = ((y * y) * y) * y;
	tmp = sin(x) * (1.0 + (0.16666666666666666 * sqrt(sqrt((t_0 * t_0)))));
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision]}, N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[Sqrt[N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
t_0 := \left(\left(y \cdot y\right) \cdot y\right) \cdot y\\
\sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\sqrt{t\_0 \cdot t\_0}}\right)
\end{array}
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \sin x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
  3. Step-by-step derivation
    1. lower-+.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
    2. lower-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
    3. lower-pow.f6475.3%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot {y}^{\color{blue}{2}}\right) \]
  4. Applied rewrites75.3%

    \[\leadsto \sin x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
  5. Step-by-step derivation
    1. rem-square-sqrtN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \left(\sqrt{{y}^{2}} \cdot \color{blue}{\sqrt{{y}^{2}}}\right)\right) \]
    2. sqrt-unprodN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    3. lower-sqrt.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    4. lower-*.f6487.2%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    5. lift-pow.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    6. unpow2N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\left(y \cdot y\right) \cdot {y}^{2}}\right) \]
    7. lower-*.f6487.2%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot {y}^{2}}\right) \]
    8. lift-pow.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\left(y \cdot y\right) \cdot {y}^{2}}\right) \]
    9. unpow2N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) \]
    10. lower-*.f6487.2%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) \]
  6. Applied rewrites87.2%

    \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) \]
  7. Step-by-step derivation
    1. rem-square-sqrtN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)} \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}}\right) \]
    2. sqrt-unprodN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    3. lower-sqrt.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    4. lower-*.f6493.5%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    5. lift-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    6. lift-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    7. associate-*l*N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    8. *-commutativeN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(y \cdot \left(y \cdot y\right)\right) \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    9. lower-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(y \cdot \left(y \cdot y\right)\right) \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    10. *-commutativeN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    11. lower-*.f6493.5%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    12. lift-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    13. lift-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(y \cdot y\right) \cdot \left(y \cdot y\right)\right)}}\right) \]
    14. associate-*l*N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(y \cdot \left(y \cdot \left(y \cdot y\right)\right)\right)}}\right) \]
    15. *-commutativeN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(y \cdot \left(y \cdot y\right)\right) \cdot y\right)}}\right) \]
    16. lower-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(y \cdot \left(y \cdot y\right)\right) \cdot y\right)}}\right) \]
    17. *-commutativeN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right)}}\right) \]
    18. lower-*.f6493.5%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right)}}\right) \]
  8. Applied rewrites93.5%

    \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\sqrt{\left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right)}}\right) \]
  9. Add Preprocessing

Alternative 2: 87.2% accurate, 1.6× speedup?

\[\sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) \]
(FPCore (x y)
  :precision binary64
  (* (sin x) (+ 1.0 (* 0.16666666666666666 (sqrt (* (* y y) (* y y)))))))
double code(double x, double y) {
	return sin(x) * (1.0 + (0.16666666666666666 * sqrt(((y * y) * (y * y)))));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

    interface fmax
        module procedure fmax88
        module procedure fmax44
        module procedure fmax84
        module procedure fmax48
    end interface
    interface fmin
        module procedure fmin88
        module procedure fmin44
        module procedure fmin84
        module procedure fmin48
    end interface
contains
    real(8) function fmax88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(4) function fmax44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, max(x, y), y /= y), x /= x)
    end function
    real(8) function fmax84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmax48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
    end function
    real(8) function fmin88(x, y) result (res)
        real(8), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(4) function fmin44(x, y) result (res)
        real(4), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(y, merge(x, min(x, y), y /= y), x /= x)
    end function
    real(8) function fmin84(x, y) result(res)
        real(8), intent (in) :: x
        real(4), intent (in) :: y
        res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
    end function
    real(8) function fmin48(x, y) result(res)
        real(4), intent (in) :: x
        real(8), intent (in) :: y
        res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
    end function
end module

real(8) function code(x, y)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    code = sin(x) * (1.0d0 + (0.16666666666666666d0 * sqrt(((y * y) * (y * y)))))
end function
public static double code(double x, double y) {
	return Math.sin(x) * (1.0 + (0.16666666666666666 * Math.sqrt(((y * y) * (y * y)))));
}
def code(x, y):
	return math.sin(x) * (1.0 + (0.16666666666666666 * math.sqrt(((y * y) * (y * y)))))
function code(x, y)
	return Float64(sin(x) * Float64(1.0 + Float64(0.16666666666666666 * sqrt(Float64(Float64(y * y) * Float64(y * y))))))
end
function tmp = code(x, y)
	tmp = sin(x) * (1.0 + (0.16666666666666666 * sqrt(((y * y) * (y * y)))));
end
code[x_, y_] := N[(N[Sin[x], $MachinePrecision] * N[(1.0 + N[(0.16666666666666666 * N[Sqrt[N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right)
Derivation
  1. Initial program 100.0%

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

    \[\leadsto \sin x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
  3. Step-by-step derivation
    1. lower-+.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
    2. lower-*.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
    3. lower-pow.f6475.3%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot {y}^{\color{blue}{2}}\right) \]
  4. Applied rewrites75.3%

    \[\leadsto \sin x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
  5. Step-by-step derivation
    1. rem-square-sqrtN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \left(\sqrt{{y}^{2}} \cdot \color{blue}{\sqrt{{y}^{2}}}\right)\right) \]
    2. sqrt-unprodN/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    3. lower-sqrt.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    4. lower-*.f6487.2%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    5. lift-pow.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{{y}^{2} \cdot {y}^{2}}\right) \]
    6. unpow2N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\left(y \cdot y\right) \cdot {y}^{2}}\right) \]
    7. lower-*.f6487.2%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot {y}^{2}}\right) \]
    8. lift-pow.f64N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\left(y \cdot y\right) \cdot {y}^{2}}\right) \]
    9. unpow2N/A

      \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) \]
    10. lower-*.f6487.2%

      \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) \]
  6. Applied rewrites87.2%

    \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot \sqrt{\left(y \cdot y\right) \cdot \left(y \cdot y\right)}\right) \]
  7. Add Preprocessing

Alternative 3: 80.5% accurate, 0.5× speedup?

\[\begin{array}{l} t_0 := \left(y \cdot y\right) \cdot 0.16666666666666666 - -1\\ t_1 := \sin \left(\left|x\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \cdot \frac{\sinh y}{y} \leq -\infty:\\ \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|x\right|\right)}^{2}\right)\right) \cdot t\_0\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot t\_0\\ \end{array} \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (- (* (* y y) 0.16666666666666666) -1.0))
       (t_1 (sin (fabs x))))
  (*
   (copysign 1.0 x)
   (if (<= (* t_1 (/ (sinh y) y)) (- INFINITY))
     (*
      (* (fabs x) (+ 1.0 (* -0.16666666666666666 (pow (fabs x) 2.0))))
      t_0)
     (* t_1 t_0)))))
double code(double x, double y) {
	double t_0 = ((y * y) * 0.16666666666666666) - -1.0;
	double t_1 = sin(fabs(x));
	double tmp;
	if ((t_1 * (sinh(y) / y)) <= -((double) INFINITY)) {
		tmp = (fabs(x) * (1.0 + (-0.16666666666666666 * pow(fabs(x), 2.0)))) * t_0;
	} else {
		tmp = t_1 * t_0;
	}
	return copysign(1.0, x) * tmp;
}
public static double code(double x, double y) {
	double t_0 = ((y * y) * 0.16666666666666666) - -1.0;
	double t_1 = Math.sin(Math.abs(x));
	double tmp;
	if ((t_1 * (Math.sinh(y) / y)) <= -Double.POSITIVE_INFINITY) {
		tmp = (Math.abs(x) * (1.0 + (-0.16666666666666666 * Math.pow(Math.abs(x), 2.0)))) * t_0;
	} else {
		tmp = t_1 * t_0;
	}
	return Math.copySign(1.0, x) * tmp;
}
def code(x, y):
	t_0 = ((y * y) * 0.16666666666666666) - -1.0
	t_1 = math.sin(math.fabs(x))
	tmp = 0
	if (t_1 * (math.sinh(y) / y)) <= -math.inf:
		tmp = (math.fabs(x) * (1.0 + (-0.16666666666666666 * math.pow(math.fabs(x), 2.0)))) * t_0
	else:
		tmp = t_1 * t_0
	return math.copysign(1.0, x) * tmp
function code(x, y)
	t_0 = Float64(Float64(Float64(y * y) * 0.16666666666666666) - -1.0)
	t_1 = sin(abs(x))
	tmp = 0.0
	if (Float64(t_1 * Float64(sinh(y) / y)) <= Float64(-Inf))
		tmp = Float64(Float64(abs(x) * Float64(1.0 + Float64(-0.16666666666666666 * (abs(x) ^ 2.0)))) * t_0);
	else
		tmp = Float64(t_1 * t_0);
	end
	return Float64(copysign(1.0, x) * tmp)
end
function tmp_2 = code(x, y)
	t_0 = ((y * y) * 0.16666666666666666) - -1.0;
	t_1 = sin(abs(x));
	tmp = 0.0;
	if ((t_1 * (sinh(y) / y)) <= -Inf)
		tmp = (abs(x) * (1.0 + (-0.16666666666666666 * (abs(x) ^ 2.0)))) * t_0;
	else
		tmp = t_1 * t_0;
	end
	tmp_2 = (sign(x) * abs(1.0)) * tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - -1.0), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(t$95$1 * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(N[Abs[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Power[N[Abs[x], $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * t$95$0), $MachinePrecision], N[(t$95$1 * t$95$0), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left(y \cdot y\right) \cdot 0.16666666666666666 - -1\\
t_1 := \sin \left(\left|x\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \cdot \frac{\sinh y}{y} \leq -\infty:\\
\;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot {\left(\left|x\right|\right)}^{2}\right)\right) \cdot t\_0\\

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

    1. Initial program 100.0%

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

      \[\leadsto \sin x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
      3. lower-pow.f6475.3%

        \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot {y}^{\color{blue}{2}}\right) \]
    4. Applied rewrites75.3%

      \[\leadsto \sin x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. +-commutativeN/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
      3. add-flipN/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
      5. lower--.f6475.3%

        \[\leadsto \sin x \cdot \left(0.16666666666666666 \cdot {y}^{2} - \color{blue}{-1}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
      7. *-commutativeN/A

        \[\leadsto \sin x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
      8. lower-*.f6475.3%

        \[\leadsto \sin x \cdot \left({y}^{2} \cdot 0.16666666666666666 - -1\right) \]
      9. lift-pow.f64N/A

        \[\leadsto \sin x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
      10. unpow2N/A

        \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      11. lower-*.f6475.3%

        \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right) \]
    6. Applied rewrites75.3%

      \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - \color{blue}{-1}\right) \]
    7. Taylor expanded in x around 0

      \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right) \]
    8. Step-by-step derivation
      1. lower-*.f64N/A

        \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      2. lower-+.f64N/A

        \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      3. lower-*.f64N/A

        \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      4. lower-pow.f6449.7%

        \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right) \]
    9. Applied rewrites49.7%

      \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right) \]

    if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

    1. Initial program 100.0%

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

      \[\leadsto \sin x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
    3. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
      3. lower-pow.f6475.3%

        \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot {y}^{\color{blue}{2}}\right) \]
    4. Applied rewrites75.3%

      \[\leadsto \sin x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
    5. Step-by-step derivation
      1. lift-+.f64N/A

        \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
      2. +-commutativeN/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
      3. add-flipN/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
      4. metadata-evalN/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
      5. lower--.f6475.3%

        \[\leadsto \sin x \cdot \left(0.16666666666666666 \cdot {y}^{2} - \color{blue}{-1}\right) \]
      6. lift-*.f64N/A

        \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
      7. *-commutativeN/A

        \[\leadsto \sin x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
      8. lower-*.f6475.3%

        \[\leadsto \sin x \cdot \left({y}^{2} \cdot 0.16666666666666666 - -1\right) \]
      9. lift-pow.f64N/A

        \[\leadsto \sin x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
      10. unpow2N/A

        \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
      11. lower-*.f6475.3%

        \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right) \]
    6. Applied rewrites75.3%

      \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - \color{blue}{-1}\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 78.6% accurate, 0.5× speedup?

\[\begin{array}{l} t_0 := \left|x\right| \cdot \left|x\right|\\ t_1 := \sin \left(\left|x\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \cdot \frac{\sinh y}{y} \leq -\infty:\\ \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right)\\ \end{array} \end{array} \]
(FPCore (x y)
  :precision binary64
  (let* ((t_0 (* (fabs x) (fabs x))) (t_1 (sin (fabs x))))
  (*
   (copysign 1.0 x)
   (if (<= (* t_1 (/ (sinh y) y)) (- INFINITY))
     (*
      (* (fabs x) (+ 1.0 (* -0.16666666666666666 (sqrt (* t_0 t_0)))))
      1.0)
     (* t_1 (- (* (* y y) 0.16666666666666666) -1.0))))))
double code(double x, double y) {
	double t_0 = fabs(x) * fabs(x);
	double t_1 = sin(fabs(x));
	double tmp;
	if ((t_1 * (sinh(y) / y)) <= -((double) INFINITY)) {
		tmp = (fabs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
	} else {
		tmp = t_1 * (((y * y) * 0.16666666666666666) - -1.0);
	}
	return copysign(1.0, x) * tmp;
}
public static double code(double x, double y) {
	double t_0 = Math.abs(x) * Math.abs(x);
	double t_1 = Math.sin(Math.abs(x));
	double tmp;
	if ((t_1 * (Math.sinh(y) / y)) <= -Double.POSITIVE_INFINITY) {
		tmp = (Math.abs(x) * (1.0 + (-0.16666666666666666 * Math.sqrt((t_0 * t_0))))) * 1.0;
	} else {
		tmp = t_1 * (((y * y) * 0.16666666666666666) - -1.0);
	}
	return Math.copySign(1.0, x) * tmp;
}
def code(x, y):
	t_0 = math.fabs(x) * math.fabs(x)
	t_1 = math.sin(math.fabs(x))
	tmp = 0
	if (t_1 * (math.sinh(y) / y)) <= -math.inf:
		tmp = (math.fabs(x) * (1.0 + (-0.16666666666666666 * math.sqrt((t_0 * t_0))))) * 1.0
	else:
		tmp = t_1 * (((y * y) * 0.16666666666666666) - -1.0)
	return math.copysign(1.0, x) * tmp
function code(x, y)
	t_0 = Float64(abs(x) * abs(x))
	t_1 = sin(abs(x))
	tmp = 0.0
	if (Float64(t_1 * Float64(sinh(y) / y)) <= Float64(-Inf))
		tmp = Float64(Float64(abs(x) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(t_0 * t_0))))) * 1.0);
	else
		tmp = Float64(t_1 * Float64(Float64(Float64(y * y) * 0.16666666666666666) - -1.0));
	end
	return Float64(copysign(1.0, x) * tmp)
end
function tmp_2 = code(x, y)
	t_0 = abs(x) * abs(x);
	t_1 = sin(abs(x));
	tmp = 0.0;
	if ((t_1 * (sinh(y) / y)) <= -Inf)
		tmp = (abs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
	else
		tmp = t_1 * (((y * y) * 0.16666666666666666) - -1.0);
	end
	tmp_2 = (sign(x) * abs(1.0)) * tmp;
end
code[x_, y_] := Block[{t$95$0 = N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(t$95$1 * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(N[Abs[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(t$95$1 * N[(N[(N[(y * y), $MachinePrecision] * 0.16666666666666666), $MachinePrecision] - -1.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \left|x\right| \cdot \left|x\right|\\
t_1 := \sin \left(\left|x\right|\right)\\
\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
\mathbf{if}\;t\_1 \cdot \frac{\sinh y}{y} \leq -\infty:\\
\;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\

\mathbf{else}:\\
\;\;\;\;t\_1 \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

    1. Initial program 100.0%

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

      \[\leadsto \sin x \cdot \color{blue}{1} \]
    3. Step-by-step derivation
      1. Applied rewrites50.0%

        \[\leadsto \sin x \cdot \color{blue}{1} \]
      2. Taylor expanded in x around 0

        \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot 1 \]
      3. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
        2. lower-+.f64N/A

          \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
        3. lower-*.f64N/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot 1 \]
        4. lower-pow.f6433.8%

          \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot 1 \]
      4. Applied rewrites33.8%

        \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot 1 \]
      5. Step-by-step derivation
        1. rem-square-sqrtN/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right)\right) \cdot 1 \]
        2. sqrt-unprodN/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
        3. lower-sqrt.f64N/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
        4. lower-*.f6434.8%

          \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
        5. lift-pow.f64N/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
        6. unpow2N/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
        7. lower-*.f6434.8%

          \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
        8. lift-pow.f64N/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
        9. unpow2N/A

          \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
        10. lower-*.f6434.8%

          \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
      6. Applied rewrites34.8%

        \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]

      if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

      1. Initial program 100.0%

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

        \[\leadsto \sin x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
      3. Step-by-step derivation
        1. lower-+.f64N/A

          \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
        2. lower-*.f64N/A

          \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
        3. lower-pow.f6475.3%

          \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot {y}^{\color{blue}{2}}\right) \]
      4. Applied rewrites75.3%

        \[\leadsto \sin x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
      5. Step-by-step derivation
        1. lift-+.f64N/A

          \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
        2. +-commutativeN/A

          \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} + \color{blue}{1}\right) \]
        3. add-flipN/A

          \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - \color{blue}{\left(\mathsf{neg}\left(1\right)\right)}\right) \]
        4. metadata-evalN/A

          \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
        5. lower--.f6475.3%

          \[\leadsto \sin x \cdot \left(0.16666666666666666 \cdot {y}^{2} - \color{blue}{-1}\right) \]
        6. lift-*.f64N/A

          \[\leadsto \sin x \cdot \left(\frac{1}{6} \cdot {y}^{2} - -1\right) \]
        7. *-commutativeN/A

          \[\leadsto \sin x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
        8. lower-*.f6475.3%

          \[\leadsto \sin x \cdot \left({y}^{2} \cdot 0.16666666666666666 - -1\right) \]
        9. lift-pow.f64N/A

          \[\leadsto \sin x \cdot \left({y}^{2} \cdot \frac{1}{6} - -1\right) \]
        10. unpow2N/A

          \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot \frac{1}{6} - -1\right) \]
        11. lower-*.f6475.3%

          \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - -1\right) \]
      6. Applied rewrites75.3%

        \[\leadsto \sin x \cdot \left(\left(y \cdot y\right) \cdot 0.16666666666666666 - \color{blue}{-1}\right) \]
    4. Recombined 2 regimes into one program.
    5. Add Preprocessing

    Alternative 5: 78.5% accurate, 0.5× speedup?

    \[\begin{array}{l} t_0 := \left|x\right| \cdot \left|x\right|\\ t_1 := \sin \left(\left|x\right|\right)\\ \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;t\_1 \cdot \frac{\sinh y}{y} \leq -\infty:\\ \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;t\_1 \cdot \left(1 + \left(0.16666666666666666 \cdot y\right) \cdot y\right)\\ \end{array} \end{array} \]
    (FPCore (x y)
      :precision binary64
      (let* ((t_0 (* (fabs x) (fabs x))) (t_1 (sin (fabs x))))
      (*
       (copysign 1.0 x)
       (if (<= (* t_1 (/ (sinh y) y)) (- INFINITY))
         (*
          (* (fabs x) (+ 1.0 (* -0.16666666666666666 (sqrt (* t_0 t_0)))))
          1.0)
         (* t_1 (+ 1.0 (* (* 0.16666666666666666 y) y)))))))
    double code(double x, double y) {
    	double t_0 = fabs(x) * fabs(x);
    	double t_1 = sin(fabs(x));
    	double tmp;
    	if ((t_1 * (sinh(y) / y)) <= -((double) INFINITY)) {
    		tmp = (fabs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
    	} else {
    		tmp = t_1 * (1.0 + ((0.16666666666666666 * y) * y));
    	}
    	return copysign(1.0, x) * tmp;
    }
    
    public static double code(double x, double y) {
    	double t_0 = Math.abs(x) * Math.abs(x);
    	double t_1 = Math.sin(Math.abs(x));
    	double tmp;
    	if ((t_1 * (Math.sinh(y) / y)) <= -Double.POSITIVE_INFINITY) {
    		tmp = (Math.abs(x) * (1.0 + (-0.16666666666666666 * Math.sqrt((t_0 * t_0))))) * 1.0;
    	} else {
    		tmp = t_1 * (1.0 + ((0.16666666666666666 * y) * y));
    	}
    	return Math.copySign(1.0, x) * tmp;
    }
    
    def code(x, y):
    	t_0 = math.fabs(x) * math.fabs(x)
    	t_1 = math.sin(math.fabs(x))
    	tmp = 0
    	if (t_1 * (math.sinh(y) / y)) <= -math.inf:
    		tmp = (math.fabs(x) * (1.0 + (-0.16666666666666666 * math.sqrt((t_0 * t_0))))) * 1.0
    	else:
    		tmp = t_1 * (1.0 + ((0.16666666666666666 * y) * y))
    	return math.copysign(1.0, x) * tmp
    
    function code(x, y)
    	t_0 = Float64(abs(x) * abs(x))
    	t_1 = sin(abs(x))
    	tmp = 0.0
    	if (Float64(t_1 * Float64(sinh(y) / y)) <= Float64(-Inf))
    		tmp = Float64(Float64(abs(x) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(t_0 * t_0))))) * 1.0);
    	else
    		tmp = Float64(t_1 * Float64(1.0 + Float64(Float64(0.16666666666666666 * y) * y)));
    	end
    	return Float64(copysign(1.0, x) * tmp)
    end
    
    function tmp_2 = code(x, y)
    	t_0 = abs(x) * abs(x);
    	t_1 = sin(abs(x));
    	tmp = 0.0;
    	if ((t_1 * (sinh(y) / y)) <= -Inf)
    		tmp = (abs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
    	else
    		tmp = t_1 * (1.0 + ((0.16666666666666666 * y) * y));
    	end
    	tmp_2 = (sign(x) * abs(1.0)) * tmp;
    end
    
    code[x_, y_] := Block[{t$95$0 = N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(t$95$1 * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], (-Infinity)], N[(N[(N[Abs[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(t$95$1 * N[(1.0 + N[(N[(0.16666666666666666 * y), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]]
    
    \begin{array}{l}
    t_0 := \left|x\right| \cdot \left|x\right|\\
    t_1 := \sin \left(\left|x\right|\right)\\
    \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
    \mathbf{if}\;t\_1 \cdot \frac{\sinh y}{y} \leq -\infty:\\
    \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\
    
    \mathbf{else}:\\
    \;\;\;\;t\_1 \cdot \left(1 + \left(0.16666666666666666 \cdot y\right) \cdot y\right)\\
    
    
    \end{array}
    \end{array}
    
    Derivation
    1. Split input into 2 regimes
    2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

      1. Initial program 100.0%

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

        \[\leadsto \sin x \cdot \color{blue}{1} \]
      3. Step-by-step derivation
        1. Applied rewrites50.0%

          \[\leadsto \sin x \cdot \color{blue}{1} \]
        2. Taylor expanded in x around 0

          \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot 1 \]
        3. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
          2. lower-+.f64N/A

            \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
          3. lower-*.f64N/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot 1 \]
          4. lower-pow.f6433.8%

            \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot 1 \]
        4. Applied rewrites33.8%

          \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot 1 \]
        5. Step-by-step derivation
          1. rem-square-sqrtN/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right)\right) \cdot 1 \]
          2. sqrt-unprodN/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
          3. lower-sqrt.f64N/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
          4. lower-*.f6434.8%

            \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
          5. lift-pow.f64N/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
          6. unpow2N/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
          7. lower-*.f6434.8%

            \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
          8. lift-pow.f64N/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
          9. unpow2N/A

            \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
          10. lower-*.f6434.8%

            \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
        6. Applied rewrites34.8%

          \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]

        if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

        1. Initial program 100.0%

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

          \[\leadsto \sin x \cdot \color{blue}{\left(1 + \frac{1}{6} \cdot {y}^{2}\right)} \]
        3. Step-by-step derivation
          1. lower-+.f64N/A

            \[\leadsto \sin x \cdot \left(1 + \color{blue}{\frac{1}{6} \cdot {y}^{2}}\right) \]
          2. lower-*.f64N/A

            \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
          3. lower-pow.f6475.3%

            \[\leadsto \sin x \cdot \left(1 + 0.16666666666666666 \cdot {y}^{\color{blue}{2}}\right) \]
        4. Applied rewrites75.3%

          \[\leadsto \sin x \cdot \color{blue}{\left(1 + 0.16666666666666666 \cdot {y}^{2}\right)} \]
        5. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \color{blue}{{y}^{2}}\right) \]
          2. lift-pow.f64N/A

            \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot {y}^{\color{blue}{2}}\right) \]
          3. unpow2N/A

            \[\leadsto \sin x \cdot \left(1 + \frac{1}{6} \cdot \left(y \cdot \color{blue}{y}\right)\right) \]
          4. associate-*r*N/A

            \[\leadsto \sin x \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot \color{blue}{y}\right) \]
          5. lower-*.f64N/A

            \[\leadsto \sin x \cdot \left(1 + \left(\frac{1}{6} \cdot y\right) \cdot \color{blue}{y}\right) \]
          6. lower-*.f6475.3%

            \[\leadsto \sin x \cdot \left(1 + \left(0.16666666666666666 \cdot y\right) \cdot y\right) \]
        6. Applied rewrites75.3%

          \[\leadsto \sin x \cdot \left(1 + \left(0.16666666666666666 \cdot y\right) \cdot \color{blue}{y}\right) \]
      4. Recombined 2 regimes into one program.
      5. Add Preprocessing

      Alternative 6: 65.5% accurate, 0.3× speedup?

      \[\begin{array}{l} t_0 := \left|x\right| \cdot \left|x\right|\\ t_1 := \sin \left(\left|x\right|\right)\\ t_2 := t\_1 \cdot \frac{\sinh y}{y}\\ \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;t\_2 \leq -\infty:\\ \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\ \mathbf{elif}\;t\_2 \leq 1:\\ \;\;\;\;t\_1 \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\ \end{array} \end{array} \]
      (FPCore (x y)
        :precision binary64
        (let* ((t_0 (* (fabs x) (fabs x)))
             (t_1 (sin (fabs x)))
             (t_2 (* t_1 (/ (sinh y) y))))
        (*
         (copysign 1.0 x)
         (if (<= t_2 (- INFINITY))
           (*
            (* (fabs x) (+ 1.0 (* -0.16666666666666666 (sqrt (* t_0 t_0)))))
            1.0)
           (if (<= t_2 1.0) (* t_1 1.0) (/ (* (fabs x) y) y))))))
      double code(double x, double y) {
      	double t_0 = fabs(x) * fabs(x);
      	double t_1 = sin(fabs(x));
      	double t_2 = t_1 * (sinh(y) / y);
      	double tmp;
      	if (t_2 <= -((double) INFINITY)) {
      		tmp = (fabs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
      	} else if (t_2 <= 1.0) {
      		tmp = t_1 * 1.0;
      	} else {
      		tmp = (fabs(x) * y) / y;
      	}
      	return copysign(1.0, x) * tmp;
      }
      
      public static double code(double x, double y) {
      	double t_0 = Math.abs(x) * Math.abs(x);
      	double t_1 = Math.sin(Math.abs(x));
      	double t_2 = t_1 * (Math.sinh(y) / y);
      	double tmp;
      	if (t_2 <= -Double.POSITIVE_INFINITY) {
      		tmp = (Math.abs(x) * (1.0 + (-0.16666666666666666 * Math.sqrt((t_0 * t_0))))) * 1.0;
      	} else if (t_2 <= 1.0) {
      		tmp = t_1 * 1.0;
      	} else {
      		tmp = (Math.abs(x) * y) / y;
      	}
      	return Math.copySign(1.0, x) * tmp;
      }
      
      def code(x, y):
      	t_0 = math.fabs(x) * math.fabs(x)
      	t_1 = math.sin(math.fabs(x))
      	t_2 = t_1 * (math.sinh(y) / y)
      	tmp = 0
      	if t_2 <= -math.inf:
      		tmp = (math.fabs(x) * (1.0 + (-0.16666666666666666 * math.sqrt((t_0 * t_0))))) * 1.0
      	elif t_2 <= 1.0:
      		tmp = t_1 * 1.0
      	else:
      		tmp = (math.fabs(x) * y) / y
      	return math.copysign(1.0, x) * tmp
      
      function code(x, y)
      	t_0 = Float64(abs(x) * abs(x))
      	t_1 = sin(abs(x))
      	t_2 = Float64(t_1 * Float64(sinh(y) / y))
      	tmp = 0.0
      	if (t_2 <= Float64(-Inf))
      		tmp = Float64(Float64(abs(x) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(t_0 * t_0))))) * 1.0);
      	elseif (t_2 <= 1.0)
      		tmp = Float64(t_1 * 1.0);
      	else
      		tmp = Float64(Float64(abs(x) * y) / y);
      	end
      	return Float64(copysign(1.0, x) * tmp)
      end
      
      function tmp_2 = code(x, y)
      	t_0 = abs(x) * abs(x);
      	t_1 = sin(abs(x));
      	t_2 = t_1 * (sinh(y) / y);
      	tmp = 0.0;
      	if (t_2 <= -Inf)
      		tmp = (abs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
      	elseif (t_2 <= 1.0)
      		tmp = t_1 * 1.0;
      	else
      		tmp = (abs(x) * y) / y;
      	end
      	tmp_2 = (sign(x) * abs(1.0)) * tmp;
      end
      
      code[x_, y_] := Block[{t$95$0 = N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$1 * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[t$95$2, (-Infinity)], N[(N[(N[Abs[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], If[LessEqual[t$95$2, 1.0], N[(t$95$1 * 1.0), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision]]]), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \left|x\right| \cdot \left|x\right|\\
      t_1 := \sin \left(\left|x\right|\right)\\
      t_2 := t\_1 \cdot \frac{\sinh y}{y}\\
      \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
      \mathbf{if}\;t\_2 \leq -\infty:\\
      \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\
      
      \mathbf{elif}\;t\_2 \leq 1:\\
      \;\;\;\;t\_1 \cdot 1\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\
      
      
      \end{array}
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < -inf.0

        1. Initial program 100.0%

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

          \[\leadsto \sin x \cdot \color{blue}{1} \]
        3. Step-by-step derivation
          1. Applied rewrites50.0%

            \[\leadsto \sin x \cdot \color{blue}{1} \]
          2. Taylor expanded in x around 0

            \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot 1 \]
          3. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
            2. lower-+.f64N/A

              \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
            3. lower-*.f64N/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot 1 \]
            4. lower-pow.f6433.8%

              \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot 1 \]
          4. Applied rewrites33.8%

            \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot 1 \]
          5. Step-by-step derivation
            1. rem-square-sqrtN/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right)\right) \cdot 1 \]
            2. sqrt-unprodN/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
            3. lower-sqrt.f64N/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
            4. lower-*.f6434.8%

              \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
            5. lift-pow.f64N/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
            6. unpow2N/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
            7. lower-*.f6434.8%

              \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
            8. lift-pow.f64N/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
            9. unpow2N/A

              \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
            10. lower-*.f6434.8%

              \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
          6. Applied rewrites34.8%

            \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]

          if -inf.0 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 1

          1. Initial program 100.0%

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

            \[\leadsto \sin x \cdot \color{blue}{1} \]
          3. Step-by-step derivation
            1. Applied rewrites50.0%

              \[\leadsto \sin x \cdot \color{blue}{1} \]

            if 1 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

            1. Initial program 100.0%

              \[\sin x \cdot \frac{\sinh y}{y} \]
            2. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
              2. lift-/.f64N/A

                \[\leadsto \sin x \cdot \color{blue}{\frac{\sinh y}{y}} \]
              3. associate-*r/N/A

                \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
              4. lower-/.f64N/A

                \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
              5. *-commutativeN/A

                \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
              6. lower-*.f6489.0%

                \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
            3. Applied rewrites89.0%

              \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
            4. Taylor expanded in y around 0

              \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
            5. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{y} \]
              2. lower-sin.f6439.0%

                \[\leadsto \frac{y \cdot \sin x}{y} \]
            6. Applied rewrites39.0%

              \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
            7. Taylor expanded in x around 0

              \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
            8. Step-by-step derivation
              1. lower-*.f6420.5%

                \[\leadsto \frac{x \cdot y}{y} \]
            9. Applied rewrites20.5%

              \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
          4. Recombined 3 regimes into one program.
          5. Add Preprocessing

          Alternative 7: 41.8% accurate, 0.6× speedup?

          \[\begin{array}{l} t_0 := \left|x\right| \cdot \left|x\right|\\ \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;\sin \left(\left|x\right|\right) \cdot \frac{\sinh y}{y} \leq 0.002:\\ \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\ \end{array} \end{array} \]
          (FPCore (x y)
            :precision binary64
            (let* ((t_0 (* (fabs x) (fabs x))))
            (*
             (copysign 1.0 x)
             (if (<= (* (sin (fabs x)) (/ (sinh y) y)) 0.002)
               (*
                (* (fabs x) (+ 1.0 (* -0.16666666666666666 (sqrt (* t_0 t_0)))))
                1.0)
               (/ (* (fabs x) y) y)))))
          double code(double x, double y) {
          	double t_0 = fabs(x) * fabs(x);
          	double tmp;
          	if ((sin(fabs(x)) * (sinh(y) / y)) <= 0.002) {
          		tmp = (fabs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
          	} else {
          		tmp = (fabs(x) * y) / y;
          	}
          	return copysign(1.0, x) * tmp;
          }
          
          public static double code(double x, double y) {
          	double t_0 = Math.abs(x) * Math.abs(x);
          	double tmp;
          	if ((Math.sin(Math.abs(x)) * (Math.sinh(y) / y)) <= 0.002) {
          		tmp = (Math.abs(x) * (1.0 + (-0.16666666666666666 * Math.sqrt((t_0 * t_0))))) * 1.0;
          	} else {
          		tmp = (Math.abs(x) * y) / y;
          	}
          	return Math.copySign(1.0, x) * tmp;
          }
          
          def code(x, y):
          	t_0 = math.fabs(x) * math.fabs(x)
          	tmp = 0
          	if (math.sin(math.fabs(x)) * (math.sinh(y) / y)) <= 0.002:
          		tmp = (math.fabs(x) * (1.0 + (-0.16666666666666666 * math.sqrt((t_0 * t_0))))) * 1.0
          	else:
          		tmp = (math.fabs(x) * y) / y
          	return math.copysign(1.0, x) * tmp
          
          function code(x, y)
          	t_0 = Float64(abs(x) * abs(x))
          	tmp = 0.0
          	if (Float64(sin(abs(x)) * Float64(sinh(y) / y)) <= 0.002)
          		tmp = Float64(Float64(abs(x) * Float64(1.0 + Float64(-0.16666666666666666 * sqrt(Float64(t_0 * t_0))))) * 1.0);
          	else
          		tmp = Float64(Float64(abs(x) * y) / y);
          	end
          	return Float64(copysign(1.0, x) * tmp)
          end
          
          function tmp_2 = code(x, y)
          	t_0 = abs(x) * abs(x);
          	tmp = 0.0;
          	if ((sin(abs(x)) * (sinh(y) / y)) <= 0.002)
          		tmp = (abs(x) * (1.0 + (-0.16666666666666666 * sqrt((t_0 * t_0))))) * 1.0;
          	else
          		tmp = (abs(x) * y) / y;
          	end
          	tmp_2 = (sign(x) * abs(1.0)) * tmp;
          end
          
          code[x_, y_] := Block[{t$95$0 = N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 0.002], N[(N[(N[Abs[x], $MachinePrecision] * N[(1.0 + N[(-0.16666666666666666 * N[Sqrt[N[(t$95$0 * t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]]
          
          \begin{array}{l}
          t_0 := \left|x\right| \cdot \left|x\right|\\
          \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
          \mathbf{if}\;\sin \left(\left|x\right|\right) \cdot \frac{\sinh y}{y} \leq 0.002:\\
          \;\;\;\;\left(\left|x\right| \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{t\_0 \cdot t\_0}\right)\right) \cdot 1\\
          
          \mathbf{else}:\\
          \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\
          
          
          \end{array}
          \end{array}
          
          Derivation
          1. Split input into 2 regimes
          2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 2e-3

            1. Initial program 100.0%

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

              \[\leadsto \sin x \cdot \color{blue}{1} \]
            3. Step-by-step derivation
              1. Applied rewrites50.0%

                \[\leadsto \sin x \cdot \color{blue}{1} \]
              2. Taylor expanded in x around 0

                \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot 1 \]
              3. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
                2. lower-+.f64N/A

                  \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                3. lower-*.f64N/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot 1 \]
                4. lower-pow.f6433.8%

                  \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot 1 \]
              4. Applied rewrites33.8%

                \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot 1 \]
              5. Step-by-step derivation
                1. rem-square-sqrtN/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \left(\sqrt{{x}^{2}} \cdot \color{blue}{\sqrt{{x}^{2}}}\right)\right)\right) \cdot 1 \]
                2. sqrt-unprodN/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                3. lower-sqrt.f64N/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                4. lower-*.f6434.8%

                  \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                5. lift-pow.f64N/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{{x}^{2} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                6. unpow2N/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
                7. lower-*.f6434.8%

                  \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
                8. lift-pow.f64N/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot {x}^{2}}\right)\right) \cdot 1 \]
                9. unpow2N/A

                  \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
                10. lower-*.f6434.8%

                  \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]
              6. Applied rewrites34.8%

                \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot \sqrt{\left(x \cdot x\right) \cdot \left(x \cdot x\right)}\right)\right) \cdot 1 \]

              if 2e-3 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

              1. Initial program 100.0%

                \[\sin x \cdot \frac{\sinh y}{y} \]
              2. Step-by-step derivation
                1. lift-*.f64N/A

                  \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
                2. lift-/.f64N/A

                  \[\leadsto \sin x \cdot \color{blue}{\frac{\sinh y}{y}} \]
                3. associate-*r/N/A

                  \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
                4. lower-/.f64N/A

                  \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
                5. *-commutativeN/A

                  \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
                6. lower-*.f6489.0%

                  \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
              3. Applied rewrites89.0%

                \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
              4. Taylor expanded in y around 0

                \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
              5. Step-by-step derivation
                1. lower-*.f64N/A

                  \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{y} \]
                2. lower-sin.f6439.0%

                  \[\leadsto \frac{y \cdot \sin x}{y} \]
              6. Applied rewrites39.0%

                \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
              7. Taylor expanded in x around 0

                \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
              8. Step-by-step derivation
                1. lower-*.f6420.5%

                  \[\leadsto \frac{x \cdot y}{y} \]
              9. Applied rewrites20.5%

                \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
            4. Recombined 2 regimes into one program.
            5. Add Preprocessing

            Alternative 8: 40.8% accurate, 0.6× speedup?

            \[\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;\sin \left(\left|x\right|\right) \cdot \frac{\sinh y}{y} \leq 0.002:\\ \;\;\;\;\left(\left|x\right| - \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot 0.16666666666666666\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\ \end{array} \]
            (FPCore (x y)
              :precision binary64
              (*
             (copysign 1.0 x)
             (if (<= (* (sin (fabs x)) (/ (sinh y) y)) 0.002)
               (*
                (-
                 (fabs x)
                 (* (* (* (fabs x) (fabs x)) (fabs x)) 0.16666666666666666))
                1.0)
               (/ (* (fabs x) y) y))))
            double code(double x, double y) {
            	double tmp;
            	if ((sin(fabs(x)) * (sinh(y) / y)) <= 0.002) {
            		tmp = (fabs(x) - (((fabs(x) * fabs(x)) * fabs(x)) * 0.16666666666666666)) * 1.0;
            	} else {
            		tmp = (fabs(x) * y) / y;
            	}
            	return copysign(1.0, x) * tmp;
            }
            
            public static double code(double x, double y) {
            	double tmp;
            	if ((Math.sin(Math.abs(x)) * (Math.sinh(y) / y)) <= 0.002) {
            		tmp = (Math.abs(x) - (((Math.abs(x) * Math.abs(x)) * Math.abs(x)) * 0.16666666666666666)) * 1.0;
            	} else {
            		tmp = (Math.abs(x) * y) / y;
            	}
            	return Math.copySign(1.0, x) * tmp;
            }
            
            def code(x, y):
            	tmp = 0
            	if (math.sin(math.fabs(x)) * (math.sinh(y) / y)) <= 0.002:
            		tmp = (math.fabs(x) - (((math.fabs(x) * math.fabs(x)) * math.fabs(x)) * 0.16666666666666666)) * 1.0
            	else:
            		tmp = (math.fabs(x) * y) / y
            	return math.copysign(1.0, x) * tmp
            
            function code(x, y)
            	tmp = 0.0
            	if (Float64(sin(abs(x)) * Float64(sinh(y) / y)) <= 0.002)
            		tmp = Float64(Float64(abs(x) - Float64(Float64(Float64(abs(x) * abs(x)) * abs(x)) * 0.16666666666666666)) * 1.0);
            	else
            		tmp = Float64(Float64(abs(x) * y) / y);
            	end
            	return Float64(copysign(1.0, x) * tmp)
            end
            
            function tmp_2 = code(x, y)
            	tmp = 0.0;
            	if ((sin(abs(x)) * (sinh(y) / y)) <= 0.002)
            		tmp = (abs(x) - (((abs(x) * abs(x)) * abs(x)) * 0.16666666666666666)) * 1.0;
            	else
            		tmp = (abs(x) * y) / y;
            	end
            	tmp_2 = (sign(x) * abs(1.0)) * tmp;
            end
            
            code[x_, y_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[(N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision] * N[(N[Sinh[y], $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision], 0.002], N[(N[(N[Abs[x], $MachinePrecision] - N[(N[(N[(N[Abs[x], $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * N[Abs[x], $MachinePrecision]), $MachinePrecision] * 0.16666666666666666), $MachinePrecision]), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
            
            \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
            \mathbf{if}\;\sin \left(\left|x\right|\right) \cdot \frac{\sinh y}{y} \leq 0.002:\\
            \;\;\;\;\left(\left|x\right| - \left(\left(\left|x\right| \cdot \left|x\right|\right) \cdot \left|x\right|\right) \cdot 0.16666666666666666\right) \cdot 1\\
            
            \mathbf{else}:\\
            \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\
            
            
            \end{array}
            
            Derivation
            1. Split input into 2 regimes
            2. if (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y)) < 2e-3

              1. Initial program 100.0%

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

                \[\leadsto \sin x \cdot \color{blue}{1} \]
              3. Step-by-step derivation
                1. Applied rewrites50.0%

                  \[\leadsto \sin x \cdot \color{blue}{1} \]
                2. Taylor expanded in x around 0

                  \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot 1 \]
                3. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
                  2. lower-+.f64N/A

                    \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                  3. lower-*.f64N/A

                    \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot 1 \]
                  4. lower-pow.f6433.8%

                    \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot 1 \]
                4. Applied rewrites33.8%

                  \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot 1 \]
                5. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
                  2. lift-+.f64N/A

                    \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                  3. distribute-rgt-inN/A

                    \[\leadsto \left(1 \cdot x + \color{blue}{\left(\frac{-1}{6} \cdot {x}^{2}\right) \cdot x}\right) \cdot 1 \]
                  4. add-flipN/A

                    \[\leadsto \left(1 \cdot x - \color{blue}{\left(\mathsf{neg}\left(\left(\frac{-1}{6} \cdot {x}^{2}\right) \cdot x\right)\right)}\right) \cdot 1 \]
                  5. *-lft-identityN/A

                    \[\leadsto \left(x - \left(\mathsf{neg}\left(\color{blue}{\left(\frac{-1}{6} \cdot {x}^{2}\right) \cdot x}\right)\right)\right) \cdot 1 \]
                  6. *-commutativeN/A

                    \[\leadsto \left(x - \left(\mathsf{neg}\left(x \cdot \left(\frac{-1}{6} \cdot {x}^{2}\right)\right)\right)\right) \cdot 1 \]
                  7. lower--.f64N/A

                    \[\leadsto \left(x - \color{blue}{\left(\mathsf{neg}\left(x \cdot \left(\frac{-1}{6} \cdot {x}^{2}\right)\right)\right)}\right) \cdot 1 \]
                  8. lift-*.f64N/A

                    \[\leadsto \left(x - \left(\mathsf{neg}\left(x \cdot \left(\frac{-1}{6} \cdot {x}^{2}\right)\right)\right)\right) \cdot 1 \]
                  9. *-commutativeN/A

                    \[\leadsto \left(x - \left(\mathsf{neg}\left(x \cdot \left({x}^{2} \cdot \frac{-1}{6}\right)\right)\right)\right) \cdot 1 \]
                  10. associate-*r*N/A

                    \[\leadsto \left(x - \left(\mathsf{neg}\left(\left(x \cdot {x}^{2}\right) \cdot \frac{-1}{6}\right)\right)\right) \cdot 1 \]
                  11. distribute-rgt-neg-inN/A

                    \[\leadsto \left(x - \left(x \cdot {x}^{2}\right) \cdot \color{blue}{\left(\mathsf{neg}\left(\frac{-1}{6}\right)\right)}\right) \cdot 1 \]
                  12. lift-pow.f64N/A

                    \[\leadsto \left(x - \left(x \cdot {x}^{2}\right) \cdot \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right)\right) \cdot 1 \]
                  13. unpow2N/A

                    \[\leadsto \left(x - \left(x \cdot \left(x \cdot x\right)\right) \cdot \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right)\right) \cdot 1 \]
                  14. cube-unmultN/A

                    \[\leadsto \left(x - {x}^{3} \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{6}}\right)\right)\right) \cdot 1 \]
                  15. lower-pow.f32N/A

                    \[\leadsto \left(x - {x}^{3} \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{6}}\right)\right)\right) \cdot 1 \]
                  16. lower-unsound-pow.f32N/A

                    \[\leadsto \left(x - {x}^{3} \cdot \left(\mathsf{neg}\left(\color{blue}{\frac{-1}{6}}\right)\right)\right) \cdot 1 \]
                  17. *-lft-identityN/A

                    \[\leadsto \left(x - {\left(1 \cdot x\right)}^{3} \cdot \left(\mathsf{neg}\left(\frac{-1}{6}\right)\right)\right) \cdot 1 \]
                  18. metadata-evalN/A

                    \[\leadsto \left(x - {\left(1 \cdot x\right)}^{3} \cdot \frac{1}{6}\right) \cdot 1 \]
                  19. lower-*.f64N/A

                    \[\leadsto \left(x - {\left(1 \cdot x\right)}^{3} \cdot \color{blue}{\frac{1}{6}}\right) \cdot 1 \]
                6. Applied rewrites33.9%

                  \[\leadsto \left(x - \color{blue}{\left(\left(x \cdot x\right) \cdot x\right) \cdot 0.16666666666666666}\right) \cdot 1 \]

                if 2e-3 < (*.f64 (sin.f64 x) (/.f64 (sinh.f64 y) y))

                1. Initial program 100.0%

                  \[\sin x \cdot \frac{\sinh y}{y} \]
                2. Step-by-step derivation
                  1. lift-*.f64N/A

                    \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
                  2. lift-/.f64N/A

                    \[\leadsto \sin x \cdot \color{blue}{\frac{\sinh y}{y}} \]
                  3. associate-*r/N/A

                    \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
                  4. lower-/.f64N/A

                    \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
                  5. *-commutativeN/A

                    \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
                  6. lower-*.f6489.0%

                    \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
                3. Applied rewrites89.0%

                  \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
                4. Taylor expanded in y around 0

                  \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
                5. Step-by-step derivation
                  1. lower-*.f64N/A

                    \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{y} \]
                  2. lower-sin.f6439.0%

                    \[\leadsto \frac{y \cdot \sin x}{y} \]
                6. Applied rewrites39.0%

                  \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
                7. Taylor expanded in x around 0

                  \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
                8. Step-by-step derivation
                  1. lower-*.f6420.5%

                    \[\leadsto \frac{x \cdot y}{y} \]
                9. Applied rewrites20.5%

                  \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
              4. Recombined 2 regimes into one program.
              5. Add Preprocessing

              Alternative 9: 31.5% accurate, 0.9× speedup?

              \[\mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l} \mathbf{if}\;\sin \left(\left|x\right|\right) \leq 10^{-13}:\\ \;\;\;\;\left(\left|x\right| \cdot 1\right) \cdot 1\\ \mathbf{else}:\\ \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\ \end{array} \]
              (FPCore (x y)
                :precision binary64
                (*
               (copysign 1.0 x)
               (if (<= (sin (fabs x)) 1e-13)
                 (* (* (fabs x) 1.0) 1.0)
                 (/ (* (fabs x) y) y))))
              double code(double x, double y) {
              	double tmp;
              	if (sin(fabs(x)) <= 1e-13) {
              		tmp = (fabs(x) * 1.0) * 1.0;
              	} else {
              		tmp = (fabs(x) * y) / y;
              	}
              	return copysign(1.0, x) * tmp;
              }
              
              public static double code(double x, double y) {
              	double tmp;
              	if (Math.sin(Math.abs(x)) <= 1e-13) {
              		tmp = (Math.abs(x) * 1.0) * 1.0;
              	} else {
              		tmp = (Math.abs(x) * y) / y;
              	}
              	return Math.copySign(1.0, x) * tmp;
              }
              
              def code(x, y):
              	tmp = 0
              	if math.sin(math.fabs(x)) <= 1e-13:
              		tmp = (math.fabs(x) * 1.0) * 1.0
              	else:
              		tmp = (math.fabs(x) * y) / y
              	return math.copysign(1.0, x) * tmp
              
              function code(x, y)
              	tmp = 0.0
              	if (sin(abs(x)) <= 1e-13)
              		tmp = Float64(Float64(abs(x) * 1.0) * 1.0);
              	else
              		tmp = Float64(Float64(abs(x) * y) / y);
              	end
              	return Float64(copysign(1.0, x) * tmp)
              end
              
              function tmp_2 = code(x, y)
              	tmp = 0.0;
              	if (sin(abs(x)) <= 1e-13)
              		tmp = (abs(x) * 1.0) * 1.0;
              	else
              		tmp = (abs(x) * y) / y;
              	end
              	tmp_2 = (sign(x) * abs(1.0)) * tmp;
              end
              
              code[x_, y_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[x]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Sin[N[Abs[x], $MachinePrecision]], $MachinePrecision], 1e-13], N[(N[(N[Abs[x], $MachinePrecision] * 1.0), $MachinePrecision] * 1.0), $MachinePrecision], N[(N[(N[Abs[x], $MachinePrecision] * y), $MachinePrecision] / y), $MachinePrecision]]), $MachinePrecision]
              
              \mathsf{copysign}\left(1, x\right) \cdot \begin{array}{l}
              \mathbf{if}\;\sin \left(\left|x\right|\right) \leq 10^{-13}:\\
              \;\;\;\;\left(\left|x\right| \cdot 1\right) \cdot 1\\
              
              \mathbf{else}:\\
              \;\;\;\;\frac{\left|x\right| \cdot y}{y}\\
              
              
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (sin.f64 x) < 1e-13

                1. Initial program 100.0%

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

                  \[\leadsto \sin x \cdot \color{blue}{1} \]
                3. Step-by-step derivation
                  1. Applied rewrites50.0%

                    \[\leadsto \sin x \cdot \color{blue}{1} \]
                  2. Taylor expanded in x around 0

                    \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot 1 \]
                  3. Step-by-step derivation
                    1. lower-*.f64N/A

                      \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
                    2. lower-+.f64N/A

                      \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                    3. lower-*.f64N/A

                      \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot 1 \]
                    4. lower-pow.f6433.8%

                      \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot 1 \]
                  4. Applied rewrites33.8%

                    \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot 1 \]
                  5. Taylor expanded in x around 0

                    \[\leadsto \left(x \cdot 1\right) \cdot 1 \]
                  6. Step-by-step derivation
                    1. Applied rewrites25.7%

                      \[\leadsto \left(x \cdot 1\right) \cdot 1 \]

                    if 1e-13 < (sin.f64 x)

                    1. Initial program 100.0%

                      \[\sin x \cdot \frac{\sinh y}{y} \]
                    2. Step-by-step derivation
                      1. lift-*.f64N/A

                        \[\leadsto \color{blue}{\sin x \cdot \frac{\sinh y}{y}} \]
                      2. lift-/.f64N/A

                        \[\leadsto \sin x \cdot \color{blue}{\frac{\sinh y}{y}} \]
                      3. associate-*r/N/A

                        \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
                      4. lower-/.f64N/A

                        \[\leadsto \color{blue}{\frac{\sin x \cdot \sinh y}{y}} \]
                      5. *-commutativeN/A

                        \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
                      6. lower-*.f6489.0%

                        \[\leadsto \frac{\color{blue}{\sinh y \cdot \sin x}}{y} \]
                    3. Applied rewrites89.0%

                      \[\leadsto \color{blue}{\frac{\sinh y \cdot \sin x}{y}} \]
                    4. Taylor expanded in y around 0

                      \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
                    5. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \frac{y \cdot \color{blue}{\sin x}}{y} \]
                      2. lower-sin.f6439.0%

                        \[\leadsto \frac{y \cdot \sin x}{y} \]
                    6. Applied rewrites39.0%

                      \[\leadsto \frac{\color{blue}{y \cdot \sin x}}{y} \]
                    7. Taylor expanded in x around 0

                      \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
                    8. Step-by-step derivation
                      1. lower-*.f6420.5%

                        \[\leadsto \frac{x \cdot y}{y} \]
                    9. Applied rewrites20.5%

                      \[\leadsto \frac{x \cdot \color{blue}{y}}{y} \]
                  7. Recombined 2 regimes into one program.
                  8. Add Preprocessing

                  Alternative 10: 25.7% accurate, 19.7× speedup?

                  \[\left(x \cdot 1\right) \cdot 1 \]
                  (FPCore (x y)
                    :precision binary64
                    (* (* x 1.0) 1.0))
                  double code(double x, double y) {
                  	return (x * 1.0) * 1.0;
                  }
                  
                  module fmin_fmax_functions
                      implicit none
                      private
                      public fmax
                      public fmin
                  
                      interface fmax
                          module procedure fmax88
                          module procedure fmax44
                          module procedure fmax84
                          module procedure fmax48
                      end interface
                      interface fmin
                          module procedure fmin88
                          module procedure fmin44
                          module procedure fmin84
                          module procedure fmin48
                      end interface
                  contains
                      real(8) function fmax88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmax44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmax84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmax48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                      end function
                      real(8) function fmin88(x, y) result (res)
                          real(8), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(4) function fmin44(x, y) result (res)
                          real(4), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                      end function
                      real(8) function fmin84(x, y) result(res)
                          real(8), intent (in) :: x
                          real(4), intent (in) :: y
                          res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                      end function
                      real(8) function fmin48(x, y) result(res)
                          real(4), intent (in) :: x
                          real(8), intent (in) :: y
                          res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                      end function
                  end module
                  
                  real(8) function code(x, y)
                  use fmin_fmax_functions
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      code = (x * 1.0d0) * 1.0d0
                  end function
                  
                  public static double code(double x, double y) {
                  	return (x * 1.0) * 1.0;
                  }
                  
                  def code(x, y):
                  	return (x * 1.0) * 1.0
                  
                  function code(x, y)
                  	return Float64(Float64(x * 1.0) * 1.0)
                  end
                  
                  function tmp = code(x, y)
                  	tmp = (x * 1.0) * 1.0;
                  end
                  
                  code[x_, y_] := N[(N[(x * 1.0), $MachinePrecision] * 1.0), $MachinePrecision]
                  
                  \left(x \cdot 1\right) \cdot 1
                  
                  Derivation
                  1. Initial program 100.0%

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

                    \[\leadsto \sin x \cdot \color{blue}{1} \]
                  3. Step-by-step derivation
                    1. Applied rewrites50.0%

                      \[\leadsto \sin x \cdot \color{blue}{1} \]
                    2. Taylor expanded in x around 0

                      \[\leadsto \color{blue}{\left(x \cdot \left(1 + \frac{-1}{6} \cdot {x}^{2}\right)\right)} \cdot 1 \]
                    3. Step-by-step derivation
                      1. lower-*.f64N/A

                        \[\leadsto \left(x \cdot \color{blue}{\left(1 + \frac{-1}{6} \cdot {x}^{2}\right)}\right) \cdot 1 \]
                      2. lower-+.f64N/A

                        \[\leadsto \left(x \cdot \left(1 + \color{blue}{\frac{-1}{6} \cdot {x}^{2}}\right)\right) \cdot 1 \]
                      3. lower-*.f64N/A

                        \[\leadsto \left(x \cdot \left(1 + \frac{-1}{6} \cdot \color{blue}{{x}^{2}}\right)\right) \cdot 1 \]
                      4. lower-pow.f6433.8%

                        \[\leadsto \left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{\color{blue}{2}}\right)\right) \cdot 1 \]
                    4. Applied rewrites33.8%

                      \[\leadsto \color{blue}{\left(x \cdot \left(1 + -0.16666666666666666 \cdot {x}^{2}\right)\right)} \cdot 1 \]
                    5. Taylor expanded in x around 0

                      \[\leadsto \left(x \cdot 1\right) \cdot 1 \]
                    6. Step-by-step derivation
                      1. Applied rewrites25.7%

                        \[\leadsto \left(x \cdot 1\right) \cdot 1 \]
                      2. Add Preprocessing

                      Reproduce

                      ?
                      herbie shell --seed 2025258 
                      (FPCore (x y)
                        :name "Linear.Quaternion:$ccos from linear-1.19.1.3"
                        :precision binary64
                        (* (sin x) (/ (sinh y) y)))