(/ (sin (* z1 (* PI z0))) (* z1 (* PI z0)))

Percentage Accurate: 42.3% → 97.0%
Time: 2.8s
Alternatives: 5
Speedup: 132.0×

Specification

?
\[\begin{array}{l} t_0 := z1 \cdot \left(\pi \cdot z0\right)\\ \frac{\sin t\_0}{t\_0} \end{array} \]
(FPCore (z1 z0)
  :precision binary64
  (let* ((t_0 (* z1 (* PI z0)))) (/ (sin t_0) t_0)))
double code(double z1, double z0) {
	double t_0 = z1 * (((double) M_PI) * z0);
	return sin(t_0) / t_0;
}
public static double code(double z1, double z0) {
	double t_0 = z1 * (Math.PI * z0);
	return Math.sin(t_0) / t_0;
}
def code(z1, z0):
	t_0 = z1 * (math.pi * z0)
	return math.sin(t_0) / t_0
function code(z1, z0)
	t_0 = Float64(z1 * Float64(pi * z0))
	return Float64(sin(t_0) / t_0)
end
function tmp = code(z1, z0)
	t_0 = z1 * (pi * z0);
	tmp = sin(t_0) / t_0;
end
code[z1_, z0_] := Block[{t$95$0 = N[(z1 * N[(Pi * z0), $MachinePrecision]), $MachinePrecision]}, N[(N[Sin[t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := z1 \cdot \left(\pi \cdot z0\right)\\
\frac{\sin t\_0}{t\_0}
\end{array}

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 5 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: 42.3% accurate, 1.0× speedup?

\[\begin{array}{l} t_0 := z1 \cdot \left(\pi \cdot z0\right)\\ \frac{\sin t\_0}{t\_0} \end{array} \]
(FPCore (z1 z0)
  :precision binary64
  (let* ((t_0 (* z1 (* PI z0)))) (/ (sin t_0) t_0)))
double code(double z1, double z0) {
	double t_0 = z1 * (((double) M_PI) * z0);
	return sin(t_0) / t_0;
}
public static double code(double z1, double z0) {
	double t_0 = z1 * (Math.PI * z0);
	return Math.sin(t_0) / t_0;
}
def code(z1, z0):
	t_0 = z1 * (math.pi * z0)
	return math.sin(t_0) / t_0
function code(z1, z0)
	t_0 = Float64(z1 * Float64(pi * z0))
	return Float64(sin(t_0) / t_0)
end
function tmp = code(z1, z0)
	t_0 = z1 * (pi * z0);
	tmp = sin(t_0) / t_0;
end
code[z1_, z0_] := Block[{t$95$0 = N[(z1 * N[(Pi * z0), $MachinePrecision]), $MachinePrecision]}, N[(N[Sin[t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision]]
\begin{array}{l}
t_0 := z1 \cdot \left(\pi \cdot z0\right)\\
\frac{\sin t\_0}{t\_0}
\end{array}

Alternative 1: 97.0% accurate, 0.2× speedup?

\[\begin{array}{l} t_0 := \left(\left(\left|z0\right| \cdot \left|z1\right|\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\\ t_1 := \left|z1\right| \cdot \left(\pi \cdot \left|z0\right|\right)\\ \mathbf{if}\;t\_1 \leq 5 \cdot 10^{-324}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+28}:\\ \;\;\;\;\frac{\sin t\_0}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{\left(\pi \cdot \left|z1\right|\right) \cdot \left|z0\right|}\\ \end{array} \]
(FPCore (z1 z0)
  :precision binary64
  (let* ((t_0
        (*
         (* (* (fabs z0) (fabs z1)) (pow PI 0.6666666666666666))
         (cbrt PI)))
       (t_1 (* (fabs z1) (* PI (fabs z0)))))
  (if (<= t_1 5e-324)
    1.0
    (if (<= t_1 5e+28)
      (/ (sin t_0) t_0)
      (/ 0.0 (* (* PI (fabs z1)) (fabs z0)))))))
double code(double z1, double z0) {
	double t_0 = ((fabs(z0) * fabs(z1)) * pow(((double) M_PI), 0.6666666666666666)) * cbrt(((double) M_PI));
	double t_1 = fabs(z1) * (((double) M_PI) * fabs(z0));
	double tmp;
	if (t_1 <= 5e-324) {
		tmp = 1.0;
	} else if (t_1 <= 5e+28) {
		tmp = sin(t_0) / t_0;
	} else {
		tmp = 0.0 / ((((double) M_PI) * fabs(z1)) * fabs(z0));
	}
	return tmp;
}
public static double code(double z1, double z0) {
	double t_0 = ((Math.abs(z0) * Math.abs(z1)) * Math.pow(Math.PI, 0.6666666666666666)) * Math.cbrt(Math.PI);
	double t_1 = Math.abs(z1) * (Math.PI * Math.abs(z0));
	double tmp;
	if (t_1 <= 5e-324) {
		tmp = 1.0;
	} else if (t_1 <= 5e+28) {
		tmp = Math.sin(t_0) / t_0;
	} else {
		tmp = 0.0 / ((Math.PI * Math.abs(z1)) * Math.abs(z0));
	}
	return tmp;
}
function code(z1, z0)
	t_0 = Float64(Float64(Float64(abs(z0) * abs(z1)) * (pi ^ 0.6666666666666666)) * cbrt(pi))
	t_1 = Float64(abs(z1) * Float64(pi * abs(z0)))
	tmp = 0.0
	if (t_1 <= 5e-324)
		tmp = 1.0;
	elseif (t_1 <= 5e+28)
		tmp = Float64(sin(t_0) / t_0);
	else
		tmp = Float64(0.0 / Float64(Float64(pi * abs(z1)) * abs(z0)));
	end
	return tmp
end
code[z1_, z0_] := Block[{t$95$0 = N[(N[(N[(N[Abs[z0], $MachinePrecision] * N[Abs[z1], $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 0.6666666666666666], $MachinePrecision]), $MachinePrecision] * N[Power[Pi, 1/3], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[z1], $MachinePrecision] * N[(Pi * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-324], 1.0, If[LessEqual[t$95$1, 5e+28], N[(N[Sin[t$95$0], $MachinePrecision] / t$95$0), $MachinePrecision], N[(0.0 / N[(N[(Pi * N[Abs[z1], $MachinePrecision]), $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := \left(\left(\left|z0\right| \cdot \left|z1\right|\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\\
t_1 := \left|z1\right| \cdot \left(\pi \cdot \left|z0\right|\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-324}:\\
\;\;\;\;1\\

\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+28}:\\
\;\;\;\;\frac{\sin t\_0}{t\_0}\\

\mathbf{else}:\\
\;\;\;\;\frac{0}{\left(\pi \cdot \left|z1\right|\right) \cdot \left|z0\right|}\\


\end{array}
Derivation
  1. Split input into 3 regimes
  2. if (*.f64 z1 (*.f64 (PI.f64) z0)) < 4.9406564584124654e-324

    1. Initial program 42.3%

      \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
    2. Taylor expanded in z1 around 0

      \[\leadsto \color{blue}{1} \]
    3. Step-by-step derivation
      1. Applied rewrites50.9%

        \[\leadsto \color{blue}{1} \]

      if 4.9406564584124654e-324 < (*.f64 z1 (*.f64 (PI.f64) z0)) < 4.9999999999999996e28

      1. Initial program 42.3%

        \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
      2. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\sin \color{blue}{\left(z1 \cdot \left(\pi \cdot z0\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{\sin \left(z1 \cdot \color{blue}{\left(\pi \cdot z0\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        3. *-commutativeN/A

          \[\leadsto \frac{\sin \left(z1 \cdot \color{blue}{\left(z0 \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        4. associate-*r*N/A

          \[\leadsto \frac{\sin \color{blue}{\left(\left(z1 \cdot z0\right) \cdot \pi\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        5. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(z1 \cdot z0\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        6. add-cube-cbrtN/A

          \[\leadsto \frac{\sin \left(\left(z1 \cdot z0\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        7. associate-*r*N/A

          \[\leadsto \frac{\sin \color{blue}{\left(\left(\left(z1 \cdot z0\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\sin \color{blue}{\left(\left(\left(z1 \cdot z0\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        9. lower-*.f64N/A

          \[\leadsto \frac{\sin \left(\color{blue}{\left(\left(z1 \cdot z0\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        10. *-commutativeN/A

          \[\leadsto \frac{\sin \left(\left(\color{blue}{\left(z0 \cdot z1\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        11. lower-*.f64N/A

          \[\leadsto \frac{\sin \left(\left(\color{blue}{\left(z0 \cdot z1\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        12. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        13. pow1/3N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot \left(\color{blue}{{\pi}^{\frac{1}{3}}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        14. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot \left({\pi}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\pi}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        15. pow1/3N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot \left({\pi}^{\frac{1}{3}} \cdot \color{blue}{{\pi}^{\frac{1}{3}}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        16. pow-prod-upN/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot \color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        17. lower-pow.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot \color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        18. metadata-evalN/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\color{blue}{\frac{2}{3}}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        19. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\color{blue}{\pi}}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        20. lower-cbrt.f6441.5%

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \color{blue}{\sqrt[3]{\pi}}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
      3. Applied rewrites41.5%

        \[\leadsto \frac{\sin \color{blue}{\left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
      4. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}} \]
        2. lift-*.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{z1 \cdot \color{blue}{\left(\pi \cdot z0\right)}} \]
        3. *-commutativeN/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{z1 \cdot \color{blue}{\left(z0 \cdot \pi\right)}} \]
        4. associate-*r*N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\color{blue}{\left(z1 \cdot z0\right) \cdot \pi}} \]
        5. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(z1 \cdot z0\right) \cdot \color{blue}{\mathsf{PI}\left(\right)}} \]
        6. add-cube-cbrtN/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(z1 \cdot z0\right) \cdot \color{blue}{\left(\left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)}} \]
        7. associate-*r*N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\color{blue}{\left(\left(z1 \cdot z0\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}}} \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\color{blue}{\left(\left(z1 \cdot z0\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}}} \]
        9. lower-*.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\color{blue}{\left(\left(z1 \cdot z0\right) \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        10. *-commutativeN/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\color{blue}{\left(z0 \cdot z1\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        11. lower-*.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\color{blue}{\left(z0 \cdot z1\right)} \cdot \left(\sqrt[3]{\mathsf{PI}\left(\right)} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        12. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        13. pow1/3N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot \left(\color{blue}{{\pi}^{\frac{1}{3}}} \cdot \sqrt[3]{\mathsf{PI}\left(\right)}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        14. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot \left({\pi}^{\frac{1}{3}} \cdot \sqrt[3]{\color{blue}{\pi}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        15. pow1/3N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot \left({\pi}^{\frac{1}{3}} \cdot \color{blue}{{\pi}^{\frac{1}{3}}}\right)\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        16. pow-prod-upN/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot \color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        17. lower-pow.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot \color{blue}{{\pi}^{\left(\frac{1}{3} + \frac{1}{3}\right)}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        18. metadata-evalN/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\color{blue}{\frac{2}{3}}}\right) \cdot \sqrt[3]{\mathsf{PI}\left(\right)}} \]
        19. lift-PI.f64N/A

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot {\pi}^{\frac{2}{3}}\right) \cdot \sqrt[3]{\color{blue}{\pi}}} \]
        20. lower-cbrt.f6442.2%

          \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\right)}{\left(\left(z0 \cdot z1\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \color{blue}{\sqrt[3]{\pi}}} \]
      5. Applied rewrites42.2%

        \[\leadsto \frac{\sin \left(\left(\left(z0 \cdot z1\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}\right)}{\color{blue}{\left(\left(z0 \cdot z1\right) \cdot {\pi}^{0.6666666666666666}\right) \cdot \sqrt[3]{\pi}}} \]

      if 4.9999999999999996e28 < (*.f64 z1 (*.f64 (PI.f64) z0))

      1. Initial program 42.3%

        \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
      2. Step-by-step derivation
        1. *-rgt-identityN/A

          \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot 1}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        2. lift-sin.f64N/A

          \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)} \cdot 1}{z1 \cdot \left(\pi \cdot z0\right)} \]
        3. sin-PI/2N/A

          \[\leadsto \frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        4. sin-multN/A

          \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        5. lower-/.f64N/A

          \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
      3. Applied rewrites6.2%

        \[\leadsto \frac{\color{blue}{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
      4. Step-by-step derivation
        1. lift-neg.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        2. remove-double-negN/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        3. lift-neg.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        4. lift-neg.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        5. lift-sin.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        6. sin-neg-revN/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        7. lift-*.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right) \cdot z1}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        8. lift-*.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        9. *-commutativeN/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        10. lift-*.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        11. *-commutativeN/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        12. lift-*.f64N/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        13. sin-neg-revN/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        14. cos-+PI/2-revN/A

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
      5. Applied rewrites25.8%

        \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \color{blue}{\cos \left(\left(-\left(-z0\right) \cdot \left(\pi \cdot z1\right)\right) + 0.5 \cdot \pi\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
      6. Taylor expanded in z1 around 0

        \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
      7. Step-by-step derivation
        1. lower-*.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        2. lower--.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        3. lower-cos.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        4. lower-neg.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        5. lower-*.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        6. lower-PI.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        7. lower-cos.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        8. lower-*.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        9. lower-PI.f6447.2%

          \[\leadsto \frac{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
      8. Applied rewrites47.2%

        \[\leadsto \frac{\color{blue}{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
      9. Step-by-step derivation
        1. lift-*.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        2. lift--.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        3. lift-cos.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        4. lift-neg.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        5. cos-neg-revN/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        6. lift-cos.f64N/A

          \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        7. +-inversesN/A

          \[\leadsto \frac{\frac{1}{2} \cdot 0}{z1 \cdot \left(\pi \cdot z0\right)} \]
        8. metadata-eval47.2%

          \[\leadsto \frac{0}{z1 \cdot \left(\pi \cdot z0\right)} \]
        9. metadata-evalN/A

          \[\leadsto \frac{0}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)} \]
        10. metadata-evalN/A

          \[\leadsto \frac{0}{z1 \cdot \mathsf{Rewrite=>}\left(lift-*.f64, \left(\pi \cdot z0\right)\right)} \]
      10. Applied rewrites47.2%

        \[\leadsto \color{blue}{\frac{0}{\left(\pi \cdot z1\right) \cdot z0}} \]
    4. Recombined 3 regimes into one program.
    5. Add Preprocessing

    Alternative 2: 97.0% accurate, 0.1× speedup?

    \[\begin{array}{l} t_0 := \mathsf{min}\left(\left|z1\right|, \left|z0\right|\right)\\ t_1 := \mathsf{max}\left(\left|z1\right|, \left|z0\right|\right)\\ t_2 := t\_0 \cdot \left(\pi \cdot t\_1\right)\\ \mathbf{if}\;t\_2 \leq 0:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+28}:\\ \;\;\;\;\frac{\sin t\_2}{t\_2}\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{\left(\pi \cdot t\_0\right) \cdot t\_1}\\ \end{array} \]
    (FPCore (z1 z0)
      :precision binary64
      (let* ((t_0 (fmin (fabs z1) (fabs z0)))
           (t_1 (fmax (fabs z1) (fabs z0)))
           (t_2 (* t_0 (* PI t_1))))
      (if (<= t_2 0.0)
        1.0
        (if (<= t_2 5e+28) (/ (sin t_2) t_2) (/ 0.0 (* (* PI t_0) t_1))))))
    double code(double z1, double z0) {
    	double t_0 = fmin(fabs(z1), fabs(z0));
    	double t_1 = fmax(fabs(z1), fabs(z0));
    	double t_2 = t_0 * (((double) M_PI) * t_1);
    	double tmp;
    	if (t_2 <= 0.0) {
    		tmp = 1.0;
    	} else if (t_2 <= 5e+28) {
    		tmp = sin(t_2) / t_2;
    	} else {
    		tmp = 0.0 / ((((double) M_PI) * t_0) * t_1);
    	}
    	return tmp;
    }
    
    public static double code(double z1, double z0) {
    	double t_0 = fmin(Math.abs(z1), Math.abs(z0));
    	double t_1 = fmax(Math.abs(z1), Math.abs(z0));
    	double t_2 = t_0 * (Math.PI * t_1);
    	double tmp;
    	if (t_2 <= 0.0) {
    		tmp = 1.0;
    	} else if (t_2 <= 5e+28) {
    		tmp = Math.sin(t_2) / t_2;
    	} else {
    		tmp = 0.0 / ((Math.PI * t_0) * t_1);
    	}
    	return tmp;
    }
    
    def code(z1, z0):
    	t_0 = fmin(math.fabs(z1), math.fabs(z0))
    	t_1 = fmax(math.fabs(z1), math.fabs(z0))
    	t_2 = t_0 * (math.pi * t_1)
    	tmp = 0
    	if t_2 <= 0.0:
    		tmp = 1.0
    	elif t_2 <= 5e+28:
    		tmp = math.sin(t_2) / t_2
    	else:
    		tmp = 0.0 / ((math.pi * t_0) * t_1)
    	return tmp
    
    function code(z1, z0)
    	t_0 = fmin(abs(z1), abs(z0))
    	t_1 = fmax(abs(z1), abs(z0))
    	t_2 = Float64(t_0 * Float64(pi * t_1))
    	tmp = 0.0
    	if (t_2 <= 0.0)
    		tmp = 1.0;
    	elseif (t_2 <= 5e+28)
    		tmp = Float64(sin(t_2) / t_2);
    	else
    		tmp = Float64(0.0 / Float64(Float64(pi * t_0) * t_1));
    	end
    	return tmp
    end
    
    function tmp_2 = code(z1, z0)
    	t_0 = min(abs(z1), abs(z0));
    	t_1 = max(abs(z1), abs(z0));
    	t_2 = t_0 * (pi * t_1);
    	tmp = 0.0;
    	if (t_2 <= 0.0)
    		tmp = 1.0;
    	elseif (t_2 <= 5e+28)
    		tmp = sin(t_2) / t_2;
    	else
    		tmp = 0.0 / ((pi * t_0) * t_1);
    	end
    	tmp_2 = tmp;
    end
    
    code[z1_, z0_] := Block[{t$95$0 = N[Min[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Abs[z1], $MachinePrecision], N[Abs[z0], $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(t$95$0 * N[(Pi * t$95$1), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, 0.0], 1.0, If[LessEqual[t$95$2, 5e+28], N[(N[Sin[t$95$2], $MachinePrecision] / t$95$2), $MachinePrecision], N[(0.0 / N[(N[(Pi * t$95$0), $MachinePrecision] * t$95$1), $MachinePrecision]), $MachinePrecision]]]]]]
    
    \begin{array}{l}
    t_0 := \mathsf{min}\left(\left|z1\right|, \left|z0\right|\right)\\
    t_1 := \mathsf{max}\left(\left|z1\right|, \left|z0\right|\right)\\
    t_2 := t\_0 \cdot \left(\pi \cdot t\_1\right)\\
    \mathbf{if}\;t\_2 \leq 0:\\
    \;\;\;\;1\\
    
    \mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+28}:\\
    \;\;\;\;\frac{\sin t\_2}{t\_2}\\
    
    \mathbf{else}:\\
    \;\;\;\;\frac{0}{\left(\pi \cdot t\_0\right) \cdot t\_1}\\
    
    
    \end{array}
    
    Derivation
    1. Split input into 3 regimes
    2. if (*.f64 z1 (*.f64 (PI.f64) z0)) < 0.0

      1. Initial program 42.3%

        \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
      2. Taylor expanded in z1 around 0

        \[\leadsto \color{blue}{1} \]
      3. Step-by-step derivation
        1. Applied rewrites50.9%

          \[\leadsto \color{blue}{1} \]

        if 0.0 < (*.f64 z1 (*.f64 (PI.f64) z0)) < 4.9999999999999996e28

        1. Initial program 42.3%

          \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]

        if 4.9999999999999996e28 < (*.f64 z1 (*.f64 (PI.f64) z0))

        1. Initial program 42.3%

          \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        2. Step-by-step derivation
          1. *-rgt-identityN/A

            \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot 1}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. lift-sin.f64N/A

            \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)} \cdot 1}{z1 \cdot \left(\pi \cdot z0\right)} \]
          3. sin-PI/2N/A

            \[\leadsto \frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          4. sin-multN/A

            \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          5. lower-/.f64N/A

            \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        3. Applied rewrites6.2%

          \[\leadsto \frac{\color{blue}{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        4. Step-by-step derivation
          1. lift-neg.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. remove-double-negN/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          3. lift-neg.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          4. lift-neg.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          5. lift-sin.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          6. sin-neg-revN/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          7. lift-*.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right) \cdot z1}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          8. lift-*.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          9. *-commutativeN/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          10. lift-*.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          11. *-commutativeN/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          12. lift-*.f64N/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          13. sin-neg-revN/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          14. cos-+PI/2-revN/A

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        5. Applied rewrites25.8%

          \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \color{blue}{\cos \left(\left(-\left(-z0\right) \cdot \left(\pi \cdot z1\right)\right) + 0.5 \cdot \pi\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        6. Taylor expanded in z1 around 0

          \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        7. Step-by-step derivation
          1. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. lower--.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          3. lower-cos.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          4. lower-neg.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          5. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          6. lower-PI.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          7. lower-cos.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          8. lower-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          9. lower-PI.f6447.2%

            \[\leadsto \frac{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        8. Applied rewrites47.2%

          \[\leadsto \frac{\color{blue}{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
        9. Step-by-step derivation
          1. lift-*.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. lift--.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          3. lift-cos.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          4. lift-neg.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          5. cos-neg-revN/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          6. lift-cos.f64N/A

            \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          7. +-inversesN/A

            \[\leadsto \frac{\frac{1}{2} \cdot 0}{z1 \cdot \left(\pi \cdot z0\right)} \]
          8. metadata-eval47.2%

            \[\leadsto \frac{0}{z1 \cdot \left(\pi \cdot z0\right)} \]
          9. metadata-evalN/A

            \[\leadsto \frac{0}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)} \]
          10. metadata-evalN/A

            \[\leadsto \frac{0}{z1 \cdot \mathsf{Rewrite=>}\left(lift-*.f64, \left(\pi \cdot z0\right)\right)} \]
        10. Applied rewrites47.2%

          \[\leadsto \color{blue}{\frac{0}{\left(\pi \cdot z1\right) \cdot z0}} \]
      4. Recombined 3 regimes into one program.
      5. Add Preprocessing

      Alternative 3: 96.9% accurate, 0.7× speedup?

      \[\begin{array}{l} t_0 := \left|z1\right| \cdot \left(\pi \cdot \left|z0\right|\right)\\ \mathbf{if}\;t\_0 \leq 5 \cdot 10^{-12}:\\ \;\;\;\;1\\ \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+28}:\\ \;\;\;\;\frac{\sin \left(\left|z0\right| \cdot \left(\left|z1\right| \cdot \pi\right)\right)}{t\_0}\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{\left(\pi \cdot \left|z1\right|\right) \cdot \left|z0\right|}\\ \end{array} \]
      (FPCore (z1 z0)
        :precision binary64
        (let* ((t_0 (* (fabs z1) (* PI (fabs z0)))))
        (if (<= t_0 5e-12)
          1.0
          (if (<= t_0 5e+28)
            (/ (sin (* (fabs z0) (* (fabs z1) PI))) t_0)
            (/ 0.0 (* (* PI (fabs z1)) (fabs z0)))))))
      double code(double z1, double z0) {
      	double t_0 = fabs(z1) * (((double) M_PI) * fabs(z0));
      	double tmp;
      	if (t_0 <= 5e-12) {
      		tmp = 1.0;
      	} else if (t_0 <= 5e+28) {
      		tmp = sin((fabs(z0) * (fabs(z1) * ((double) M_PI)))) / t_0;
      	} else {
      		tmp = 0.0 / ((((double) M_PI) * fabs(z1)) * fabs(z0));
      	}
      	return tmp;
      }
      
      public static double code(double z1, double z0) {
      	double t_0 = Math.abs(z1) * (Math.PI * Math.abs(z0));
      	double tmp;
      	if (t_0 <= 5e-12) {
      		tmp = 1.0;
      	} else if (t_0 <= 5e+28) {
      		tmp = Math.sin((Math.abs(z0) * (Math.abs(z1) * Math.PI))) / t_0;
      	} else {
      		tmp = 0.0 / ((Math.PI * Math.abs(z1)) * Math.abs(z0));
      	}
      	return tmp;
      }
      
      def code(z1, z0):
      	t_0 = math.fabs(z1) * (math.pi * math.fabs(z0))
      	tmp = 0
      	if t_0 <= 5e-12:
      		tmp = 1.0
      	elif t_0 <= 5e+28:
      		tmp = math.sin((math.fabs(z0) * (math.fabs(z1) * math.pi))) / t_0
      	else:
      		tmp = 0.0 / ((math.pi * math.fabs(z1)) * math.fabs(z0))
      	return tmp
      
      function code(z1, z0)
      	t_0 = Float64(abs(z1) * Float64(pi * abs(z0)))
      	tmp = 0.0
      	if (t_0 <= 5e-12)
      		tmp = 1.0;
      	elseif (t_0 <= 5e+28)
      		tmp = Float64(sin(Float64(abs(z0) * Float64(abs(z1) * pi))) / t_0);
      	else
      		tmp = Float64(0.0 / Float64(Float64(pi * abs(z1)) * abs(z0)));
      	end
      	return tmp
      end
      
      function tmp_2 = code(z1, z0)
      	t_0 = abs(z1) * (pi * abs(z0));
      	tmp = 0.0;
      	if (t_0 <= 5e-12)
      		tmp = 1.0;
      	elseif (t_0 <= 5e+28)
      		tmp = sin((abs(z0) * (abs(z1) * pi))) / t_0;
      	else
      		tmp = 0.0 / ((pi * abs(z1)) * abs(z0));
      	end
      	tmp_2 = tmp;
      end
      
      code[z1_, z0_] := Block[{t$95$0 = N[(N[Abs[z1], $MachinePrecision] * N[(Pi * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$0, 5e-12], 1.0, If[LessEqual[t$95$0, 5e+28], N[(N[Sin[N[(N[Abs[z0], $MachinePrecision] * N[(N[Abs[z1], $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] / t$95$0), $MachinePrecision], N[(0.0 / N[(N[(Pi * N[Abs[z1], $MachinePrecision]), $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
      
      \begin{array}{l}
      t_0 := \left|z1\right| \cdot \left(\pi \cdot \left|z0\right|\right)\\
      \mathbf{if}\;t\_0 \leq 5 \cdot 10^{-12}:\\
      \;\;\;\;1\\
      
      \mathbf{elif}\;t\_0 \leq 5 \cdot 10^{+28}:\\
      \;\;\;\;\frac{\sin \left(\left|z0\right| \cdot \left(\left|z1\right| \cdot \pi\right)\right)}{t\_0}\\
      
      \mathbf{else}:\\
      \;\;\;\;\frac{0}{\left(\pi \cdot \left|z1\right|\right) \cdot \left|z0\right|}\\
      
      
      \end{array}
      
      Derivation
      1. Split input into 3 regimes
      2. if (*.f64 z1 (*.f64 (PI.f64) z0)) < 4.9999999999999997e-12

        1. Initial program 42.3%

          \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
        2. Taylor expanded in z1 around 0

          \[\leadsto \color{blue}{1} \]
        3. Step-by-step derivation
          1. Applied rewrites50.9%

            \[\leadsto \color{blue}{1} \]

          if 4.9999999999999997e-12 < (*.f64 z1 (*.f64 (PI.f64) z0)) < 4.9999999999999996e28

          1. Initial program 42.3%

            \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. Taylor expanded in z1 around inf

            \[\leadsto \frac{\color{blue}{\sin \left(z0 \cdot \left(z1 \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          3. Step-by-step derivation
            1. lower-sin.f64N/A

              \[\leadsto \frac{\sin \left(z0 \cdot \left(z1 \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            2. lower-*.f64N/A

              \[\leadsto \frac{\sin \left(z0 \cdot \left(z1 \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            3. lower-*.f64N/A

              \[\leadsto \frac{\sin \left(z0 \cdot \left(z1 \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            4. lower-PI.f6442.1%

              \[\leadsto \frac{\sin \left(z0 \cdot \left(z1 \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          4. Applied rewrites42.1%

            \[\leadsto \frac{\color{blue}{\sin \left(z0 \cdot \left(z1 \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]

          if 4.9999999999999996e28 < (*.f64 z1 (*.f64 (PI.f64) z0))

          1. Initial program 42.3%

            \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. Step-by-step derivation
            1. *-rgt-identityN/A

              \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot 1}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            2. lift-sin.f64N/A

              \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)} \cdot 1}{z1 \cdot \left(\pi \cdot z0\right)} \]
            3. sin-PI/2N/A

              \[\leadsto \frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            4. sin-multN/A

              \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            5. lower-/.f64N/A

              \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          3. Applied rewrites6.2%

            \[\leadsto \frac{\color{blue}{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          4. Step-by-step derivation
            1. lift-neg.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            2. remove-double-negN/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            3. lift-neg.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            4. lift-neg.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            5. lift-sin.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            6. sin-neg-revN/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            7. lift-*.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right) \cdot z1}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            8. lift-*.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            9. *-commutativeN/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            10. lift-*.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            11. *-commutativeN/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            12. lift-*.f64N/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            13. sin-neg-revN/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            14. cos-+PI/2-revN/A

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          5. Applied rewrites25.8%

            \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \color{blue}{\cos \left(\left(-\left(-z0\right) \cdot \left(\pi \cdot z1\right)\right) + 0.5 \cdot \pi\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          6. Taylor expanded in z1 around 0

            \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          7. Step-by-step derivation
            1. lower-*.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            2. lower--.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            3. lower-cos.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            4. lower-neg.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            5. lower-*.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            6. lower-PI.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            7. lower-cos.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            8. lower-*.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            9. lower-PI.f6447.2%

              \[\leadsto \frac{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          8. Applied rewrites47.2%

            \[\leadsto \frac{\color{blue}{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
          9. Step-by-step derivation
            1. lift-*.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            2. lift--.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            3. lift-cos.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            4. lift-neg.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            5. cos-neg-revN/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            6. lift-cos.f64N/A

              \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            7. +-inversesN/A

              \[\leadsto \frac{\frac{1}{2} \cdot 0}{z1 \cdot \left(\pi \cdot z0\right)} \]
            8. metadata-eval47.2%

              \[\leadsto \frac{0}{z1 \cdot \left(\pi \cdot z0\right)} \]
            9. metadata-evalN/A

              \[\leadsto \frac{0}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)} \]
            10. metadata-evalN/A

              \[\leadsto \frac{0}{z1 \cdot \mathsf{Rewrite=>}\left(lift-*.f64, \left(\pi \cdot z0\right)\right)} \]
          10. Applied rewrites47.2%

            \[\leadsto \color{blue}{\frac{0}{\left(\pi \cdot z1\right) \cdot z0}} \]
        4. Recombined 3 regimes into one program.
        5. Add Preprocessing

        Alternative 4: 95.3% accurate, 2.9× speedup?

        \[\begin{array}{l} \mathbf{if}\;\left|z1\right| \cdot \left(\pi \cdot \left|z0\right|\right) \leq 2 \cdot 10^{+27}:\\ \;\;\;\;1\\ \mathbf{else}:\\ \;\;\;\;\frac{0}{\left(\pi \cdot \left|z1\right|\right) \cdot \left|z0\right|}\\ \end{array} \]
        (FPCore (z1 z0)
          :precision binary64
          (if (<= (* (fabs z1) (* PI (fabs z0))) 2e+27)
          1.0
          (/ 0.0 (* (* PI (fabs z1)) (fabs z0)))))
        double code(double z1, double z0) {
        	double tmp;
        	if ((fabs(z1) * (((double) M_PI) * fabs(z0))) <= 2e+27) {
        		tmp = 1.0;
        	} else {
        		tmp = 0.0 / ((((double) M_PI) * fabs(z1)) * fabs(z0));
        	}
        	return tmp;
        }
        
        public static double code(double z1, double z0) {
        	double tmp;
        	if ((Math.abs(z1) * (Math.PI * Math.abs(z0))) <= 2e+27) {
        		tmp = 1.0;
        	} else {
        		tmp = 0.0 / ((Math.PI * Math.abs(z1)) * Math.abs(z0));
        	}
        	return tmp;
        }
        
        def code(z1, z0):
        	tmp = 0
        	if (math.fabs(z1) * (math.pi * math.fabs(z0))) <= 2e+27:
        		tmp = 1.0
        	else:
        		tmp = 0.0 / ((math.pi * math.fabs(z1)) * math.fabs(z0))
        	return tmp
        
        function code(z1, z0)
        	tmp = 0.0
        	if (Float64(abs(z1) * Float64(pi * abs(z0))) <= 2e+27)
        		tmp = 1.0;
        	else
        		tmp = Float64(0.0 / Float64(Float64(pi * abs(z1)) * abs(z0)));
        	end
        	return tmp
        end
        
        function tmp_2 = code(z1, z0)
        	tmp = 0.0;
        	if ((abs(z1) * (pi * abs(z0))) <= 2e+27)
        		tmp = 1.0;
        	else
        		tmp = 0.0 / ((pi * abs(z1)) * abs(z0));
        	end
        	tmp_2 = tmp;
        end
        
        code[z1_, z0_] := If[LessEqual[N[(N[Abs[z1], $MachinePrecision] * N[(Pi * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 2e+27], 1.0, N[(0.0 / N[(N[(Pi * N[Abs[z1], $MachinePrecision]), $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
        
        \begin{array}{l}
        \mathbf{if}\;\left|z1\right| \cdot \left(\pi \cdot \left|z0\right|\right) \leq 2 \cdot 10^{+27}:\\
        \;\;\;\;1\\
        
        \mathbf{else}:\\
        \;\;\;\;\frac{0}{\left(\pi \cdot \left|z1\right|\right) \cdot \left|z0\right|}\\
        
        
        \end{array}
        
        Derivation
        1. Split input into 2 regimes
        2. if (*.f64 z1 (*.f64 (PI.f64) z0)) < 2e27

          1. Initial program 42.3%

            \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. Taylor expanded in z1 around 0

            \[\leadsto \color{blue}{1} \]
          3. Step-by-step derivation
            1. Applied rewrites50.9%

              \[\leadsto \color{blue}{1} \]

            if 2e27 < (*.f64 z1 (*.f64 (PI.f64) z0))

            1. Initial program 42.3%

              \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            2. Step-by-step derivation
              1. *-rgt-identityN/A

                \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot 1}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              2. lift-sin.f64N/A

                \[\leadsto \frac{\color{blue}{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)} \cdot 1}{z1 \cdot \left(\pi \cdot z0\right)} \]
              3. sin-PI/2N/A

                \[\leadsto \frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right) \cdot \color{blue}{\sin \left(\frac{\mathsf{PI}\left(\right)}{2}\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              4. sin-multN/A

                \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              5. lower-/.f64N/A

                \[\leadsto \frac{\color{blue}{\frac{\cos \left(z1 \cdot \left(\pi \cdot z0\right) - \frac{\mathsf{PI}\left(\right)}{2}\right) - \cos \left(z1 \cdot \left(\pi \cdot z0\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            3. Applied rewrites6.2%

              \[\leadsto \frac{\color{blue}{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}{2}}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            4. Step-by-step derivation
              1. lift-neg.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              2. remove-double-negN/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              3. lift-neg.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(-\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              4. lift-neg.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\left(\mathsf{neg}\left(\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              5. lift-sin.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\left(z0 \cdot \pi\right) \cdot z1\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              6. sin-neg-revN/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(z0 \cdot \pi\right) \cdot z1\right)\right)}\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              7. lift-*.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right) \cdot z1}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              8. lift-*.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(z0 \cdot \pi\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              9. *-commutativeN/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              10. lift-*.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{\left(\pi \cdot z0\right)} \cdot z1\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              11. *-commutativeN/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              12. lift-*.f64N/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(\sin \left(\mathsf{neg}\left(\color{blue}{z1 \cdot \left(\pi \cdot z0\right)}\right)\right)\right)\right)\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              13. sin-neg-revN/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \left(\mathsf{neg}\left(\color{blue}{\sin \left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right)}\right)\right)}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              14. cos-+PI/2-revN/A

                \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot \frac{1}{2}\right) - \color{blue}{\cos \left(\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)\right)\right) + \frac{\mathsf{PI}\left(\right)}{2}\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            5. Applied rewrites25.8%

              \[\leadsto \frac{\frac{\cos \left(\left(z0 \cdot \pi\right) \cdot z1 - \pi \cdot 0.5\right) - \color{blue}{\cos \left(\left(-\left(-z0\right) \cdot \left(\pi \cdot z1\right)\right) + 0.5 \cdot \pi\right)}}{2}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            6. Taylor expanded in z1 around 0

              \[\leadsto \frac{\color{blue}{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            7. Step-by-step derivation
              1. lower-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              2. lower--.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              3. lower-cos.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              4. lower-neg.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              5. lower-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              6. lower-PI.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              7. lower-cos.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              8. lower-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right)\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              9. lower-PI.f6447.2%

                \[\leadsto \frac{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
            8. Applied rewrites47.2%

              \[\leadsto \frac{\color{blue}{0.5 \cdot \left(\cos \left(-0.5 \cdot \pi\right) - \cos \left(0.5 \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
            9. Step-by-step derivation
              1. lift-*.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \color{blue}{\left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \left(\frac{1}{2} \cdot \pi\right)\right)}}{z1 \cdot \left(\pi \cdot z0\right)} \]
              2. lift--.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \color{blue}{\cos \left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              3. lift-cos.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(-\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              4. lift-neg.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\mathsf{neg}\left(\frac{1}{2} \cdot \pi\right)\right) - \cos \left(\color{blue}{\frac{1}{2}} \cdot \pi\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              5. cos-neg-revN/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              6. lift-cos.f64N/A

                \[\leadsto \frac{\frac{1}{2} \cdot \left(\cos \left(\frac{1}{2} \cdot \pi\right) - \cos \color{blue}{\left(\frac{1}{2} \cdot \pi\right)}\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
              7. +-inversesN/A

                \[\leadsto \frac{\frac{1}{2} \cdot 0}{z1 \cdot \left(\pi \cdot z0\right)} \]
              8. metadata-eval47.2%

                \[\leadsto \frac{0}{z1 \cdot \left(\pi \cdot z0\right)} \]
              9. metadata-evalN/A

                \[\leadsto \frac{0}{\mathsf{Rewrite=>}\left(lift-*.f64, \left(z1 \cdot \left(\pi \cdot z0\right)\right)\right)} \]
              10. metadata-evalN/A

                \[\leadsto \frac{0}{z1 \cdot \mathsf{Rewrite=>}\left(lift-*.f64, \left(\pi \cdot z0\right)\right)} \]
            10. Applied rewrites47.2%

              \[\leadsto \color{blue}{\frac{0}{\left(\pi \cdot z1\right) \cdot z0}} \]
          4. Recombined 2 regimes into one program.
          5. Add Preprocessing

          Alternative 5: 50.9% accurate, 132.0× speedup?

          \[1 \]
          (FPCore (z1 z0)
            :precision binary64
            1.0)
          double code(double z1, double z0) {
          	return 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(z1, z0)
          use fmin_fmax_functions
              real(8), intent (in) :: z1
              real(8), intent (in) :: z0
              code = 1.0d0
          end function
          
          public static double code(double z1, double z0) {
          	return 1.0;
          }
          
          def code(z1, z0):
          	return 1.0
          
          function code(z1, z0)
          	return 1.0
          end
          
          function tmp = code(z1, z0)
          	tmp = 1.0;
          end
          
          code[z1_, z0_] := 1.0
          
          1
          
          Derivation
          1. Initial program 42.3%

            \[\frac{\sin \left(z1 \cdot \left(\pi \cdot z0\right)\right)}{z1 \cdot \left(\pi \cdot z0\right)} \]
          2. Taylor expanded in z1 around 0

            \[\leadsto \color{blue}{1} \]
          3. Step-by-step derivation
            1. Applied rewrites50.9%

              \[\leadsto \color{blue}{1} \]
            2. Add Preprocessing

            Reproduce

            ?
            herbie shell --seed 2025250 
            (FPCore (z1 z0)
              :name "(/ (sin (* z1 (* PI z0))) (* z1 (* PI z0)))"
              :precision binary64
              (/ (sin (* z1 (* PI z0))) (* z1 (* PI z0))))