(sin (* PI (+ z0 z0)))

Percentage Accurate: 53.4% → 98.6%
Time: 2.0s
Alternatives: 7
Speedup: 1.0×

Specification

?
\[\sin \left(\pi \cdot \left(z0 + z0\right)\right) \]
(FPCore (z0)
  :precision binary64
  (sin (* PI (+ z0 z0))))
double code(double z0) {
	return sin((((double) M_PI) * (z0 + z0)));
}
public static double code(double z0) {
	return Math.sin((Math.PI * (z0 + z0)));
}
def code(z0):
	return math.sin((math.pi * (z0 + z0)))
function code(z0)
	return sin(Float64(pi * Float64(z0 + z0)))
end
function tmp = code(z0)
	tmp = sin((pi * (z0 + z0)));
end
code[z0_] := N[Sin[N[(Pi * N[(z0 + z0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sin \left(\pi \cdot \left(z0 + z0\right)\right)

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

\[\sin \left(\pi \cdot \left(z0 + z0\right)\right) \]
(FPCore (z0)
  :precision binary64
  (sin (* PI (+ z0 z0))))
double code(double z0) {
	return sin((((double) M_PI) * (z0 + z0)));
}
public static double code(double z0) {
	return Math.sin((Math.PI * (z0 + z0)));
}
def code(z0):
	return math.sin((math.pi * (z0 + z0)))
function code(z0)
	return sin(Float64(pi * Float64(z0 + z0)))
end
function tmp = code(z0)
	tmp = sin((pi * (z0 + z0)));
end
code[z0_] := N[Sin[N[(Pi * N[(z0 + z0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]
\sin \left(\pi \cdot \left(z0 + z0\right)\right)

Alternative 1: 98.6% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \pi \cdot \left|z0\right|\\ \mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l} \mathbf{if}\;\left|z0\right| \leq 28000000000000:\\ \;\;\;\;\sin \left(\left(2.9291837751230467 \cdot \left|z0\right|\right) \cdot 2.1450293971110255\right)\\ \mathbf{else}:\\ \;\;\;\;2 \cdot \frac{\cos \left(0.5 \cdot \pi - t\_0\right) - \cos \left(0.5 \cdot \pi + t\_0\right)}{2}\\ \end{array} \end{array} \]
(FPCore (z0)
  :precision binary64
  (let* ((t_0 (* PI (fabs z0))))
  (*
   (copysign 1.0 z0)
   (if (<= (fabs z0) 28000000000000.0)
     (sin (* (* 2.9291837751230467 (fabs z0)) 2.1450293971110255))
     (*
      2.0
      (/
       (- (cos (- (* 0.5 PI) t_0)) (cos (+ (* 0.5 PI) t_0)))
       2.0))))))
double code(double z0) {
	double t_0 = ((double) M_PI) * fabs(z0);
	double tmp;
	if (fabs(z0) <= 28000000000000.0) {
		tmp = sin(((2.9291837751230467 * fabs(z0)) * 2.1450293971110255));
	} else {
		tmp = 2.0 * ((cos(((0.5 * ((double) M_PI)) - t_0)) - cos(((0.5 * ((double) M_PI)) + t_0))) / 2.0);
	}
	return copysign(1.0, z0) * tmp;
}
public static double code(double z0) {
	double t_0 = Math.PI * Math.abs(z0);
	double tmp;
	if (Math.abs(z0) <= 28000000000000.0) {
		tmp = Math.sin(((2.9291837751230467 * Math.abs(z0)) * 2.1450293971110255));
	} else {
		tmp = 2.0 * ((Math.cos(((0.5 * Math.PI) - t_0)) - Math.cos(((0.5 * Math.PI) + t_0))) / 2.0);
	}
	return Math.copySign(1.0, z0) * tmp;
}
def code(z0):
	t_0 = math.pi * math.fabs(z0)
	tmp = 0
	if math.fabs(z0) <= 28000000000000.0:
		tmp = math.sin(((2.9291837751230467 * math.fabs(z0)) * 2.1450293971110255))
	else:
		tmp = 2.0 * ((math.cos(((0.5 * math.pi) - t_0)) - math.cos(((0.5 * math.pi) + t_0))) / 2.0)
	return math.copysign(1.0, z0) * tmp
function code(z0)
	t_0 = Float64(pi * abs(z0))
	tmp = 0.0
	if (abs(z0) <= 28000000000000.0)
		tmp = sin(Float64(Float64(2.9291837751230467 * abs(z0)) * 2.1450293971110255));
	else
		tmp = Float64(2.0 * Float64(Float64(cos(Float64(Float64(0.5 * pi) - t_0)) - cos(Float64(Float64(0.5 * pi) + t_0))) / 2.0));
	end
	return Float64(copysign(1.0, z0) * tmp)
end
function tmp_2 = code(z0)
	t_0 = pi * abs(z0);
	tmp = 0.0;
	if (abs(z0) <= 28000000000000.0)
		tmp = sin(((2.9291837751230467 * abs(z0)) * 2.1450293971110255));
	else
		tmp = 2.0 * ((cos(((0.5 * pi) - t_0)) - cos(((0.5 * pi) + t_0))) / 2.0);
	end
	tmp_2 = (sign(z0) * abs(1.0)) * tmp;
end
code[z0_] := Block[{t$95$0 = N[(Pi * N[Abs[z0], $MachinePrecision]), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[z0], $MachinePrecision], 28000000000000.0], N[Sin[N[(N[(2.9291837751230467 * N[Abs[z0], $MachinePrecision]), $MachinePrecision] * 2.1450293971110255), $MachinePrecision]], $MachinePrecision], N[(2.0 * N[(N[(N[Cos[N[(N[(0.5 * Pi), $MachinePrecision] - t$95$0), $MachinePrecision]], $MachinePrecision] - N[Cos[N[(N[(0.5 * Pi), $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] / 2.0), $MachinePrecision]), $MachinePrecision]]), $MachinePrecision]]
\begin{array}{l}
t_0 := \pi \cdot \left|z0\right|\\
\mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|z0\right| \leq 28000000000000:\\
\;\;\;\;\sin \left(\left(2.9291837751230467 \cdot \left|z0\right|\right) \cdot 2.1450293971110255\right)\\

\mathbf{else}:\\
\;\;\;\;2 \cdot \frac{\cos \left(0.5 \cdot \pi - t\_0\right) - \cos \left(0.5 \cdot \pi + t\_0\right)}{2}\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z0 < 2.8e13

    1. Initial program 53.4%

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

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

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

        \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
      15. lower-cbrt.f6452.9%

        \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    3. Applied rewrites52.9%

      \[\leadsto \sin \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(z0 + z0\right)\right)\right)} \]
    4. Evaluated real constant53.4%

      \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{1.4645918875615234} \cdot \left(z0 + z0\right)\right)\right) \]
    5. Evaluated real constant53.4%

      \[\leadsto \sin \left(\color{blue}{2.1450293971110255} \cdot \left(1.4645918875615234 \cdot \left(z0 + z0\right)\right)\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\frac{4830176796763987}{2251799813685248} \cdot \left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sin \color{blue}{\left(\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right) \cdot \frac{4830176796763987}{2251799813685248}\right)} \]
      3. lower-*.f6453.4%

        \[\leadsto \sin \color{blue}{\left(\left(1.4645918875615234 \cdot \left(z0 + z0\right)\right) \cdot 2.1450293971110255\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \sin \left(\color{blue}{\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      5. lift-+.f64N/A

        \[\leadsto \sin \left(\left(\frac{824491934883991}{562949953421312} \cdot \color{blue}{\left(z0 + z0\right)}\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      6. count-2N/A

        \[\leadsto \sin \left(\left(\frac{824491934883991}{562949953421312} \cdot \color{blue}{\left(2 \cdot z0\right)}\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      7. associate-*r*N/A

        \[\leadsto \sin \left(\color{blue}{\left(\left(\frac{824491934883991}{562949953421312} \cdot 2\right) \cdot z0\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      8. metadata-evalN/A

        \[\leadsto \sin \left(\left(\color{blue}{\frac{824491934883991}{281474976710656}} \cdot z0\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      9. metadata-evalN/A

        \[\leadsto \sin \left(\left(\color{blue}{\left(\frac{824491934883991}{562949953421312} + \frac{824491934883991}{562949953421312}\right)} \cdot z0\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \sin \left(\color{blue}{\left(\left(\frac{824491934883991}{562949953421312} + \frac{824491934883991}{562949953421312}\right) \cdot z0\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      11. metadata-eval53.4%

        \[\leadsto \sin \left(\left(\color{blue}{2.9291837751230467} \cdot z0\right) \cdot 2.1450293971110255\right) \]
    7. Applied rewrites53.4%

      \[\leadsto \sin \color{blue}{\left(\left(2.9291837751230467 \cdot z0\right) \cdot 2.1450293971110255\right)} \]

    if 2.8e13 < z0

    1. Initial program 53.4%

      \[\sin \left(\pi \cdot \left(z0 + z0\right)\right) \]
    2. Step-by-step derivation
      1. lift-sin.f64N/A

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

        \[\leadsto \sin \color{blue}{\left(\pi \cdot \left(z0 + z0\right)\right)} \]
      3. lift-+.f64N/A

        \[\leadsto \sin \left(\pi \cdot \color{blue}{\left(z0 + z0\right)}\right) \]
      4. distribute-lft-inN/A

        \[\leadsto \sin \color{blue}{\left(\pi \cdot z0 + \pi \cdot z0\right)} \]
      5. count-2N/A

        \[\leadsto \sin \color{blue}{\left(2 \cdot \left(\pi \cdot z0\right)\right)} \]
      6. sin-2N/A

        \[\leadsto \color{blue}{2 \cdot \left(\sin \left(\pi \cdot z0\right) \cdot \cos \left(\pi \cdot z0\right)\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \color{blue}{2 \cdot \left(\sin \left(\pi \cdot z0\right) \cdot \cos \left(\pi \cdot z0\right)\right)} \]
      8. *-commutativeN/A

        \[\leadsto 2 \cdot \color{blue}{\left(\cos \left(\pi \cdot z0\right) \cdot \sin \left(\pi \cdot z0\right)\right)} \]
      9. lower-*.f64N/A

        \[\leadsto 2 \cdot \color{blue}{\left(\cos \left(\pi \cdot z0\right) \cdot \sin \left(\pi \cdot z0\right)\right)} \]
      10. rem-log-expN/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \color{blue}{\log \left(e^{\pi \cdot z0}\right)}\right) \]
      11. pow-expN/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left({\left(e^{\pi}\right)}^{z0}\right)}\right) \]
      12. lift-PI.f64N/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left({\left(e^{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{z0}\right)\right) \]
      13. remove-double-negN/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z0\right)\right)\right)\right)}}\right)\right) \]
      14. pow-negN/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left(\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\mathsf{neg}\left(z0\right)\right)}}\right)}\right) \]
      15. lower-unsound-pow.f32N/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left(\frac{1}{\color{blue}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\mathsf{neg}\left(z0\right)\right)}}}\right)\right) \]
      16. lower-pow.f32N/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left(\frac{1}{\color{blue}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\mathsf{neg}\left(z0\right)\right)}}}\right)\right) \]
      17. pow-flipN/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left(\frac{1}{\color{blue}{\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}}}\right)\right) \]
      18. lower-unsound-/.f32N/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left(\frac{1}{\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}}\right)}\right) \]
      19. lower-/.f32N/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left(\frac{1}{\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}}\right)}\right) \]
      20. neg-logN/A

        \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}\right)\right)\right)}\right) \]
    3. Applied rewrites53.4%

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

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

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

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

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

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

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

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

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

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

        \[\leadsto 2 \cdot \frac{\cos \left(\frac{1}{2} \cdot \color{blue}{\mathsf{PI}\left(\right)} - \pi \cdot z0\right) - \cos \left(\left(\left(-\pi\right) \cdot z0 + \pi \cdot \frac{1}{2}\right) + \pi \cdot z0\right)}{2} \]
      2. lower-PI.f644.8%

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

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

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

        \[\leadsto 2 \cdot \frac{\cos \left(\frac{1}{2} \cdot \pi - \pi \cdot z0\right) - \cos \left(\frac{1}{2} \cdot \color{blue}{\mathsf{PI}\left(\right)} + \pi \cdot z0\right)}{2} \]
      2. lower-PI.f6450.7%

        \[\leadsto 2 \cdot \frac{\cos \left(0.5 \cdot \pi - \pi \cdot z0\right) - \cos \left(0.5 \cdot \pi + \pi \cdot z0\right)}{2} \]
    11. Applied rewrites50.7%

      \[\leadsto 2 \cdot \frac{\cos \left(0.5 \cdot \pi - \pi \cdot z0\right) - \cos \left(\color{blue}{0.5 \cdot \pi} + \pi \cdot z0\right)}{2} \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 2: 85.6% accurate, 0.3× speedup?

\[\begin{array}{l} t_0 := \pi \cdot \left|z0\right|\\ t_1 := \left(\left(\left|z0\right| \cdot \left|z0\right|\right) \cdot \pi\right) \cdot \pi\\ \mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l} \mathbf{if}\;\left|z0\right| \leq 6 \cdot 10^{+16}:\\ \;\;\;\;\sin \left(\left(2.9291837751230467 \cdot \left|z0\right|\right) \cdot 2.1450293971110255\right)\\ \mathbf{elif}\;\left|z0\right| \leq 4.3 \cdot 10^{+153}:\\ \;\;\;\;\sin \left(\frac{0}{t\_0 \cdot 1 + \frac{\left(\left(-\pi\right) \cdot \left|z0\right|\right) \cdot t\_1}{t\_1}}\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(\left|z0\right| \cdot \left(t\_0 \cdot \frac{1}{t\_1}\right)\right) \cdot \left(\pi \cdot \left(\left(\left|z0\right| + \left|z0\right|\right) \cdot \pi\right)\right)\right)\\ \end{array} \end{array} \]
(FPCore (z0)
  :precision binary64
  (let* ((t_0 (* PI (fabs z0)))
       (t_1 (* (* (* (fabs z0) (fabs z0)) PI) PI)))
  (*
   (copysign 1.0 z0)
   (if (<= (fabs z0) 6e+16)
     (sin (* (* 2.9291837751230467 (fabs z0)) 2.1450293971110255))
     (if (<= (fabs z0) 4.3e+153)
       (sin
        (/ 0.0 (+ (* t_0 1.0) (/ (* (* (- PI) (fabs z0)) t_1) t_1))))
       (sin
        (*
         (* (fabs z0) (* t_0 (/ 1.0 t_1)))
         (* PI (* (+ (fabs z0) (fabs z0)) PI)))))))))
double code(double z0) {
	double t_0 = ((double) M_PI) * fabs(z0);
	double t_1 = ((fabs(z0) * fabs(z0)) * ((double) M_PI)) * ((double) M_PI);
	double tmp;
	if (fabs(z0) <= 6e+16) {
		tmp = sin(((2.9291837751230467 * fabs(z0)) * 2.1450293971110255));
	} else if (fabs(z0) <= 4.3e+153) {
		tmp = sin((0.0 / ((t_0 * 1.0) + (((-((double) M_PI) * fabs(z0)) * t_1) / t_1))));
	} else {
		tmp = sin(((fabs(z0) * (t_0 * (1.0 / t_1))) * (((double) M_PI) * ((fabs(z0) + fabs(z0)) * ((double) M_PI)))));
	}
	return copysign(1.0, z0) * tmp;
}
public static double code(double z0) {
	double t_0 = Math.PI * Math.abs(z0);
	double t_1 = ((Math.abs(z0) * Math.abs(z0)) * Math.PI) * Math.PI;
	double tmp;
	if (Math.abs(z0) <= 6e+16) {
		tmp = Math.sin(((2.9291837751230467 * Math.abs(z0)) * 2.1450293971110255));
	} else if (Math.abs(z0) <= 4.3e+153) {
		tmp = Math.sin((0.0 / ((t_0 * 1.0) + (((-Math.PI * Math.abs(z0)) * t_1) / t_1))));
	} else {
		tmp = Math.sin(((Math.abs(z0) * (t_0 * (1.0 / t_1))) * (Math.PI * ((Math.abs(z0) + Math.abs(z0)) * Math.PI))));
	}
	return Math.copySign(1.0, z0) * tmp;
}
def code(z0):
	t_0 = math.pi * math.fabs(z0)
	t_1 = ((math.fabs(z0) * math.fabs(z0)) * math.pi) * math.pi
	tmp = 0
	if math.fabs(z0) <= 6e+16:
		tmp = math.sin(((2.9291837751230467 * math.fabs(z0)) * 2.1450293971110255))
	elif math.fabs(z0) <= 4.3e+153:
		tmp = math.sin((0.0 / ((t_0 * 1.0) + (((-math.pi * math.fabs(z0)) * t_1) / t_1))))
	else:
		tmp = math.sin(((math.fabs(z0) * (t_0 * (1.0 / t_1))) * (math.pi * ((math.fabs(z0) + math.fabs(z0)) * math.pi))))
	return math.copysign(1.0, z0) * tmp
function code(z0)
	t_0 = Float64(pi * abs(z0))
	t_1 = Float64(Float64(Float64(abs(z0) * abs(z0)) * pi) * pi)
	tmp = 0.0
	if (abs(z0) <= 6e+16)
		tmp = sin(Float64(Float64(2.9291837751230467 * abs(z0)) * 2.1450293971110255));
	elseif (abs(z0) <= 4.3e+153)
		tmp = sin(Float64(0.0 / Float64(Float64(t_0 * 1.0) + Float64(Float64(Float64(Float64(-pi) * abs(z0)) * t_1) / t_1))));
	else
		tmp = sin(Float64(Float64(abs(z0) * Float64(t_0 * Float64(1.0 / t_1))) * Float64(pi * Float64(Float64(abs(z0) + abs(z0)) * pi))));
	end
	return Float64(copysign(1.0, z0) * tmp)
end
function tmp_2 = code(z0)
	t_0 = pi * abs(z0);
	t_1 = ((abs(z0) * abs(z0)) * pi) * pi;
	tmp = 0.0;
	if (abs(z0) <= 6e+16)
		tmp = sin(((2.9291837751230467 * abs(z0)) * 2.1450293971110255));
	elseif (abs(z0) <= 4.3e+153)
		tmp = sin((0.0 / ((t_0 * 1.0) + (((-pi * abs(z0)) * t_1) / t_1))));
	else
		tmp = sin(((abs(z0) * (t_0 * (1.0 / t_1))) * (pi * ((abs(z0) + abs(z0)) * pi))));
	end
	tmp_2 = (sign(z0) * abs(1.0)) * tmp;
end
code[z0_] := Block[{t$95$0 = N[(Pi * N[Abs[z0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[(N[Abs[z0], $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision] * Pi), $MachinePrecision]}, N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[z0], $MachinePrecision], 6e+16], N[Sin[N[(N[(2.9291837751230467 * N[Abs[z0], $MachinePrecision]), $MachinePrecision] * 2.1450293971110255), $MachinePrecision]], $MachinePrecision], If[LessEqual[N[Abs[z0], $MachinePrecision], 4.3e+153], N[Sin[N[(0.0 / N[(N[(t$95$0 * 1.0), $MachinePrecision] + N[(N[(N[((-Pi) * N[Abs[z0], $MachinePrecision]), $MachinePrecision] * t$95$1), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sin[N[(N[(N[Abs[z0], $MachinePrecision] * N[(t$95$0 * N[(1.0 / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(N[(N[Abs[z0], $MachinePrecision] + N[Abs[z0], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]]), $MachinePrecision]]]
\begin{array}{l}
t_0 := \pi \cdot \left|z0\right|\\
t_1 := \left(\left(\left|z0\right| \cdot \left|z0\right|\right) \cdot \pi\right) \cdot \pi\\
\mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|z0\right| \leq 6 \cdot 10^{+16}:\\
\;\;\;\;\sin \left(\left(2.9291837751230467 \cdot \left|z0\right|\right) \cdot 2.1450293971110255\right)\\

\mathbf{elif}\;\left|z0\right| \leq 4.3 \cdot 10^{+153}:\\
\;\;\;\;\sin \left(\frac{0}{t\_0 \cdot 1 + \frac{\left(\left(-\pi\right) \cdot \left|z0\right|\right) \cdot t\_1}{t\_1}}\right)\\

\mathbf{else}:\\
\;\;\;\;\sin \left(\left(\left|z0\right| \cdot \left(t\_0 \cdot \frac{1}{t\_1}\right)\right) \cdot \left(\pi \cdot \left(\left(\left|z0\right| + \left|z0\right|\right) \cdot \pi\right)\right)\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if z0 < 6e16

    1. Initial program 53.4%

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

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

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

        \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
      15. lower-cbrt.f6452.9%

        \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    3. Applied rewrites52.9%

      \[\leadsto \sin \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(z0 + z0\right)\right)\right)} \]
    4. Evaluated real constant53.4%

      \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{1.4645918875615234} \cdot \left(z0 + z0\right)\right)\right) \]
    5. Evaluated real constant53.4%

      \[\leadsto \sin \left(\color{blue}{2.1450293971110255} \cdot \left(1.4645918875615234 \cdot \left(z0 + z0\right)\right)\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\frac{4830176796763987}{2251799813685248} \cdot \left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)\right)} \]
      2. *-commutativeN/A

        \[\leadsto \sin \color{blue}{\left(\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right) \cdot \frac{4830176796763987}{2251799813685248}\right)} \]
      3. lower-*.f6453.4%

        \[\leadsto \sin \color{blue}{\left(\left(1.4645918875615234 \cdot \left(z0 + z0\right)\right) \cdot 2.1450293971110255\right)} \]
      4. lift-*.f64N/A

        \[\leadsto \sin \left(\color{blue}{\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      5. lift-+.f64N/A

        \[\leadsto \sin \left(\left(\frac{824491934883991}{562949953421312} \cdot \color{blue}{\left(z0 + z0\right)}\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      6. count-2N/A

        \[\leadsto \sin \left(\left(\frac{824491934883991}{562949953421312} \cdot \color{blue}{\left(2 \cdot z0\right)}\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      7. associate-*r*N/A

        \[\leadsto \sin \left(\color{blue}{\left(\left(\frac{824491934883991}{562949953421312} \cdot 2\right) \cdot z0\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      8. metadata-evalN/A

        \[\leadsto \sin \left(\left(\color{blue}{\frac{824491934883991}{281474976710656}} \cdot z0\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      9. metadata-evalN/A

        \[\leadsto \sin \left(\left(\color{blue}{\left(\frac{824491934883991}{562949953421312} + \frac{824491934883991}{562949953421312}\right)} \cdot z0\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      10. lower-*.f64N/A

        \[\leadsto \sin \left(\color{blue}{\left(\left(\frac{824491934883991}{562949953421312} + \frac{824491934883991}{562949953421312}\right) \cdot z0\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
      11. metadata-eval53.4%

        \[\leadsto \sin \left(\left(\color{blue}{2.9291837751230467} \cdot z0\right) \cdot 2.1450293971110255\right) \]
    7. Applied rewrites53.4%

      \[\leadsto \sin \color{blue}{\left(\left(2.9291837751230467 \cdot z0\right) \cdot 2.1450293971110255\right)} \]

    if 6e16 < z0 < 4.2999999999999998e153

    1. Initial program 53.4%

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

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

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

        \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
      15. lower-cbrt.f6452.9%

        \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    3. Applied rewrites52.9%

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

      \[\leadsto \sin \color{blue}{\left(\frac{0}{\left(\pi \cdot z0\right) \cdot 1 + \frac{\left(\left(-\pi\right) \cdot z0\right) \cdot \left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi\right)}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}}\right)} \]

    if 4.2999999999999998e153 < z0

    1. Initial program 53.4%

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

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

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

        \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
      15. lower-cbrt.f6452.9%

        \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    3. Applied rewrites52.9%

      \[\leadsto \sin \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(z0 + z0\right)\right)\right)} \]
    4. Applied rewrites19.8%

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

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

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

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

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

        \[\leadsto \sin \left(\frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi} \cdot \left(\color{blue}{\left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)} \cdot \left(z0 + z0\right)\right)\right) \]
      6. associate-*l*N/A

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

        \[\leadsto \sin \color{blue}{\left(\left(\frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi} \cdot \left(\left(z0 \cdot z0\right) \cdot \pi\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(z0 + z0\right)\right)\right)} \]
      8. lower-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\left(\frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi} \cdot \left(\left(z0 \cdot z0\right) \cdot \pi\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(z0 + z0\right)\right)\right)} \]
    6. Applied rewrites27.8%

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

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

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

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

        \[\leadsto \sin \left(\left(\left(\color{blue}{\left(z0 \cdot z0\right)} \cdot \pi\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      5. associate-*l*N/A

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

        \[\leadsto \sin \left(\left(\left(z0 \cdot \color{blue}{\left(z0 \cdot \pi\right)}\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \sin \left(\color{blue}{\left(z0 \cdot \left(\left(z0 \cdot \pi\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right)} \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto \sin \left(\color{blue}{\left(z0 \cdot \left(\left(z0 \cdot \pi\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right)} \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      9. lower-*.f6452.3%

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

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

        \[\leadsto \sin \left(\left(z0 \cdot \left(\color{blue}{\left(\pi \cdot z0\right)} \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      12. lower-*.f6452.3%

        \[\leadsto \sin \left(\left(z0 \cdot \left(\color{blue}{\left(\pi \cdot z0\right)} \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
    8. Applied rewrites52.3%

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

Alternative 3: 77.3% accurate, 0.4× speedup?

\[\mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l} \mathbf{if}\;\left|z0\right| \leq 1200:\\ \;\;\;\;\sin \left(6.283185307179586 \cdot \left|z0\right|\right)\\ \mathbf{else}:\\ \;\;\;\;\sin \left(\left(\left|z0\right| \cdot \left(\left(\pi \cdot \left|z0\right|\right) \cdot \frac{1}{\left(\left(\left|z0\right| \cdot \left|z0\right|\right) \cdot \pi\right) \cdot \pi}\right)\right) \cdot \left(\pi \cdot \left(\left(\left|z0\right| + \left|z0\right|\right) \cdot \pi\right)\right)\right)\\ \end{array} \]
(FPCore (z0)
  :precision binary64
  (*
 (copysign 1.0 z0)
 (if (<= (fabs z0) 1200.0)
   (sin (* 6.283185307179586 (fabs z0)))
   (sin
    (*
     (*
      (fabs z0)
      (*
       (* PI (fabs z0))
       (/ 1.0 (* (* (* (fabs z0) (fabs z0)) PI) PI))))
     (* PI (* (+ (fabs z0) (fabs z0)) PI)))))))
double code(double z0) {
	double tmp;
	if (fabs(z0) <= 1200.0) {
		tmp = sin((6.283185307179586 * fabs(z0)));
	} else {
		tmp = sin(((fabs(z0) * ((((double) M_PI) * fabs(z0)) * (1.0 / (((fabs(z0) * fabs(z0)) * ((double) M_PI)) * ((double) M_PI))))) * (((double) M_PI) * ((fabs(z0) + fabs(z0)) * ((double) M_PI)))));
	}
	return copysign(1.0, z0) * tmp;
}
public static double code(double z0) {
	double tmp;
	if (Math.abs(z0) <= 1200.0) {
		tmp = Math.sin((6.283185307179586 * Math.abs(z0)));
	} else {
		tmp = Math.sin(((Math.abs(z0) * ((Math.PI * Math.abs(z0)) * (1.0 / (((Math.abs(z0) * Math.abs(z0)) * Math.PI) * Math.PI)))) * (Math.PI * ((Math.abs(z0) + Math.abs(z0)) * Math.PI))));
	}
	return Math.copySign(1.0, z0) * tmp;
}
def code(z0):
	tmp = 0
	if math.fabs(z0) <= 1200.0:
		tmp = math.sin((6.283185307179586 * math.fabs(z0)))
	else:
		tmp = math.sin(((math.fabs(z0) * ((math.pi * math.fabs(z0)) * (1.0 / (((math.fabs(z0) * math.fabs(z0)) * math.pi) * math.pi)))) * (math.pi * ((math.fabs(z0) + math.fabs(z0)) * math.pi))))
	return math.copysign(1.0, z0) * tmp
function code(z0)
	tmp = 0.0
	if (abs(z0) <= 1200.0)
		tmp = sin(Float64(6.283185307179586 * abs(z0)));
	else
		tmp = sin(Float64(Float64(abs(z0) * Float64(Float64(pi * abs(z0)) * Float64(1.0 / Float64(Float64(Float64(abs(z0) * abs(z0)) * pi) * pi)))) * Float64(pi * Float64(Float64(abs(z0) + abs(z0)) * pi))));
	end
	return Float64(copysign(1.0, z0) * tmp)
end
function tmp_2 = code(z0)
	tmp = 0.0;
	if (abs(z0) <= 1200.0)
		tmp = sin((6.283185307179586 * abs(z0)));
	else
		tmp = sin(((abs(z0) * ((pi * abs(z0)) * (1.0 / (((abs(z0) * abs(z0)) * pi) * pi)))) * (pi * ((abs(z0) + abs(z0)) * pi))));
	end
	tmp_2 = (sign(z0) * abs(1.0)) * tmp;
end
code[z0_] := N[(N[With[{TMP1 = Abs[1.0], TMP2 = Sign[z0]}, TMP1 * If[TMP2 == 0, 1, TMP2]], $MachinePrecision] * If[LessEqual[N[Abs[z0], $MachinePrecision], 1200.0], N[Sin[N[(6.283185307179586 * N[Abs[z0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Sin[N[(N[(N[Abs[z0], $MachinePrecision] * N[(N[(Pi * N[Abs[z0], $MachinePrecision]), $MachinePrecision] * N[(1.0 / N[(N[(N[(N[Abs[z0], $MachinePrecision] * N[Abs[z0], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(Pi * N[(N[(N[Abs[z0], $MachinePrecision] + N[Abs[z0], $MachinePrecision]), $MachinePrecision] * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]]), $MachinePrecision]
\mathsf{copysign}\left(1, z0\right) \cdot \begin{array}{l}
\mathbf{if}\;\left|z0\right| \leq 1200:\\
\;\;\;\;\sin \left(6.283185307179586 \cdot \left|z0\right|\right)\\

\mathbf{else}:\\
\;\;\;\;\sin \left(\left(\left|z0\right| \cdot \left(\left(\pi \cdot \left|z0\right|\right) \cdot \frac{1}{\left(\left(\left|z0\right| \cdot \left|z0\right|\right) \cdot \pi\right) \cdot \pi}\right)\right) \cdot \left(\pi \cdot \left(\left(\left|z0\right| + \left|z0\right|\right) \cdot \pi\right)\right)\right)\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if z0 < 1200

    1. Initial program 53.4%

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

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

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

        \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
      15. lower-cbrt.f6452.9%

        \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    3. Applied rewrites52.9%

      \[\leadsto \sin \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(z0 + z0\right)\right)\right)} \]
    4. Evaluated real constant53.4%

      \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{1.4645918875615234} \cdot \left(z0 + z0\right)\right)\right) \]
    5. Evaluated real constant53.4%

      \[\leadsto \sin \left(\color{blue}{2.1450293971110255} \cdot \left(1.4645918875615234 \cdot \left(z0 + z0\right)\right)\right) \]
    6. Step-by-step derivation
      1. lift-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\frac{4830176796763987}{2251799813685248} \cdot \left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)\right)} \]
      2. lift-*.f64N/A

        \[\leadsto \sin \left(\frac{4830176796763987}{2251799813685248} \cdot \color{blue}{\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)}\right) \]
      3. associate-*r*N/A

        \[\leadsto \sin \color{blue}{\left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot \left(z0 + z0\right)\right)} \]
      4. lift-+.f64N/A

        \[\leadsto \sin \left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot \color{blue}{\left(z0 + z0\right)}\right) \]
      5. count-2N/A

        \[\leadsto \sin \left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot \color{blue}{\left(2 \cdot z0\right)}\right) \]
      6. associate-*r*N/A

        \[\leadsto \sin \color{blue}{\left(\left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot 2\right) \cdot z0\right)} \]
      7. lower-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot 2\right) \cdot z0\right)} \]
      8. metadata-evalN/A

        \[\leadsto \sin \left(\left(\color{blue}{\frac{3982441812995697399929051632117}{1267650600228229401496703205376}} \cdot 2\right) \cdot z0\right) \]
      9. metadata-eval53.4%

        \[\leadsto \sin \left(\color{blue}{6.283185307179586} \cdot z0\right) \]
    7. Applied rewrites53.4%

      \[\leadsto \sin \color{blue}{\left(6.283185307179586 \cdot z0\right)} \]

    if 1200 < z0

    1. Initial program 53.4%

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

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

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

        \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
      4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

        \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
      15. lower-cbrt.f6452.9%

        \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    3. Applied rewrites52.9%

      \[\leadsto \sin \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(z0 + z0\right)\right)\right)} \]
    4. Applied rewrites19.8%

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

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

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

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

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

        \[\leadsto \sin \left(\frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi} \cdot \left(\color{blue}{\left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)} \cdot \left(z0 + z0\right)\right)\right) \]
      6. associate-*l*N/A

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

        \[\leadsto \sin \color{blue}{\left(\left(\frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi} \cdot \left(\left(z0 \cdot z0\right) \cdot \pi\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(z0 + z0\right)\right)\right)} \]
      8. lower-*.f64N/A

        \[\leadsto \sin \color{blue}{\left(\left(\frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi} \cdot \left(\left(z0 \cdot z0\right) \cdot \pi\right)\right) \cdot \left(\left(\pi \cdot \pi\right) \cdot \left(z0 + z0\right)\right)\right)} \]
    6. Applied rewrites27.8%

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

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

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

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

        \[\leadsto \sin \left(\left(\left(\color{blue}{\left(z0 \cdot z0\right)} \cdot \pi\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      5. associate-*l*N/A

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

        \[\leadsto \sin \left(\left(\left(z0 \cdot \color{blue}{\left(z0 \cdot \pi\right)}\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      7. associate-*l*N/A

        \[\leadsto \sin \left(\color{blue}{\left(z0 \cdot \left(\left(z0 \cdot \pi\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right)} \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      8. lower-*.f64N/A

        \[\leadsto \sin \left(\color{blue}{\left(z0 \cdot \left(\left(z0 \cdot \pi\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right)} \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      9. lower-*.f6452.3%

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

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

        \[\leadsto \sin \left(\left(z0 \cdot \left(\color{blue}{\left(\pi \cdot z0\right)} \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
      12. lower-*.f6452.3%

        \[\leadsto \sin \left(\left(z0 \cdot \left(\color{blue}{\left(\pi \cdot z0\right)} \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right) \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
    8. Applied rewrites52.3%

      \[\leadsto \sin \left(\color{blue}{\left(z0 \cdot \left(\left(\pi \cdot z0\right) \cdot \frac{1}{\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \pi}\right)\right)} \cdot \left(\pi \cdot \left(\left(z0 + z0\right) \cdot \pi\right)\right)\right) \]
  3. Recombined 2 regimes into one program.
  4. Add Preprocessing

Alternative 4: 53.4% accurate, 1.0× speedup?

\[\sin \left(\left(2.9291837751230467 \cdot z0\right) \cdot 2.1450293971110255\right) \]
(FPCore (z0)
  :precision binary64
  (sin (* (* 2.9291837751230467 z0) 2.1450293971110255)))
double code(double z0) {
	return sin(((2.9291837751230467 * z0) * 2.1450293971110255));
}
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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    code = sin(((2.9291837751230467d0 * z0) * 2.1450293971110255d0))
end function
public static double code(double z0) {
	return Math.sin(((2.9291837751230467 * z0) * 2.1450293971110255));
}
def code(z0):
	return math.sin(((2.9291837751230467 * z0) * 2.1450293971110255))
function code(z0)
	return sin(Float64(Float64(2.9291837751230467 * z0) * 2.1450293971110255))
end
function tmp = code(z0)
	tmp = sin(((2.9291837751230467 * z0) * 2.1450293971110255));
end
code[z0_] := N[Sin[N[(N[(2.9291837751230467 * z0), $MachinePrecision] * 2.1450293971110255), $MachinePrecision]], $MachinePrecision]
\sin \left(\left(2.9291837751230467 \cdot z0\right) \cdot 2.1450293971110255\right)
Derivation
  1. Initial program 53.4%

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

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

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

      \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
    4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    15. lower-cbrt.f6452.9%

      \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
  3. Applied rewrites52.9%

    \[\leadsto \sin \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(z0 + z0\right)\right)\right)} \]
  4. Evaluated real constant53.4%

    \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{1.4645918875615234} \cdot \left(z0 + z0\right)\right)\right) \]
  5. Evaluated real constant53.4%

    \[\leadsto \sin \left(\color{blue}{2.1450293971110255} \cdot \left(1.4645918875615234 \cdot \left(z0 + z0\right)\right)\right) \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \sin \color{blue}{\left(\frac{4830176796763987}{2251799813685248} \cdot \left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)\right)} \]
    2. *-commutativeN/A

      \[\leadsto \sin \color{blue}{\left(\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right) \cdot \frac{4830176796763987}{2251799813685248}\right)} \]
    3. lower-*.f6453.4%

      \[\leadsto \sin \color{blue}{\left(\left(1.4645918875615234 \cdot \left(z0 + z0\right)\right) \cdot 2.1450293971110255\right)} \]
    4. lift-*.f64N/A

      \[\leadsto \sin \left(\color{blue}{\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
    5. lift-+.f64N/A

      \[\leadsto \sin \left(\left(\frac{824491934883991}{562949953421312} \cdot \color{blue}{\left(z0 + z0\right)}\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
    6. count-2N/A

      \[\leadsto \sin \left(\left(\frac{824491934883991}{562949953421312} \cdot \color{blue}{\left(2 \cdot z0\right)}\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
    7. associate-*r*N/A

      \[\leadsto \sin \left(\color{blue}{\left(\left(\frac{824491934883991}{562949953421312} \cdot 2\right) \cdot z0\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
    8. metadata-evalN/A

      \[\leadsto \sin \left(\left(\color{blue}{\frac{824491934883991}{281474976710656}} \cdot z0\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
    9. metadata-evalN/A

      \[\leadsto \sin \left(\left(\color{blue}{\left(\frac{824491934883991}{562949953421312} + \frac{824491934883991}{562949953421312}\right)} \cdot z0\right) \cdot \frac{4830176796763987}{2251799813685248}\right) \]
    10. lower-*.f64N/A

      \[\leadsto \sin \left(\color{blue}{\left(\left(\frac{824491934883991}{562949953421312} + \frac{824491934883991}{562949953421312}\right) \cdot z0\right)} \cdot \frac{4830176796763987}{2251799813685248}\right) \]
    11. metadata-eval53.4%

      \[\leadsto \sin \left(\left(\color{blue}{2.9291837751230467} \cdot z0\right) \cdot 2.1450293971110255\right) \]
  7. Applied rewrites53.4%

    \[\leadsto \sin \color{blue}{\left(\left(2.9291837751230467 \cdot z0\right) \cdot 2.1450293971110255\right)} \]
  8. Add Preprocessing

Alternative 5: 53.4% accurate, 1.0× speedup?

\[\sin \left(6.283185307179586 \cdot z0\right) \]
(FPCore (z0)
  :precision binary64
  (sin (* 6.283185307179586 z0)))
double code(double z0) {
	return sin((6.283185307179586 * z0));
}
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(z0)
use fmin_fmax_functions
    real(8), intent (in) :: z0
    code = sin((6.283185307179586d0 * z0))
end function
public static double code(double z0) {
	return Math.sin((6.283185307179586 * z0));
}
def code(z0):
	return math.sin((6.283185307179586 * z0))
function code(z0)
	return sin(Float64(6.283185307179586 * z0))
end
function tmp = code(z0)
	tmp = sin((6.283185307179586 * z0));
end
code[z0_] := N[Sin[N[(6.283185307179586 * z0), $MachinePrecision]], $MachinePrecision]
\sin \left(6.283185307179586 \cdot z0\right)
Derivation
  1. Initial program 53.4%

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

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

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

      \[\leadsto \sin \left(\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)} \cdot \left(z0 + z0\right)\right) \]
    4. associate-*l*N/A

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

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

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

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

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

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

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

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

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

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

      \[\leadsto \sin \left({\pi}^{\frac{2}{3}} \cdot \left(\sqrt[3]{\color{blue}{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
    15. lower-cbrt.f6452.9%

      \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{\sqrt[3]{\pi}} \cdot \left(z0 + z0\right)\right)\right) \]
  3. Applied rewrites52.9%

    \[\leadsto \sin \color{blue}{\left({\pi}^{0.6666666666666666} \cdot \left(\sqrt[3]{\pi} \cdot \left(z0 + z0\right)\right)\right)} \]
  4. Evaluated real constant53.4%

    \[\leadsto \sin \left({\pi}^{0.6666666666666666} \cdot \left(\color{blue}{1.4645918875615234} \cdot \left(z0 + z0\right)\right)\right) \]
  5. Evaluated real constant53.4%

    \[\leadsto \sin \left(\color{blue}{2.1450293971110255} \cdot \left(1.4645918875615234 \cdot \left(z0 + z0\right)\right)\right) \]
  6. Step-by-step derivation
    1. lift-*.f64N/A

      \[\leadsto \sin \color{blue}{\left(\frac{4830176796763987}{2251799813685248} \cdot \left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)\right)} \]
    2. lift-*.f64N/A

      \[\leadsto \sin \left(\frac{4830176796763987}{2251799813685248} \cdot \color{blue}{\left(\frac{824491934883991}{562949953421312} \cdot \left(z0 + z0\right)\right)}\right) \]
    3. associate-*r*N/A

      \[\leadsto \sin \color{blue}{\left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot \left(z0 + z0\right)\right)} \]
    4. lift-+.f64N/A

      \[\leadsto \sin \left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot \color{blue}{\left(z0 + z0\right)}\right) \]
    5. count-2N/A

      \[\leadsto \sin \left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot \color{blue}{\left(2 \cdot z0\right)}\right) \]
    6. associate-*r*N/A

      \[\leadsto \sin \color{blue}{\left(\left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot 2\right) \cdot z0\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \sin \color{blue}{\left(\left(\left(\frac{4830176796763987}{2251799813685248} \cdot \frac{824491934883991}{562949953421312}\right) \cdot 2\right) \cdot z0\right)} \]
    8. metadata-evalN/A

      \[\leadsto \sin \left(\left(\color{blue}{\frac{3982441812995697399929051632117}{1267650600228229401496703205376}} \cdot 2\right) \cdot z0\right) \]
    9. metadata-eval53.4%

      \[\leadsto \sin \left(\color{blue}{6.283185307179586} \cdot z0\right) \]
  7. Applied rewrites53.4%

    \[\leadsto \sin \color{blue}{\left(6.283185307179586 \cdot z0\right)} \]
  8. Add Preprocessing

Alternative 6: 51.1% accurate, 2.9× speedup?

\[z0 \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right) \]
(FPCore (z0)
  :precision binary64
  (*
 z0
 (- (+ PI PI) (* 1.3333333333333333 (* (* (* z0 z0) PI) (* PI PI))))))
double code(double z0) {
	return z0 * ((((double) M_PI) + ((double) M_PI)) - (1.3333333333333333 * (((z0 * z0) * ((double) M_PI)) * (((double) M_PI) * ((double) M_PI)))));
}
public static double code(double z0) {
	return z0 * ((Math.PI + Math.PI) - (1.3333333333333333 * (((z0 * z0) * Math.PI) * (Math.PI * Math.PI))));
}
def code(z0):
	return z0 * ((math.pi + math.pi) - (1.3333333333333333 * (((z0 * z0) * math.pi) * (math.pi * math.pi))))
function code(z0)
	return Float64(z0 * Float64(Float64(pi + pi) - Float64(1.3333333333333333 * Float64(Float64(Float64(z0 * z0) * pi) * Float64(pi * pi)))))
end
function tmp = code(z0)
	tmp = z0 * ((pi + pi) - (1.3333333333333333 * (((z0 * z0) * pi) * (pi * pi))));
end
code[z0_] := N[(z0 * N[(N[(Pi + Pi), $MachinePrecision] - N[(1.3333333333333333 * N[(N[(N[(z0 * z0), $MachinePrecision] * Pi), $MachinePrecision] * N[(Pi * Pi), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
z0 \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right)
Derivation
  1. Initial program 53.4%

    \[\sin \left(\pi \cdot \left(z0 + z0\right)\right) \]
  2. Taylor expanded in z0 around 0

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

      \[\leadsto z0 \cdot \color{blue}{\left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right)} \]
    2. lower-+.f64N/A

      \[\leadsto z0 \cdot \left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2 \cdot \mathsf{PI}\left(\right)}\right) \]
    3. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + \color{blue}{2} \cdot \mathsf{PI}\left(\right)\right) \]
    4. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right) \]
    5. lower-pow.f64N/A

      \[\leadsto z0 \cdot \left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right) \]
    6. lower-pow.f64N/A

      \[\leadsto z0 \cdot \left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\mathsf{PI}\left(\right)}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right) \]
    7. lower-PI.f64N/A

      \[\leadsto z0 \cdot \left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \mathsf{PI}\left(\right)\right) \]
    8. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(\frac{-4}{3} \cdot \left({z0}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    9. lower-PI.f6451.1%

      \[\leadsto z0 \cdot \left(-1.3333333333333333 \cdot \left({z0}^{2} \cdot {\pi}^{3}\right) + 2 \cdot \pi\right) \]
  4. Applied rewrites51.1%

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

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

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

      \[\leadsto z0 \cdot \left(2 \cdot \pi + \frac{-4}{3} \cdot \color{blue}{\left({z0}^{2} \cdot {\pi}^{3}\right)}\right) \]
    4. fp-cancel-sign-sub-invN/A

      \[\leadsto z0 \cdot \left(2 \cdot \pi - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right) \cdot \left({z0}^{2} \cdot {\pi}^{3}\right)}\right) \]
    5. lower--.f64N/A

      \[\leadsto z0 \cdot \left(2 \cdot \pi - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right) \cdot \left({z0}^{2} \cdot {\pi}^{3}\right)}\right) \]
    6. lift-*.f64N/A

      \[\leadsto z0 \cdot \left(2 \cdot \pi - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right)} \cdot \left({z0}^{2} \cdot {\pi}^{3}\right)\right) \]
    7. count-2-revN/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \color{blue}{\left(\mathsf{neg}\left(\frac{-4}{3}\right)\right)} \cdot \left({z0}^{2} \cdot {\pi}^{3}\right)\right) \]
    8. lower-+.f64N/A

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

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \left(\mathsf{neg}\left(\frac{-4}{3}\right)\right) \cdot \color{blue}{\left({z0}^{2} \cdot {\pi}^{3}\right)}\right) \]
    10. metadata-eval51.1%

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\color{blue}{{z0}^{2}} \cdot {\pi}^{3}\right)\right) \]
    11. lift-*.f64N/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left({z0}^{2} \cdot \color{blue}{{\pi}^{3}}\right)\right) \]
    12. lift-pow.f64N/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left({z0}^{2} \cdot {\pi}^{\color{blue}{3}}\right)\right) \]
    13. cube-multN/A

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

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({z0}^{2} \cdot \pi\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right) \]
    15. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({z0}^{2} \cdot \pi\right) \cdot \color{blue}{\left(\pi \cdot \pi\right)}\right)\right) \]
    16. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({z0}^{2} \cdot \pi\right) \cdot \left(\color{blue}{\pi} \cdot \pi\right)\right)\right) \]
    17. lift-pow.f64N/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left({z0}^{2} \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right) \]
    18. unpow2N/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right) \]
    19. lower-*.f64N/A

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \frac{4}{3} \cdot \left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)\right) \]
    20. lower-*.f6451.1%

      \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - 1.3333333333333333 \cdot \left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \color{blue}{\pi}\right)\right)\right) \]
  6. Applied rewrites51.1%

    \[\leadsto z0 \cdot \left(\left(\pi + \pi\right) - \color{blue}{1.3333333333333333 \cdot \left(\left(\left(z0 \cdot z0\right) \cdot \pi\right) \cdot \left(\pi \cdot \pi\right)\right)}\right) \]
  7. Add Preprocessing

Alternative 7: 51.1% accurate, 12.1× speedup?

\[\left(z0 + z0\right) \cdot \pi \]
(FPCore (z0)
  :precision binary64
  (* (+ z0 z0) PI))
double code(double z0) {
	return (z0 + z0) * ((double) M_PI);
}
public static double code(double z0) {
	return (z0 + z0) * Math.PI;
}
def code(z0):
	return (z0 + z0) * math.pi
function code(z0)
	return Float64(Float64(z0 + z0) * pi)
end
function tmp = code(z0)
	tmp = (z0 + z0) * pi;
end
code[z0_] := N[(N[(z0 + z0), $MachinePrecision] * Pi), $MachinePrecision]
\left(z0 + z0\right) \cdot \pi
Derivation
  1. Initial program 53.4%

    \[\sin \left(\pi \cdot \left(z0 + z0\right)\right) \]
  2. Step-by-step derivation
    1. lift-sin.f64N/A

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

      \[\leadsto \sin \color{blue}{\left(\pi \cdot \left(z0 + z0\right)\right)} \]
    3. lift-+.f64N/A

      \[\leadsto \sin \left(\pi \cdot \color{blue}{\left(z0 + z0\right)}\right) \]
    4. distribute-lft-inN/A

      \[\leadsto \sin \color{blue}{\left(\pi \cdot z0 + \pi \cdot z0\right)} \]
    5. count-2N/A

      \[\leadsto \sin \color{blue}{\left(2 \cdot \left(\pi \cdot z0\right)\right)} \]
    6. sin-2N/A

      \[\leadsto \color{blue}{2 \cdot \left(\sin \left(\pi \cdot z0\right) \cdot \cos \left(\pi \cdot z0\right)\right)} \]
    7. lower-*.f64N/A

      \[\leadsto \color{blue}{2 \cdot \left(\sin \left(\pi \cdot z0\right) \cdot \cos \left(\pi \cdot z0\right)\right)} \]
    8. *-commutativeN/A

      \[\leadsto 2 \cdot \color{blue}{\left(\cos \left(\pi \cdot z0\right) \cdot \sin \left(\pi \cdot z0\right)\right)} \]
    9. lower-*.f64N/A

      \[\leadsto 2 \cdot \color{blue}{\left(\cos \left(\pi \cdot z0\right) \cdot \sin \left(\pi \cdot z0\right)\right)} \]
    10. rem-log-expN/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \color{blue}{\log \left(e^{\pi \cdot z0}\right)}\right) \]
    11. pow-expN/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left({\left(e^{\pi}\right)}^{z0}\right)}\right) \]
    12. lift-PI.f64N/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left({\left(e^{\color{blue}{\mathsf{PI}\left(\right)}}\right)}^{z0}\right)\right) \]
    13. remove-double-negN/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left({\left(e^{\mathsf{PI}\left(\right)}\right)}^{\color{blue}{\left(\mathsf{neg}\left(\left(\mathsf{neg}\left(z0\right)\right)\right)\right)}}\right)\right) \]
    14. pow-negN/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left(\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\mathsf{neg}\left(z0\right)\right)}}\right)}\right) \]
    15. lower-unsound-pow.f32N/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left(\frac{1}{\color{blue}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\mathsf{neg}\left(z0\right)\right)}}}\right)\right) \]
    16. lower-pow.f32N/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left(\frac{1}{\color{blue}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{\left(\mathsf{neg}\left(z0\right)\right)}}}\right)\right) \]
    17. pow-flipN/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \left(\frac{1}{\color{blue}{\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}}}\right)\right) \]
    18. lower-unsound-/.f32N/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left(\frac{1}{\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}}\right)}\right) \]
    19. lower-/.f32N/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \log \color{blue}{\left(\frac{1}{\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}}\right)}\right) \]
    20. neg-logN/A

      \[\leadsto 2 \cdot \left(\cos \left(\pi \cdot z0\right) \cdot \sin \color{blue}{\left(\mathsf{neg}\left(\log \left(\frac{1}{{\left(e^{\mathsf{PI}\left(\right)}\right)}^{z0}}\right)\right)\right)}\right) \]
  3. Applied rewrites53.4%

    \[\leadsto \color{blue}{2 \cdot \left(\cos \left(z0 \cdot \pi\right) \cdot \sin \left(z0 \cdot \pi\right)\right)} \]
  4. Taylor expanded in z0 around 0

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

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

      \[\leadsto 2 \cdot \left(z0 \cdot \color{blue}{\mathsf{PI}\left(\right)}\right) \]
    3. lower-PI.f6451.1%

      \[\leadsto 2 \cdot \left(z0 \cdot \pi\right) \]
  6. Applied rewrites51.1%

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

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

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

      \[\leadsto \left(2 \cdot z0\right) \cdot \color{blue}{\pi} \]
    4. count-2N/A

      \[\leadsto \left(z0 + z0\right) \cdot \pi \]
    5. lift-+.f64N/A

      \[\leadsto \left(z0 + z0\right) \cdot \pi \]
    6. lower-*.f6451.1%

      \[\leadsto \left(z0 + z0\right) \cdot \color{blue}{\pi} \]
  8. Applied rewrites51.1%

    \[\leadsto \left(z0 + z0\right) \cdot \color{blue}{\pi} \]
  9. Add Preprocessing

Reproduce

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