Gyroid sphere

Percentage Accurate: 46.0% → 89.3%
Time: 9.9s
Alternatives: 16
Speedup: 4.8×

Specification

?
\[\begin{array}{l} \\ \mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (fmax
  (-
   (sqrt
    (+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0)))
   25.0)
  (-
   (fabs
    (+
     (+
      (* (sin (* x 30.0)) (cos (* y 30.0)))
      (* (sin (* y 30.0)) (cos (* z 30.0))))
     (* (sin (* z 30.0)) (cos (* x 30.0)))))
   0.2)))
double code(double x, double y, double z) {
	return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
	return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z):
	return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z)
	return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2))
end
function tmp = code(x, y, z)
	tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
\end{array}

Sampling outcomes in binary64 precision:

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

\[\begin{array}{l} \\ \mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (fmax
  (-
   (sqrt
    (+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0)))
   25.0)
  (-
   (fabs
    (+
     (+
      (* (sin (* x 30.0)) (cos (* y 30.0)))
      (* (sin (* y 30.0)) (cos (* z 30.0))))
     (* (sin (* z 30.0)) (cos (* x 30.0)))))
   0.2)))
double code(double x, double y, double z) {
	return fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    code = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs((((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))) + (sin((z * 30.0d0)) * cos((x * 30.0d0))))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
	return fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs((((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))) + (Math.sin((z * 30.0)) * Math.cos((x * 30.0))))) - 0.2));
}
def code(x, y, z):
	return fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs((((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))) + (math.sin((z * 30.0)) * math.cos((x * 30.0))))) - 0.2))
function code(x, y, z)
	return fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))) + Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))))) - 0.2))
end
function tmp = code(x, y, z)
	tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs((((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))) + (sin((z * 30.0)) * cos((x * 30.0))))) - 0.2));
end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
\end{array}

Alternative 1: 89.3% accurate, 1.2× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(z \cdot 30\right)\\ t_1 := \sin \left(30 \cdot x\right)\\ \mathbf{if}\;x \leq -8 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), t\_1\right)\right| - 0.2\right)\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0 \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_1\right| - 0.2\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (sin (* z 30.0))) (t_1 (sin (* 30.0 x))))
   (if (<= x -8e+37)
     (fmax
      (- (hypot (* -30.0 z) (* -30.0 x)) 25.0)
      (- (fabs (fma t_0 (cos (* -30.0 x)) t_1)) 0.2))
     (if (<= x 9e+154)
       (fmax
        (- (hypot (* -30.0 z) (* -30.0 y)) 25.0)
        (-
         (fabs
          (+
           (* t_0 (cos (* x 30.0)))
           (+
            (* (sin (* x 30.0)) (cos (* y 30.0)))
            (* (sin (* y 30.0)) (cos (* z 30.0))))))
         0.2))
       (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs t_1) 0.2))))))
double code(double x, double y, double z) {
	double t_0 = sin((z * 30.0));
	double t_1 = sin((30.0 * x));
	double tmp;
	if (x <= -8e+37) {
		tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), (fabs(fma(t_0, cos((-30.0 * x)), t_1)) - 0.2));
	} else if (x <= 9e+154) {
		tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), (fabs(((t_0 * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2));
	} else {
		tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(t_1) - 0.2));
	}
	return tmp;
}
function code(x, y, z)
	t_0 = sin(Float64(z * 30.0))
	t_1 = sin(Float64(30.0 * x))
	tmp = 0.0
	if (x <= -8e+37)
		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), t_1)) - 0.2));
	elseif (x <= 9e+154)
		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), Float64(abs(Float64(Float64(t_0 * cos(Float64(x * 30.0))) + Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))))) - 0.2));
	else
		tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(t_1) - 0.2));
	end
	return tmp
end
code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[x, -8e+37], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$0 * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + t$95$1), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 9e+154], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$1], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \sin \left(30 \cdot x\right)\\
\mathbf{if}\;x \leq -8 \cdot 10^{+37}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), t\_1\right)\right| - 0.2\right)\\

\mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0 \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_1\right| - 0.2\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 3 regimes
  2. if x < -7.99999999999999963e37

    1. Initial program 28.6%

      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    2. Add Preprocessing
    3. Taylor expanded in y around 0

      \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
    4. Step-by-step derivation
      1. Applied rewrites86.3%

        \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
      2. Taylor expanded in y around 0

        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
      3. Step-by-step derivation
        1. Applied rewrites86.3%

          \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]

        if -7.99999999999999963e37 < x < 9.00000000000000018e154

        1. Initial program 56.9%

          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
        2. Add Preprocessing
        3. Taylor expanded in x around 0

          \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
        4. Step-by-step derivation
          1. Applied rewrites95.6%

            \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]

          if 9.00000000000000018e154 < x

          1. Initial program 7.6%

            \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
          2. Add Preprocessing
          3. Taylor expanded in z around 0

            \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
          4. Step-by-step derivation
            1. Applied rewrites97.2%

              \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
            2. Taylor expanded in y around 0

              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
            3. Step-by-step derivation
              1. Applied rewrites97.2%

                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
              2. Taylor expanded in z around 0

                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
              3. Step-by-step derivation
                1. Applied rewrites97.2%

                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
              4. Recombined 3 regimes into one program.
              5. Final simplification93.6%

                \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -8 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\ \end{array} \]
              6. Add Preprocessing

              Alternative 2: 43.5% accurate, 0.8× speedup?

              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right) \leq 50000000:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\ \end{array} \end{array} \]
              (FPCore (x y z)
               :precision binary64
               (if (<=
                    (fmax
                     (-
                      (sqrt
                       (+
                        (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
                        (pow (* z 30.0) 2.0)))
                      25.0)
                     (-
                      (fabs
                       (+
                        (* (sin (* z 30.0)) (cos (* x 30.0)))
                        (+
                         (* (sin (* x 30.0)) (cos (* y 30.0)))
                         (* (sin (* y 30.0)) (cos (* z 30.0))))))
                      0.2))
                    50000000.0)
                 (fmax (- (* -30.0 x) 25.0) (- (fabs (sin (* 30.0 x))) 0.2))
                 (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))))
              double code(double x, double y, double z) {
              	double tmp;
              	if (fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), (fabs(((sin((z * 30.0)) * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2)) <= 50000000.0) {
              		tmp = fmax(((-30.0 * x) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
              	} else {
              		tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
              	}
              	return tmp;
              }
              
              module fmin_fmax_functions
                  implicit none
                  private
                  public fmax
                  public fmin
              
                  interface fmax
                      module procedure fmax88
                      module procedure fmax44
                      module procedure fmax84
                      module procedure fmax48
                  end interface
                  interface fmin
                      module procedure fmin88
                      module procedure fmin44
                      module procedure fmin84
                      module procedure fmin48
                  end interface
              contains
                  real(8) function fmax88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmax44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmax84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmax48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                  end function
                  real(8) function fmin88(x, y) result (res)
                      real(8), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(4) function fmin44(x, y) result (res)
                      real(4), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                  end function
                  real(8) function fmin84(x, y) result(res)
                      real(8), intent (in) :: x
                      real(4), intent (in) :: y
                      res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                  end function
                  real(8) function fmin48(x, y) result(res)
                      real(4), intent (in) :: x
                      real(8), intent (in) :: y
                      res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                  end function
              end module
              
              real(8) function code(x, y, z)
              use fmin_fmax_functions
                  real(8), intent (in) :: x
                  real(8), intent (in) :: y
                  real(8), intent (in) :: z
                  real(8) :: tmp
                  if (fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), (abs(((sin((z * 30.0d0)) * cos((x * 30.0d0))) + ((sin((x * 30.0d0)) * cos((y * 30.0d0))) + (sin((y * 30.0d0)) * cos((z * 30.0d0)))))) - 0.2d0)) <= 50000000.0d0) then
                      tmp = fmax((((-30.0d0) * x) - 25.0d0), (abs(sin((30.0d0 * x))) - 0.2d0))
                  else
                      tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
                  end if
                  code = tmp
              end function
              
              public static double code(double x, double y, double z) {
              	double tmp;
              	if (fmax((Math.sqrt(((Math.pow((x * 30.0), 2.0) + Math.pow((y * 30.0), 2.0)) + Math.pow((z * 30.0), 2.0))) - 25.0), (Math.abs(((Math.sin((z * 30.0)) * Math.cos((x * 30.0))) + ((Math.sin((x * 30.0)) * Math.cos((y * 30.0))) + (Math.sin((y * 30.0)) * Math.cos((z * 30.0)))))) - 0.2)) <= 50000000.0) {
              		tmp = fmax(((-30.0 * x) - 25.0), (Math.abs(Math.sin((30.0 * x))) - 0.2));
              	} else {
              		tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
              	}
              	return tmp;
              }
              
              def code(x, y, z):
              	tmp = 0
              	if fmax((math.sqrt(((math.pow((x * 30.0), 2.0) + math.pow((y * 30.0), 2.0)) + math.pow((z * 30.0), 2.0))) - 25.0), (math.fabs(((math.sin((z * 30.0)) * math.cos((x * 30.0))) + ((math.sin((x * 30.0)) * math.cos((y * 30.0))) + (math.sin((y * 30.0)) * math.cos((z * 30.0)))))) - 0.2)) <= 50000000.0:
              		tmp = fmax(((-30.0 * x) - 25.0), (math.fabs(math.sin((30.0 * x))) - 0.2))
              	else:
              		tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2))
              	return tmp
              
              function code(x, y, z)
              	tmp = 0.0
              	if (fmax(Float64(sqrt(Float64(Float64((Float64(x * 30.0) ^ 2.0) + (Float64(y * 30.0) ^ 2.0)) + (Float64(z * 30.0) ^ 2.0))) - 25.0), Float64(abs(Float64(Float64(sin(Float64(z * 30.0)) * cos(Float64(x * 30.0))) + Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))))) - 0.2)) <= 50000000.0)
              		tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2));
              	else
              		tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2));
              	end
              	return tmp
              end
              
              function tmp_2 = code(x, y, z)
              	tmp = 0.0;
              	if (max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), (abs(((sin((z * 30.0)) * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2)) <= 50000000.0)
              		tmp = max(((-30.0 * x) - 25.0), (abs(sin((30.0 * x))) - 0.2));
              	else
              		tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2));
              	end
              	tmp_2 = tmp;
              end
              
              code[x_, y_, z_] := If[LessEqual[N[Max[N[(N[Sqrt[N[(N[(N[Power[N[(x * 30.0), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(y * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision] + N[Power[N[(z * 30.0), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], 50000000.0], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
              
              \begin{array}{l}
              
              \\
              \begin{array}{l}
              \mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right) \leq 50000000:\\
              \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
              
              \mathbf{else}:\\
              \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
              
              
              \end{array}
              \end{array}
              
              Derivation
              1. Split input into 2 regimes
              2. if (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64))) < 5e7

                1. Initial program 99.9%

                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                2. Add Preprocessing
                3. Taylor expanded in z around 0

                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                4. Step-by-step derivation
                  1. Applied rewrites97.5%

                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                  2. Taylor expanded in y around 0

                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                  3. Step-by-step derivation
                    1. Applied rewrites94.0%

                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                    2. Taylor expanded in z around 0

                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                    3. Step-by-step derivation
                      1. Applied rewrites91.8%

                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                      2. Taylor expanded in x around -inf

                        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                      3. Step-by-step derivation
                        1. Applied rewrites89.5%

                          \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]

                        if 5e7 < (fmax.f64 (-.f64 (sqrt.f64 (+.f64 (+.f64 (pow.f64 (*.f64 x #s(literal 30 binary64)) #s(literal 2 binary64)) (pow.f64 (*.f64 y #s(literal 30 binary64)) #s(literal 2 binary64))) (pow.f64 (*.f64 z #s(literal 30 binary64)) #s(literal 2 binary64)))) #s(literal 25 binary64)) (-.f64 (fabs.f64 (+.f64 (+.f64 (*.f64 (sin.f64 (*.f64 x #s(literal 30 binary64))) (cos.f64 (*.f64 y #s(literal 30 binary64)))) (*.f64 (sin.f64 (*.f64 y #s(literal 30 binary64))) (cos.f64 (*.f64 z #s(literal 30 binary64))))) (*.f64 (sin.f64 (*.f64 z #s(literal 30 binary64))) (cos.f64 (*.f64 x #s(literal 30 binary64)))))) #s(literal 1/5 binary64)))

                        1. Initial program 34.4%

                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                        2. Add Preprocessing
                        3. Taylor expanded in x around -inf

                          \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                        4. Step-by-step derivation
                          1. Applied rewrites19.2%

                            \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                          2. Taylor expanded in z around 0

                            \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)}\right| - \frac{1}{5}\right) \]
                          3. Step-by-step derivation
                            1. Applied rewrites18.7%

                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \cos \left(-30 \cdot y\right), \sin \left(y \cdot 30\right)\right)}\right| - 0.2\right) \]
                            2. Taylor expanded in y around 0

                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                            3. Step-by-step derivation
                              1. Applied rewrites18.2%

                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                              2. Taylor expanded in x around 0

                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - \frac{1}{5}\right) \]
                              3. Step-by-step derivation
                                1. Applied rewrites32.9%

                                  \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right) \]
                              4. Recombined 2 regimes into one program.
                              5. Final simplification41.1%

                                \[\leadsto \begin{array}{l} \mathbf{if}\;\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right) \leq 50000000:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\ \end{array} \]
                              6. Add Preprocessing

                              Alternative 3: 90.6% accurate, 1.2× speedup?

                              \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(z \cdot 30\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+65}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_0 \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\ \end{array} \end{array} \]
                              (FPCore (x y z)
                               :precision binary64
                               (let* ((t_0 (sin (* z 30.0))))
                                 (if (<= z -3.2e+15)
                                   (fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))
                                   (if (<= z 2.25e+65)
                                     (fmax
                                      (- (hypot (* -30.0 x) (* -30.0 y)) 25.0)
                                      (-
                                       (fabs
                                        (+
                                         (* t_0 (cos (* x 30.0)))
                                         (+
                                          (* (sin (* x 30.0)) (cos (* y 30.0)))
                                          (* (sin (* y 30.0)) (cos (* z 30.0))))))
                                       0.2))
                                     (fmax
                                      (- (hypot (* -30.0 z) (* -30.0 x)) 25.0)
                                      (- (fabs (fma t_0 (cos (* -30.0 x)) (sin (* 30.0 x)))) 0.2))))))
                              double code(double x, double y, double z) {
                              	double t_0 = sin((z * 30.0));
                              	double tmp;
                              	if (z <= -3.2e+15) {
                              		tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
                              	} else if (z <= 2.25e+65) {
                              		tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(((t_0 * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (sin((y * 30.0)) * cos((z * 30.0)))))) - 0.2));
                              	} else {
                              		tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), (fabs(fma(t_0, cos((-30.0 * x)), sin((30.0 * x)))) - 0.2));
                              	}
                              	return tmp;
                              }
                              
                              function code(x, y, z)
                              	t_0 = sin(Float64(z * 30.0))
                              	tmp = 0.0
                              	if (z <= -3.2e+15)
                              		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), Float64(abs(t_0) - 0.2));
                              	elseif (z <= 2.25e+65)
                              		tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(Float64(Float64(t_0 * cos(Float64(x * 30.0))) + Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(sin(Float64(y * 30.0)) * cos(Float64(z * 30.0)))))) - 0.2));
                              	else
                              		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), sin(Float64(30.0 * x)))) - 0.2));
                              	end
                              	return tmp
                              end
                              
                              code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[z, -3.2e+15], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.25e+65], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(t$95$0 * N[Cos[N[(x * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[(N[Sin[N[(x * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(y * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$0 * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]
                              
                              \begin{array}{l}
                              
                              \\
                              \begin{array}{l}
                              t_0 := \sin \left(z \cdot 30\right)\\
                              \mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\
                              \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
                              
                              \mathbf{elif}\;z \leq 2.25 \cdot 10^{+65}:\\
                              \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_0 \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right)\\
                              
                              \mathbf{else}:\\
                              \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
                              
                              
                              \end{array}
                              \end{array}
                              
                              Derivation
                              1. Split input into 3 regimes
                              2. if z < -3.2e15

                                1. Initial program 42.1%

                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                2. Add Preprocessing
                                3. Taylor expanded in x around 0

                                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                4. Step-by-step derivation
                                  1. Applied rewrites89.7%

                                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                  2. Taylor expanded in y around 0

                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                  3. Step-by-step derivation
                                    1. Applied rewrites89.7%

                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                    2. Taylor expanded in x around 0

                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                    3. Step-by-step derivation
                                      1. Applied rewrites89.7%

                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]

                                      if -3.2e15 < z < 2.25e65

                                      1. Initial program 53.7%

                                        \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                      2. Add Preprocessing
                                      3. Taylor expanded in z around 0

                                        \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                      4. Step-by-step derivation
                                        1. Applied rewrites98.6%

                                          \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]

                                        if 2.25e65 < z

                                        1. Initial program 22.9%

                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                        2. Add Preprocessing
                                        3. Taylor expanded in y around 0

                                          \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                        4. Step-by-step derivation
                                          1. Applied rewrites86.0%

                                            \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                          2. Taylor expanded in y around 0

                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                          3. Step-by-step derivation
                                            1. Applied rewrites86.0%

                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                          4. Recombined 3 regimes into one program.
                                          5. Final simplification93.6%

                                            \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+65}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\ \end{array} \]
                                          6. Add Preprocessing

                                          Alternative 4: 90.3% accurate, 2.0× speedup?

                                          \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(z \cdot 30\right)\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\ \end{array} \end{array} \]
                                          (FPCore (x y z)
                                           :precision binary64
                                           (let* ((t_0 (sin (* z 30.0))))
                                             (if (or (<= z -3.2e+15) (not (<= z 6.5e+83)))
                                               (fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))
                                               (fmax
                                                (- (hypot (* -30.0 x) (* -30.0 y)) 25.0)
                                                (- (fabs (fma t_0 (cos (* -30.0 x)) (sin (* 30.0 x)))) 0.2)))))
                                          double code(double x, double y, double z) {
                                          	double t_0 = sin((z * 30.0));
                                          	double tmp;
                                          	if ((z <= -3.2e+15) || !(z <= 6.5e+83)) {
                                          		tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
                                          	} else {
                                          		tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(fma(t_0, cos((-30.0 * x)), sin((30.0 * x)))) - 0.2));
                                          	}
                                          	return tmp;
                                          }
                                          
                                          function code(x, y, z)
                                          	t_0 = sin(Float64(z * 30.0))
                                          	tmp = 0.0
                                          	if ((z <= -3.2e+15) || !(z <= 6.5e+83))
                                          		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), Float64(abs(t_0) - 0.2));
                                          	else
                                          		tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), sin(Float64(30.0 * x)))) - 0.2));
                                          	end
                                          	return tmp
                                          end
                                          
                                          code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, If[Or[LessEqual[z, -3.2e+15], N[Not[LessEqual[z, 6.5e+83]], $MachinePrecision]], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(t$95$0 * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]
                                          
                                          \begin{array}{l}
                                          
                                          \\
                                          \begin{array}{l}
                                          t_0 := \sin \left(z \cdot 30\right)\\
                                          \mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\
                                          \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
                                          
                                          \mathbf{else}:\\
                                          \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
                                          
                                          
                                          \end{array}
                                          \end{array}
                                          
                                          Derivation
                                          1. Split input into 2 regimes
                                          2. if z < -3.2e15 or 6.5000000000000003e83 < z

                                            1. Initial program 32.2%

                                              \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                            2. Add Preprocessing
                                            3. Taylor expanded in x around 0

                                              \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                            4. Step-by-step derivation
                                              1. Applied rewrites88.1%

                                                \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                              2. Taylor expanded in y around 0

                                                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                              3. Step-by-step derivation
                                                1. Applied rewrites88.1%

                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                2. Taylor expanded in x around 0

                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                                3. Step-by-step derivation
                                                  1. Applied rewrites88.1%

                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]

                                                  if -3.2e15 < z < 6.5000000000000003e83

                                                  1. Initial program 53.0%

                                                    \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                  2. Add Preprocessing
                                                  3. Taylor expanded in z around 0

                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                  4. Step-by-step derivation
                                                    1. Applied rewrites97.3%

                                                      \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                    2. Taylor expanded in y around 0

                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                    3. Step-by-step derivation
                                                      1. Applied rewrites96.4%

                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                    4. Recombined 2 regimes into one program.
                                                    5. Final simplification92.7%

                                                      \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\ \end{array} \]
                                                    6. Add Preprocessing

                                                    Alternative 5: 89.0% accurate, 2.0× speedup?

                                                    \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(30 \cdot x\right)\\ t_1 := \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), t\_0\right)\right| - 0.2\\ \mathbf{if}\;x \leq -8 \cdot 10^{+37}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, t\_1\right)\\ \mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\ \end{array} \end{array} \]
                                                    (FPCore (x y z)
                                                     :precision binary64
                                                     (let* ((t_0 (sin (* 30.0 x)))
                                                            (t_1 (- (fabs (fma (sin (* z 30.0)) (cos (* -30.0 x)) t_0)) 0.2)))
                                                       (if (<= x -8e+37)
                                                         (fmax (- (hypot (* -30.0 z) (* -30.0 x)) 25.0) t_1)
                                                         (if (<= x 9e+154)
                                                           (fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) t_1)
                                                           (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))))))
                                                    double code(double x, double y, double z) {
                                                    	double t_0 = sin((30.0 * x));
                                                    	double t_1 = fabs(fma(sin((z * 30.0)), cos((-30.0 * x)), t_0)) - 0.2;
                                                    	double tmp;
                                                    	if (x <= -8e+37) {
                                                    		tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), t_1);
                                                    	} else if (x <= 9e+154) {
                                                    		tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_1);
                                                    	} else {
                                                    		tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
                                                    	}
                                                    	return tmp;
                                                    }
                                                    
                                                    function code(x, y, z)
                                                    	t_0 = sin(Float64(30.0 * x))
                                                    	t_1 = Float64(abs(fma(sin(Float64(z * 30.0)), cos(Float64(-30.0 * x)), t_0)) - 0.2)
                                                    	tmp = 0.0
                                                    	if (x <= -8e+37)
                                                    		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), t_1);
                                                    	elseif (x <= 9e+154)
                                                    		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), t_1);
                                                    	else
                                                    		tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(t_0) - 0.2));
                                                    	end
                                                    	return tmp
                                                    end
                                                    
                                                    code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -8e+37], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[x, 9e+154], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]]]]
                                                    
                                                    \begin{array}{l}
                                                    
                                                    \\
                                                    \begin{array}{l}
                                                    t_0 := \sin \left(30 \cdot x\right)\\
                                                    t_1 := \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), t\_0\right)\right| - 0.2\\
                                                    \mathbf{if}\;x \leq -8 \cdot 10^{+37}:\\
                                                    \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, t\_1\right)\\
                                                    
                                                    \mathbf{elif}\;x \leq 9 \cdot 10^{+154}:\\
                                                    \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, t\_1\right)\\
                                                    
                                                    \mathbf{else}:\\
                                                    \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
                                                    
                                                    
                                                    \end{array}
                                                    \end{array}
                                                    
                                                    Derivation
                                                    1. Split input into 3 regimes
                                                    2. if x < -7.99999999999999963e37

                                                      1. Initial program 28.6%

                                                        \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                      2. Add Preprocessing
                                                      3. Taylor expanded in y around 0

                                                        \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                      4. Step-by-step derivation
                                                        1. Applied rewrites86.3%

                                                          \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                        2. Taylor expanded in y around 0

                                                          \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                        3. Step-by-step derivation
                                                          1. Applied rewrites86.3%

                                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]

                                                          if -7.99999999999999963e37 < x < 9.00000000000000018e154

                                                          1. Initial program 56.9%

                                                            \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                          2. Add Preprocessing
                                                          3. Taylor expanded in x around 0

                                                            \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                          4. Step-by-step derivation
                                                            1. Applied rewrites95.6%

                                                              \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                            2. Taylor expanded in y around 0

                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                            3. Step-by-step derivation
                                                              1. Applied rewrites94.9%

                                                                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]

                                                              if 9.00000000000000018e154 < x

                                                              1. Initial program 7.6%

                                                                \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                              2. Add Preprocessing
                                                              3. Taylor expanded in z around 0

                                                                \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                              4. Step-by-step derivation
                                                                1. Applied rewrites97.2%

                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                2. Taylor expanded in y around 0

                                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                3. Step-by-step derivation
                                                                  1. Applied rewrites97.2%

                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                  2. Taylor expanded in z around 0

                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                  3. Step-by-step derivation
                                                                    1. Applied rewrites97.2%

                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                  4. Recombined 3 regimes into one program.
                                                                  5. Add Preprocessing

                                                                  Alternative 6: 90.3% accurate, 2.0× speedup?

                                                                  \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(z \cdot 30\right)\\ t_1 := \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\ \mathbf{elif}\;z \leq 2.25 \cdot 10^{+65}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, t\_1\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, t\_1\right)\\ \end{array} \end{array} \]
                                                                  (FPCore (x y z)
                                                                   :precision binary64
                                                                   (let* ((t_0 (sin (* z 30.0)))
                                                                          (t_1 (- (fabs (fma t_0 (cos (* -30.0 x)) (sin (* 30.0 x)))) 0.2)))
                                                                     (if (<= z -3.2e+15)
                                                                       (fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) (- (fabs t_0) 0.2))
                                                                       (if (<= z 2.25e+65)
                                                                         (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) t_1)
                                                                         (fmax (- (hypot (* -30.0 z) (* -30.0 x)) 25.0) t_1)))))
                                                                  double code(double x, double y, double z) {
                                                                  	double t_0 = sin((z * 30.0));
                                                                  	double t_1 = fabs(fma(t_0, cos((-30.0 * x)), sin((30.0 * x)))) - 0.2;
                                                                  	double tmp;
                                                                  	if (z <= -3.2e+15) {
                                                                  		tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), (fabs(t_0) - 0.2));
                                                                  	} else if (z <= 2.25e+65) {
                                                                  		tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_1);
                                                                  	} else {
                                                                  		tmp = fmax((hypot((-30.0 * z), (-30.0 * x)) - 25.0), t_1);
                                                                  	}
                                                                  	return tmp;
                                                                  }
                                                                  
                                                                  function code(x, y, z)
                                                                  	t_0 = sin(Float64(z * 30.0))
                                                                  	t_1 = Float64(abs(fma(t_0, cos(Float64(-30.0 * x)), sin(Float64(30.0 * x)))) - 0.2)
                                                                  	tmp = 0.0
                                                                  	if (z <= -3.2e+15)
                                                                  		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), Float64(abs(t_0) - 0.2));
                                                                  	elseif (z <= 2.25e+65)
                                                                  		tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), t_1);
                                                                  	else
                                                                  		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * x)) - 25.0), t_1);
                                                                  	end
                                                                  	return tmp
                                                                  end
                                                                  
                                                                  code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[N[(t$95$0 * N[Cos[N[(-30.0 * x), $MachinePrecision]], $MachinePrecision] + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[z, -3.2e+15], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[z, 2.25e+65], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * x), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision]]]]]
                                                                  
                                                                  \begin{array}{l}
                                                                  
                                                                  \\
                                                                  \begin{array}{l}
                                                                  t_0 := \sin \left(z \cdot 30\right)\\
                                                                  t_1 := \left|\mathsf{fma}\left(t\_0, \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\\
                                                                  \mathbf{if}\;z \leq -3.2 \cdot 10^{+15}:\\
                                                                  \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|t\_0\right| - 0.2\right)\\
                                                                  
                                                                  \mathbf{elif}\;z \leq 2.25 \cdot 10^{+65}:\\
                                                                  \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, t\_1\right)\\
                                                                  
                                                                  \mathbf{else}:\\
                                                                  \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, t\_1\right)\\
                                                                  
                                                                  
                                                                  \end{array}
                                                                  \end{array}
                                                                  
                                                                  Derivation
                                                                  1. Split input into 3 regimes
                                                                  2. if z < -3.2e15

                                                                    1. Initial program 42.1%

                                                                      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                    2. Add Preprocessing
                                                                    3. Taylor expanded in x around 0

                                                                      \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                    4. Step-by-step derivation
                                                                      1. Applied rewrites89.7%

                                                                        \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                      2. Taylor expanded in y around 0

                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                      3. Step-by-step derivation
                                                                        1. Applied rewrites89.7%

                                                                          \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                        2. Taylor expanded in x around 0

                                                                          \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                                                        3. Step-by-step derivation
                                                                          1. Applied rewrites89.7%

                                                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]

                                                                          if -3.2e15 < z < 2.25e65

                                                                          1. Initial program 53.7%

                                                                            \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                          2. Add Preprocessing
                                                                          3. Taylor expanded in z around 0

                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                          4. Step-by-step derivation
                                                                            1. Applied rewrites98.6%

                                                                              \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                            2. Taylor expanded in y around 0

                                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                            3. Step-by-step derivation
                                                                              1. Applied rewrites97.6%

                                                                                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]

                                                                              if 2.25e65 < z

                                                                              1. Initial program 22.9%

                                                                                \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                              2. Add Preprocessing
                                                                              3. Taylor expanded in y around 0

                                                                                \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                              4. Step-by-step derivation
                                                                                1. Applied rewrites86.0%

                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                2. Taylor expanded in y around 0

                                                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                3. Step-by-step derivation
                                                                                  1. Applied rewrites86.0%

                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot x\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                4. Recombined 3 regimes into one program.
                                                                                5. Add Preprocessing

                                                                                Alternative 7: 90.0% accurate, 3.2× speedup?

                                                                                \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\sin \left(z \cdot 30\right)\right| - 0.2\\ \mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, t\_0\right)\\ \end{array} \end{array} \]
                                                                                (FPCore (x y z)
                                                                                 :precision binary64
                                                                                 (let* ((t_0 (- (fabs (sin (* z 30.0))) 0.2)))
                                                                                   (if (or (<= z -3.2e+15) (not (<= z 6.5e+83)))
                                                                                     (fmax (- (hypot (* -30.0 z) (* -30.0 y)) 25.0) t_0)
                                                                                     (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) t_0))))
                                                                                double code(double x, double y, double z) {
                                                                                	double t_0 = fabs(sin((z * 30.0))) - 0.2;
                                                                                	double tmp;
                                                                                	if ((z <= -3.2e+15) || !(z <= 6.5e+83)) {
                                                                                		tmp = fmax((hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0);
                                                                                	} else {
                                                                                		tmp = fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0);
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                public static double code(double x, double y, double z) {
                                                                                	double t_0 = Math.abs(Math.sin((z * 30.0))) - 0.2;
                                                                                	double tmp;
                                                                                	if ((z <= -3.2e+15) || !(z <= 6.5e+83)) {
                                                                                		tmp = fmax((Math.hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0);
                                                                                	} else {
                                                                                		tmp = fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0);
                                                                                	}
                                                                                	return tmp;
                                                                                }
                                                                                
                                                                                def code(x, y, z):
                                                                                	t_0 = math.fabs(math.sin((z * 30.0))) - 0.2
                                                                                	tmp = 0
                                                                                	if (z <= -3.2e+15) or not (z <= 6.5e+83):
                                                                                		tmp = fmax((math.hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0)
                                                                                	else:
                                                                                		tmp = fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0)
                                                                                	return tmp
                                                                                
                                                                                function code(x, y, z)
                                                                                	t_0 = Float64(abs(sin(Float64(z * 30.0))) - 0.2)
                                                                                	tmp = 0.0
                                                                                	if ((z <= -3.2e+15) || !(z <= 6.5e+83))
                                                                                		tmp = fmax(Float64(hypot(Float64(-30.0 * z), Float64(-30.0 * y)) - 25.0), t_0);
                                                                                	else
                                                                                		tmp = fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), t_0);
                                                                                	end
                                                                                	return tmp
                                                                                end
                                                                                
                                                                                function tmp_2 = code(x, y, z)
                                                                                	t_0 = abs(sin((z * 30.0))) - 0.2;
                                                                                	tmp = 0.0;
                                                                                	if ((z <= -3.2e+15) || ~((z <= 6.5e+83)))
                                                                                		tmp = max((hypot((-30.0 * z), (-30.0 * y)) - 25.0), t_0);
                                                                                	else
                                                                                		tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), t_0);
                                                                                	end
                                                                                	tmp_2 = tmp;
                                                                                end
                                                                                
                                                                                code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[Or[LessEqual[z, -3.2e+15], N[Not[LessEqual[z, 6.5e+83]], $MachinePrecision]], N[Max[N[(N[Sqrt[N[(-30.0 * z), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]
                                                                                
                                                                                \begin{array}{l}
                                                                                
                                                                                \\
                                                                                \begin{array}{l}
                                                                                t_0 := \left|\sin \left(z \cdot 30\right)\right| - 0.2\\
                                                                                \mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\
                                                                                \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, t\_0\right)\\
                                                                                
                                                                                \mathbf{else}:\\
                                                                                \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, t\_0\right)\\
                                                                                
                                                                                
                                                                                \end{array}
                                                                                \end{array}
                                                                                
                                                                                Derivation
                                                                                1. Split input into 2 regimes
                                                                                2. if z < -3.2e15 or 6.5000000000000003e83 < z

                                                                                  1. Initial program 32.2%

                                                                                    \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                  2. Add Preprocessing
                                                                                  3. Taylor expanded in x around 0

                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                  4. Step-by-step derivation
                                                                                    1. Applied rewrites88.1%

                                                                                      \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                    2. Taylor expanded in y around 0

                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                    3. Step-by-step derivation
                                                                                      1. Applied rewrites88.1%

                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                      2. Taylor expanded in x around 0

                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                                                                      3. Step-by-step derivation
                                                                                        1. Applied rewrites88.1%

                                                                                          \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]

                                                                                        if -3.2e15 < z < 6.5000000000000003e83

                                                                                        1. Initial program 53.0%

                                                                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                        2. Add Preprocessing
                                                                                        3. Taylor expanded in z around 0

                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                        4. Step-by-step derivation
                                                                                          1. Applied rewrites97.3%

                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                          2. Taylor expanded in y around 0

                                                                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                          3. Step-by-step derivation
                                                                                            1. Applied rewrites96.4%

                                                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                            2. Taylor expanded in x around 0

                                                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                                                                            3. Step-by-step derivation
                                                                                              1. Applied rewrites96.0%

                                                                                                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]
                                                                                            4. Recombined 2 regimes into one program.
                                                                                            5. Final simplification92.5%

                                                                                              \[\leadsto \begin{array}{l} \mathbf{if}\;z \leq -3.2 \cdot 10^{+15} \lor \neg \left(z \leq 6.5 \cdot 10^{+83}\right):\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot z, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\ \end{array} \]
                                                                                            6. Add Preprocessing

                                                                                            Alternative 8: 71.4% accurate, 3.4× speedup?

                                                                                            \[\begin{array}{l} \\ \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \end{array} \]
                                                                                            (FPCore (x y z)
                                                                                             :precision binary64
                                                                                             (fmax
                                                                                              (- (hypot (* -30.0 x) (* -30.0 y)) 25.0)
                                                                                              (- (fabs (sin (* z 30.0))) 0.2)))
                                                                                            double code(double x, double y, double z) {
                                                                                            	return fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(sin((z * 30.0))) - 0.2));
                                                                                            }
                                                                                            
                                                                                            public static double code(double x, double y, double z) {
                                                                                            	return fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (Math.abs(Math.sin((z * 30.0))) - 0.2));
                                                                                            }
                                                                                            
                                                                                            def code(x, y, z):
                                                                                            	return fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (math.fabs(math.sin((z * 30.0))) - 0.2))
                                                                                            
                                                                                            function code(x, y, z)
                                                                                            	return fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(sin(Float64(z * 30.0))) - 0.2))
                                                                                            end
                                                                                            
                                                                                            function tmp = code(x, y, z)
                                                                                            	tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (abs(sin((z * 30.0))) - 0.2));
                                                                                            end
                                                                                            
                                                                                            code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
                                                                                            
                                                                                            \begin{array}{l}
                                                                                            
                                                                                            \\
                                                                                            \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)
                                                                                            \end{array}
                                                                                            
                                                                                            Derivation
                                                                                            1. Initial program 43.8%

                                                                                              \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                            2. Add Preprocessing
                                                                                            3. Taylor expanded in z around 0

                                                                                              \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                            4. Step-by-step derivation
                                                                                              1. Applied rewrites68.9%

                                                                                                \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                              2. Taylor expanded in y around 0

                                                                                                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                              3. Step-by-step derivation
                                                                                                1. Applied rewrites68.4%

                                                                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                2. Taylor expanded in x around 0

                                                                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                                                                                3. Step-by-step derivation
                                                                                                  1. Applied rewrites68.1%

                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]
                                                                                                  2. Add Preprocessing

                                                                                                  Alternative 9: 71.0% accurate, 3.4× speedup?

                                                                                                  \[\begin{array}{l} \\ \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \end{array} \]
                                                                                                  (FPCore (x y z)
                                                                                                   :precision binary64
                                                                                                   (fmax
                                                                                                    (- (hypot (* -30.0 x) (* -30.0 y)) 25.0)
                                                                                                    (- (fabs (sin (* 30.0 x))) 0.2)))
                                                                                                  double code(double x, double y, double z) {
                                                                                                  	return fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
                                                                                                  }
                                                                                                  
                                                                                                  public static double code(double x, double y, double z) {
                                                                                                  	return fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (Math.abs(Math.sin((30.0 * x))) - 0.2));
                                                                                                  }
                                                                                                  
                                                                                                  def code(x, y, z):
                                                                                                  	return fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (math.fabs(math.sin((30.0 * x))) - 0.2))
                                                                                                  
                                                                                                  function code(x, y, z)
                                                                                                  	return fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2))
                                                                                                  end
                                                                                                  
                                                                                                  function tmp = code(x, y, z)
                                                                                                  	tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (abs(sin((30.0 * x))) - 0.2));
                                                                                                  end
                                                                                                  
                                                                                                  code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
                                                                                                  
                                                                                                  \begin{array}{l}
                                                                                                  
                                                                                                  \\
                                                                                                  \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)
                                                                                                  \end{array}
                                                                                                  
                                                                                                  Derivation
                                                                                                  1. Initial program 43.8%

                                                                                                    \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                  2. Add Preprocessing
                                                                                                  3. Taylor expanded in z around 0

                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                  4. Step-by-step derivation
                                                                                                    1. Applied rewrites68.9%

                                                                                                      \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                    2. Taylor expanded in y around 0

                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                    3. Step-by-step derivation
                                                                                                      1. Applied rewrites68.4%

                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                      2. Taylor expanded in z around 0

                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                      3. Step-by-step derivation
                                                                                                        1. Applied rewrites67.6%

                                                                                                          \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                        2. Add Preprocessing

                                                                                                        Alternative 10: 56.8% accurate, 4.6× speedup?

                                                                                                        \[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(30 \cdot x\right)\\ t_1 := \left|t\_0\right| - 0.2\\ \mathbf{if}\;x \leq -9.2 \cdot 10^{-74}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, t\_0\right)\right| - 0.2\right)\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-292}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_1\right)\\ \mathbf{elif}\;x \leq 0.00295:\\ \;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_1\right)\\ \end{array} \end{array} \]
                                                                                                        (FPCore (x y z)
                                                                                                         :precision binary64
                                                                                                         (let* ((t_0 (sin (* 30.0 x))) (t_1 (- (fabs t_0) 0.2)))
                                                                                                           (if (<= x -9.2e-74)
                                                                                                             (fmax (* -30.0 x) (- (fabs (fma y 30.0 t_0)) 0.2))
                                                                                                             (if (<= x -3.7e-292)
                                                                                                               (fmax (- (* -30.0 y) 25.0) t_1)
                                                                                                               (if (<= x 0.00295)
                                                                                                                 (fmax (- (* y 30.0) 25.0) (- (fabs (sin (* z 30.0))) 0.2))
                                                                                                                 (fmax (- (* 30.0 x) 25.0) t_1))))))
                                                                                                        double code(double x, double y, double z) {
                                                                                                        	double t_0 = sin((30.0 * x));
                                                                                                        	double t_1 = fabs(t_0) - 0.2;
                                                                                                        	double tmp;
                                                                                                        	if (x <= -9.2e-74) {
                                                                                                        		tmp = fmax((-30.0 * x), (fabs(fma(y, 30.0, t_0)) - 0.2));
                                                                                                        	} else if (x <= -3.7e-292) {
                                                                                                        		tmp = fmax(((-30.0 * y) - 25.0), t_1);
                                                                                                        	} else if (x <= 0.00295) {
                                                                                                        		tmp = fmax(((y * 30.0) - 25.0), (fabs(sin((z * 30.0))) - 0.2));
                                                                                                        	} else {
                                                                                                        		tmp = fmax(((30.0 * x) - 25.0), t_1);
                                                                                                        	}
                                                                                                        	return tmp;
                                                                                                        }
                                                                                                        
                                                                                                        function code(x, y, z)
                                                                                                        	t_0 = sin(Float64(30.0 * x))
                                                                                                        	t_1 = Float64(abs(t_0) - 0.2)
                                                                                                        	tmp = 0.0
                                                                                                        	if (x <= -9.2e-74)
                                                                                                        		tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(y, 30.0, t_0)) - 0.2));
                                                                                                        	elseif (x <= -3.7e-292)
                                                                                                        		tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_1);
                                                                                                        	elseif (x <= 0.00295)
                                                                                                        		tmp = fmax(Float64(Float64(y * 30.0) - 25.0), Float64(abs(sin(Float64(z * 30.0))) - 0.2));
                                                                                                        	else
                                                                                                        		tmp = fmax(Float64(Float64(30.0 * x) - 25.0), t_1);
                                                                                                        	end
                                                                                                        	return tmp
                                                                                                        end
                                                                                                        
                                                                                                        code[x_, y_, z_] := Block[{t$95$0 = N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[(N[Abs[t$95$0], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -9.2e-74], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * 30.0 + t$95$0), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -3.7e-292], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision], If[LessEqual[x, 0.00295], N[Max[N[(N[(y * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$1], $MachinePrecision]]]]]]
                                                                                                        
                                                                                                        \begin{array}{l}
                                                                                                        
                                                                                                        \\
                                                                                                        \begin{array}{l}
                                                                                                        t_0 := \sin \left(30 \cdot x\right)\\
                                                                                                        t_1 := \left|t\_0\right| - 0.2\\
                                                                                                        \mathbf{if}\;x \leq -9.2 \cdot 10^{-74}:\\
                                                                                                        \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, t\_0\right)\right| - 0.2\right)\\
                                                                                                        
                                                                                                        \mathbf{elif}\;x \leq -3.7 \cdot 10^{-292}:\\
                                                                                                        \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_1\right)\\
                                                                                                        
                                                                                                        \mathbf{elif}\;x \leq 0.00295:\\
                                                                                                        \;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
                                                                                                        
                                                                                                        \mathbf{else}:\\
                                                                                                        \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_1\right)\\
                                                                                                        
                                                                                                        
                                                                                                        \end{array}
                                                                                                        \end{array}
                                                                                                        
                                                                                                        Derivation
                                                                                                        1. Split input into 4 regimes
                                                                                                        2. if x < -9.19999999999999922e-74

                                                                                                          1. Initial program 34.0%

                                                                                                            \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                          2. Add Preprocessing
                                                                                                          3. Taylor expanded in x around -inf

                                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                          4. Step-by-step derivation
                                                                                                            1. Applied rewrites42.2%

                                                                                                              \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                            2. Taylor expanded in z around 0

                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)}\right| - \frac{1}{5}\right) \]
                                                                                                            3. Step-by-step derivation
                                                                                                              1. Applied rewrites42.2%

                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \cos \left(-30 \cdot y\right), \sin \left(y \cdot 30\right)\right)}\right| - 0.2\right) \]
                                                                                                              2. Taylor expanded in y around 0

                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right) + \color{blue}{30 \cdot y}\right| - \frac{1}{5}\right) \]
                                                                                                              3. Step-by-step derivation
                                                                                                                1. Applied rewrites64.1%

                                                                                                                  \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, \color{blue}{30}, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right) \]

                                                                                                                if -9.19999999999999922e-74 < x < -3.69999999999999997e-292

                                                                                                                1. Initial program 68.9%

                                                                                                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                2. Add Preprocessing
                                                                                                                3. Taylor expanded in z around 0

                                                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                4. Step-by-step derivation
                                                                                                                  1. Applied rewrites72.8%

                                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                  2. Taylor expanded in y around 0

                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                  3. Step-by-step derivation
                                                                                                                    1. Applied rewrites71.1%

                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                    2. Taylor expanded in z around 0

                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                    3. Step-by-step derivation
                                                                                                                      1. Applied rewrites69.8%

                                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                      2. Taylor expanded in y around -inf

                                                                                                                        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                      3. Step-by-step derivation
                                                                                                                        1. Applied rewrites57.2%

                                                                                                                          \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]

                                                                                                                        if -3.69999999999999997e-292 < x < 0.00294999999999999993

                                                                                                                        1. Initial program 63.4%

                                                                                                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                        2. Add Preprocessing
                                                                                                                        3. Taylor expanded in z around 0

                                                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                        4. Step-by-step derivation
                                                                                                                          1. Applied rewrites61.2%

                                                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                          2. Taylor expanded in y around 0

                                                                                                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                          3. Step-by-step derivation
                                                                                                                            1. Applied rewrites60.5%

                                                                                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                            2. Taylor expanded in x around 0

                                                                                                                              \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{y} - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - \frac{1}{5}\right) \]
                                                                                                                            3. Step-by-step derivation
                                                                                                                              1. Applied rewrites49.1%

                                                                                                                                \[\leadsto \mathsf{max}\left(y \cdot \color{blue}{30} - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right) \]
                                                                                                                              2. Taylor expanded in x around 0

                                                                                                                                \[\leadsto \mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                                                                                                              3. Step-by-step derivation
                                                                                                                                1. Applied rewrites49.1%

                                                                                                                                  \[\leadsto \mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]

                                                                                                                                if 0.00294999999999999993 < x

                                                                                                                                1. Initial program 18.1%

                                                                                                                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                2. Add Preprocessing
                                                                                                                                3. Taylor expanded in z around 0

                                                                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                4. Step-by-step derivation
                                                                                                                                  1. Applied rewrites75.0%

                                                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                  2. Taylor expanded in y around 0

                                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                  3. Step-by-step derivation
                                                                                                                                    1. Applied rewrites75.0%

                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                    2. Taylor expanded in z around 0

                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                    3. Step-by-step derivation
                                                                                                                                      1. Applied rewrites75.0%

                                                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                      2. Taylor expanded in x around inf

                                                                                                                                        \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                      3. Step-by-step derivation
                                                                                                                                        1. Applied rewrites58.7%

                                                                                                                                          \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                      4. Recombined 4 regimes into one program.
                                                                                                                                      5. Add Preprocessing

                                                                                                                                      Alternative 11: 52.8% accurate, 4.6× speedup?

                                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\ \mathbf{elif}\;x \leq -3.7 \cdot 10^{-292}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_0\right)\\ \mathbf{elif}\;x \leq 0.00295:\\ \;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\ \end{array} \end{array} \]
                                                                                                                                      (FPCore (x y z)
                                                                                                                                       :precision binary64
                                                                                                                                       (let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2)))
                                                                                                                                         (if (<= x -1.7e+22)
                                                                                                                                           (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))
                                                                                                                                           (if (<= x -3.7e-292)
                                                                                                                                             (fmax (- (* -30.0 y) 25.0) t_0)
                                                                                                                                             (if (<= x 0.00295)
                                                                                                                                               (fmax (- (* y 30.0) 25.0) (- (fabs (sin (* z 30.0))) 0.2))
                                                                                                                                               (fmax (- (* 30.0 x) 25.0) t_0))))))
                                                                                                                                      double code(double x, double y, double z) {
                                                                                                                                      	double t_0 = fabs(sin((30.0 * x))) - 0.2;
                                                                                                                                      	double tmp;
                                                                                                                                      	if (x <= -1.7e+22) {
                                                                                                                                      		tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
                                                                                                                                      	} else if (x <= -3.7e-292) {
                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), t_0);
                                                                                                                                      	} else if (x <= 0.00295) {
                                                                                                                                      		tmp = fmax(((y * 30.0) - 25.0), (fabs(sin((z * 30.0))) - 0.2));
                                                                                                                                      	} else {
                                                                                                                                      		tmp = fmax(((30.0 * x) - 25.0), t_0);
                                                                                                                                      	}
                                                                                                                                      	return tmp;
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      module fmin_fmax_functions
                                                                                                                                          implicit none
                                                                                                                                          private
                                                                                                                                          public fmax
                                                                                                                                          public fmin
                                                                                                                                      
                                                                                                                                          interface fmax
                                                                                                                                              module procedure fmax88
                                                                                                                                              module procedure fmax44
                                                                                                                                              module procedure fmax84
                                                                                                                                              module procedure fmax48
                                                                                                                                          end interface
                                                                                                                                          interface fmin
                                                                                                                                              module procedure fmin88
                                                                                                                                              module procedure fmin44
                                                                                                                                              module procedure fmin84
                                                                                                                                              module procedure fmin48
                                                                                                                                          end interface
                                                                                                                                      contains
                                                                                                                                          real(8) function fmax88(x, y) result (res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(4) function fmax44(x, y) result (res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmax84(x, y) result(res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmax48(x, y) result(res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmin88(x, y) result (res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(4) function fmin44(x, y) result (res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmin84(x, y) result(res)
                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                          real(8) function fmin48(x, y) result(res)
                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                          end function
                                                                                                                                      end module
                                                                                                                                      
                                                                                                                                      real(8) function code(x, y, z)
                                                                                                                                      use fmin_fmax_functions
                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                          real(8), intent (in) :: z
                                                                                                                                          real(8) :: t_0
                                                                                                                                          real(8) :: tmp
                                                                                                                                          t_0 = abs(sin((30.0d0 * x))) - 0.2d0
                                                                                                                                          if (x <= (-1.7d+22)) then
                                                                                                                                              tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
                                                                                                                                          else if (x <= (-3.7d-292)) then
                                                                                                                                              tmp = fmax((((-30.0d0) * y) - 25.0d0), t_0)
                                                                                                                                          else if (x <= 0.00295d0) then
                                                                                                                                              tmp = fmax(((y * 30.0d0) - 25.0d0), (abs(sin((z * 30.0d0))) - 0.2d0))
                                                                                                                                          else
                                                                                                                                              tmp = fmax(((30.0d0 * x) - 25.0d0), t_0)
                                                                                                                                          end if
                                                                                                                                          code = tmp
                                                                                                                                      end function
                                                                                                                                      
                                                                                                                                      public static double code(double x, double y, double z) {
                                                                                                                                      	double t_0 = Math.abs(Math.sin((30.0 * x))) - 0.2;
                                                                                                                                      	double tmp;
                                                                                                                                      	if (x <= -1.7e+22) {
                                                                                                                                      		tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
                                                                                                                                      	} else if (x <= -3.7e-292) {
                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), t_0);
                                                                                                                                      	} else if (x <= 0.00295) {
                                                                                                                                      		tmp = fmax(((y * 30.0) - 25.0), (Math.abs(Math.sin((z * 30.0))) - 0.2));
                                                                                                                                      	} else {
                                                                                                                                      		tmp = fmax(((30.0 * x) - 25.0), t_0);
                                                                                                                                      	}
                                                                                                                                      	return tmp;
                                                                                                                                      }
                                                                                                                                      
                                                                                                                                      def code(x, y, z):
                                                                                                                                      	t_0 = math.fabs(math.sin((30.0 * x))) - 0.2
                                                                                                                                      	tmp = 0
                                                                                                                                      	if x <= -1.7e+22:
                                                                                                                                      		tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2))
                                                                                                                                      	elif x <= -3.7e-292:
                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), t_0)
                                                                                                                                      	elif x <= 0.00295:
                                                                                                                                      		tmp = fmax(((y * 30.0) - 25.0), (math.fabs(math.sin((z * 30.0))) - 0.2))
                                                                                                                                      	else:
                                                                                                                                      		tmp = fmax(((30.0 * x) - 25.0), t_0)
                                                                                                                                      	return tmp
                                                                                                                                      
                                                                                                                                      function code(x, y, z)
                                                                                                                                      	t_0 = Float64(abs(sin(Float64(30.0 * x))) - 0.2)
                                                                                                                                      	tmp = 0.0
                                                                                                                                      	if (x <= -1.7e+22)
                                                                                                                                      		tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2));
                                                                                                                                      	elseif (x <= -3.7e-292)
                                                                                                                                      		tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_0);
                                                                                                                                      	elseif (x <= 0.00295)
                                                                                                                                      		tmp = fmax(Float64(Float64(y * 30.0) - 25.0), Float64(abs(sin(Float64(z * 30.0))) - 0.2));
                                                                                                                                      	else
                                                                                                                                      		tmp = fmax(Float64(Float64(30.0 * x) - 25.0), t_0);
                                                                                                                                      	end
                                                                                                                                      	return tmp
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      function tmp_2 = code(x, y, z)
                                                                                                                                      	t_0 = abs(sin((30.0 * x))) - 0.2;
                                                                                                                                      	tmp = 0.0;
                                                                                                                                      	if (x <= -1.7e+22)
                                                                                                                                      		tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2));
                                                                                                                                      	elseif (x <= -3.7e-292)
                                                                                                                                      		tmp = max(((-30.0 * y) - 25.0), t_0);
                                                                                                                                      	elseif (x <= 0.00295)
                                                                                                                                      		tmp = max(((y * 30.0) - 25.0), (abs(sin((z * 30.0))) - 0.2));
                                                                                                                                      	else
                                                                                                                                      		tmp = max(((30.0 * x) - 25.0), t_0);
                                                                                                                                      	end
                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                      end
                                                                                                                                      
                                                                                                                                      code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -1.7e+22], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, -3.7e-292], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 0.00295], N[Max[N[(N[(y * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]]
                                                                                                                                      
                                                                                                                                      \begin{array}{l}
                                                                                                                                      
                                                                                                                                      \\
                                                                                                                                      \begin{array}{l}
                                                                                                                                      t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\
                                                                                                                                      \mathbf{if}\;x \leq -1.7 \cdot 10^{+22}:\\
                                                                                                                                      \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
                                                                                                                                      
                                                                                                                                      \mathbf{elif}\;x \leq -3.7 \cdot 10^{-292}:\\
                                                                                                                                      \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_0\right)\\
                                                                                                                                      
                                                                                                                                      \mathbf{elif}\;x \leq 0.00295:\\
                                                                                                                                      \;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right)\\
                                                                                                                                      
                                                                                                                                      \mathbf{else}:\\
                                                                                                                                      \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\
                                                                                                                                      
                                                                                                                                      
                                                                                                                                      \end{array}
                                                                                                                                      \end{array}
                                                                                                                                      
                                                                                                                                      Derivation
                                                                                                                                      1. Split input into 4 regimes
                                                                                                                                      2. if x < -1.7e22

                                                                                                                                        1. Initial program 29.1%

                                                                                                                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                        2. Add Preprocessing
                                                                                                                                        3. Taylor expanded in x around -inf

                                                                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                        4. Step-by-step derivation
                                                                                                                                          1. Applied rewrites54.9%

                                                                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                          2. Taylor expanded in z around 0

                                                                                                                                            \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                          3. Step-by-step derivation
                                                                                                                                            1. Applied rewrites54.9%

                                                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \cos \left(-30 \cdot y\right), \sin \left(y \cdot 30\right)\right)}\right| - 0.2\right) \]
                                                                                                                                            2. Taylor expanded in y around 0

                                                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                            3. Step-by-step derivation
                                                                                                                                              1. Applied rewrites54.9%

                                                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                              2. Taylor expanded in x around 0

                                                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - \frac{1}{5}\right) \]
                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                1. Applied rewrites54.9%

                                                                                                                                                  \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right) \]

                                                                                                                                                if -1.7e22 < x < -3.69999999999999997e-292

                                                                                                                                                1. Initial program 62.0%

                                                                                                                                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                2. Add Preprocessing
                                                                                                                                                3. Taylor expanded in z around 0

                                                                                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                  1. Applied rewrites71.0%

                                                                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                  2. Taylor expanded in y around 0

                                                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                    1. Applied rewrites69.9%

                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                    2. Taylor expanded in z around 0

                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                      1. Applied rewrites68.4%

                                                                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                      2. Taylor expanded in y around -inf

                                                                                                                                                        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                        1. Applied rewrites52.9%

                                                                                                                                                          \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]

                                                                                                                                                        if -3.69999999999999997e-292 < x < 0.00294999999999999993

                                                                                                                                                        1. Initial program 63.4%

                                                                                                                                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                        3. Taylor expanded in z around 0

                                                                                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                          1. Applied rewrites61.2%

                                                                                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                          2. Taylor expanded in y around 0

                                                                                                                                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                            1. Applied rewrites60.5%

                                                                                                                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                            2. Taylor expanded in x around 0

                                                                                                                                                              \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{y} - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                              1. Applied rewrites49.1%

                                                                                                                                                                \[\leadsto \mathsf{max}\left(y \cdot \color{blue}{30} - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right) \]
                                                                                                                                                              2. Taylor expanded in x around 0

                                                                                                                                                                \[\leadsto \mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                1. Applied rewrites49.1%

                                                                                                                                                                  \[\leadsto \mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(z \cdot 30\right)\right| - 0.2\right) \]

                                                                                                                                                                if 0.00294999999999999993 < x

                                                                                                                                                                1. Initial program 18.1%

                                                                                                                                                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                3. Taylor expanded in z around 0

                                                                                                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                  1. Applied rewrites75.0%

                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                  2. Taylor expanded in y around 0

                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                    1. Applied rewrites75.0%

                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                    2. Taylor expanded in z around 0

                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                      1. Applied rewrites75.0%

                                                                                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                      2. Taylor expanded in x around inf

                                                                                                                                                                        \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                        1. Applied rewrites58.7%

                                                                                                                                                                          \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                      4. Recombined 4 regimes into one program.
                                                                                                                                                                      5. Add Preprocessing

                                                                                                                                                                      Alternative 12: 52.1% accurate, 4.7× speedup?

                                                                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{+22} \lor \neg \left(x \leq 700000\right):\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\ \end{array} \end{array} \]
                                                                                                                                                                      (FPCore (x y z)
                                                                                                                                                                       :precision binary64
                                                                                                                                                                       (if (or (<= x -1.7e+22) (not (<= x 700000.0)))
                                                                                                                                                                         (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))
                                                                                                                                                                         (fmax (- (* -30.0 y) 25.0) (- (fabs (sin (* 30.0 x))) 0.2))))
                                                                                                                                                                      double code(double x, double y, double z) {
                                                                                                                                                                      	double tmp;
                                                                                                                                                                      	if ((x <= -1.7e+22) || !(x <= 700000.0)) {
                                                                                                                                                                      		tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
                                                                                                                                                                      	} else {
                                                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), (fabs(sin((30.0 * x))) - 0.2));
                                                                                                                                                                      	}
                                                                                                                                                                      	return tmp;
                                                                                                                                                                      }
                                                                                                                                                                      
                                                                                                                                                                      module fmin_fmax_functions
                                                                                                                                                                          implicit none
                                                                                                                                                                          private
                                                                                                                                                                          public fmax
                                                                                                                                                                          public fmin
                                                                                                                                                                      
                                                                                                                                                                          interface fmax
                                                                                                                                                                              module procedure fmax88
                                                                                                                                                                              module procedure fmax44
                                                                                                                                                                              module procedure fmax84
                                                                                                                                                                              module procedure fmax48
                                                                                                                                                                          end interface
                                                                                                                                                                          interface fmin
                                                                                                                                                                              module procedure fmin88
                                                                                                                                                                              module procedure fmin44
                                                                                                                                                                              module procedure fmin84
                                                                                                                                                                              module procedure fmin48
                                                                                                                                                                          end interface
                                                                                                                                                                      contains
                                                                                                                                                                          real(8) function fmax88(x, y) result (res)
                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                          real(4) function fmax44(x, y) result (res)
                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                          real(8) function fmax84(x, y) result(res)
                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                          real(8) function fmax48(x, y) result(res)
                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                          real(8) function fmin88(x, y) result (res)
                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                          real(4) function fmin44(x, y) result (res)
                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                          real(8) function fmin84(x, y) result(res)
                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                          real(8) function fmin48(x, y) result(res)
                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                          end function
                                                                                                                                                                      end module
                                                                                                                                                                      
                                                                                                                                                                      real(8) function code(x, y, z)
                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                                                          real(8), intent (in) :: z
                                                                                                                                                                          real(8) :: tmp
                                                                                                                                                                          if ((x <= (-1.7d+22)) .or. (.not. (x <= 700000.0d0))) then
                                                                                                                                                                              tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
                                                                                                                                                                          else
                                                                                                                                                                              tmp = fmax((((-30.0d0) * y) - 25.0d0), (abs(sin((30.0d0 * x))) - 0.2d0))
                                                                                                                                                                          end if
                                                                                                                                                                          code = tmp
                                                                                                                                                                      end function
                                                                                                                                                                      
                                                                                                                                                                      public static double code(double x, double y, double z) {
                                                                                                                                                                      	double tmp;
                                                                                                                                                                      	if ((x <= -1.7e+22) || !(x <= 700000.0)) {
                                                                                                                                                                      		tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
                                                                                                                                                                      	} else {
                                                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), (Math.abs(Math.sin((30.0 * x))) - 0.2));
                                                                                                                                                                      	}
                                                                                                                                                                      	return tmp;
                                                                                                                                                                      }
                                                                                                                                                                      
                                                                                                                                                                      def code(x, y, z):
                                                                                                                                                                      	tmp = 0
                                                                                                                                                                      	if (x <= -1.7e+22) or not (x <= 700000.0):
                                                                                                                                                                      		tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2))
                                                                                                                                                                      	else:
                                                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), (math.fabs(math.sin((30.0 * x))) - 0.2))
                                                                                                                                                                      	return tmp
                                                                                                                                                                      
                                                                                                                                                                      function code(x, y, z)
                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                      	if ((x <= -1.7e+22) || !(x <= 700000.0))
                                                                                                                                                                      		tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2));
                                                                                                                                                                      	else
                                                                                                                                                                      		tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), Float64(abs(sin(Float64(30.0 * x))) - 0.2));
                                                                                                                                                                      	end
                                                                                                                                                                      	return tmp
                                                                                                                                                                      end
                                                                                                                                                                      
                                                                                                                                                                      function tmp_2 = code(x, y, z)
                                                                                                                                                                      	tmp = 0.0;
                                                                                                                                                                      	if ((x <= -1.7e+22) || ~((x <= 700000.0)))
                                                                                                                                                                      		tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2));
                                                                                                                                                                      	else
                                                                                                                                                                      		tmp = max(((-30.0 * y) - 25.0), (abs(sin((30.0 * x))) - 0.2));
                                                                                                                                                                      	end
                                                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                                                      end
                                                                                                                                                                      
                                                                                                                                                                      code[x_, y_, z_] := If[Or[LessEqual[x, -1.7e+22], N[Not[LessEqual[x, 700000.0]], $MachinePrecision]], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
                                                                                                                                                                      
                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                      
                                                                                                                                                                      \\
                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                      \mathbf{if}\;x \leq -1.7 \cdot 10^{+22} \lor \neg \left(x \leq 700000\right):\\
                                                                                                                                                                      \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
                                                                                                                                                                      
                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                      \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\
                                                                                                                                                                      
                                                                                                                                                                      
                                                                                                                                                                      \end{array}
                                                                                                                                                                      \end{array}
                                                                                                                                                                      
                                                                                                                                                                      Derivation
                                                                                                                                                                      1. Split input into 2 regimes
                                                                                                                                                                      2. if x < -1.7e22 or 7e5 < x

                                                                                                                                                                        1. Initial program 23.9%

                                                                                                                                                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                        3. Taylor expanded in x around -inf

                                                                                                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                          1. Applied rewrites30.4%

                                                                                                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                          2. Taylor expanded in z around 0

                                                                                                                                                                            \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                            1. Applied rewrites30.3%

                                                                                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \cos \left(-30 \cdot y\right), \sin \left(y \cdot 30\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                            2. Taylor expanded in y around 0

                                                                                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                              1. Applied rewrites30.4%

                                                                                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                              2. Taylor expanded in x around 0

                                                                                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - \frac{1}{5}\right) \]
                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                1. Applied rewrites56.8%

                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right) \]

                                                                                                                                                                                if -1.7e22 < x < 7e5

                                                                                                                                                                                1. Initial program 62.2%

                                                                                                                                                                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                3. Taylor expanded in z around 0

                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                  1. Applied rewrites66.8%

                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                  2. Taylor expanded in y around 0

                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                    1. Applied rewrites65.8%

                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                    2. Taylor expanded in z around 0

                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                      1. Applied rewrites64.3%

                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                      2. Taylor expanded in y around -inf

                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                        1. Applied rewrites47.7%

                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                      4. Recombined 2 regimes into one program.
                                                                                                                                                                                      5. Final simplification52.1%

                                                                                                                                                                                        \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.7 \cdot 10^{+22} \lor \neg \left(x \leq 700000\right):\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right)\\ \end{array} \]
                                                                                                                                                                                      6. Add Preprocessing

                                                                                                                                                                                      Alternative 13: 52.2% accurate, 4.7× speedup?

                                                                                                                                                                                      \[\begin{array}{l} \\ \begin{array}{l} t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\ \mathbf{if}\;x \leq -1.7 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\ \mathbf{elif}\;x \leq 82000:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\ \end{array} \end{array} \]
                                                                                                                                                                                      (FPCore (x y z)
                                                                                                                                                                                       :precision binary64
                                                                                                                                                                                       (let* ((t_0 (- (fabs (sin (* 30.0 x))) 0.2)))
                                                                                                                                                                                         (if (<= x -1.7e+22)
                                                                                                                                                                                           (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2))
                                                                                                                                                                                           (if (<= x 82000.0)
                                                                                                                                                                                             (fmax (- (* -30.0 y) 25.0) t_0)
                                                                                                                                                                                             (fmax (- (* 30.0 x) 25.0) t_0)))))
                                                                                                                                                                                      double code(double x, double y, double z) {
                                                                                                                                                                                      	double t_0 = fabs(sin((30.0 * x))) - 0.2;
                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                      	if (x <= -1.7e+22) {
                                                                                                                                                                                      		tmp = fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
                                                                                                                                                                                      	} else if (x <= 82000.0) {
                                                                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), t_0);
                                                                                                                                                                                      	} else {
                                                                                                                                                                                      		tmp = fmax(((30.0 * x) - 25.0), t_0);
                                                                                                                                                                                      	}
                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                      }
                                                                                                                                                                                      
                                                                                                                                                                                      module fmin_fmax_functions
                                                                                                                                                                                          implicit none
                                                                                                                                                                                          private
                                                                                                                                                                                          public fmax
                                                                                                                                                                                          public fmin
                                                                                                                                                                                      
                                                                                                                                                                                          interface fmax
                                                                                                                                                                                              module procedure fmax88
                                                                                                                                                                                              module procedure fmax44
                                                                                                                                                                                              module procedure fmax84
                                                                                                                                                                                              module procedure fmax48
                                                                                                                                                                                          end interface
                                                                                                                                                                                          interface fmin
                                                                                                                                                                                              module procedure fmin88
                                                                                                                                                                                              module procedure fmin44
                                                                                                                                                                                              module procedure fmin84
                                                                                                                                                                                              module procedure fmin48
                                                                                                                                                                                          end interface
                                                                                                                                                                                      contains
                                                                                                                                                                                          real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                          real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                              res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                          real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                              res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                          real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                              res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                          real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                          real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                              res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                          real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                              real(8), intent (in) :: x
                                                                                                                                                                                              real(4), intent (in) :: y
                                                                                                                                                                                              res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                          real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                              real(4), intent (in) :: x
                                                                                                                                                                                              real(8), intent (in) :: y
                                                                                                                                                                                              res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                          end function
                                                                                                                                                                                      end module
                                                                                                                                                                                      
                                                                                                                                                                                      real(8) function code(x, y, z)
                                                                                                                                                                                      use fmin_fmax_functions
                                                                                                                                                                                          real(8), intent (in) :: x
                                                                                                                                                                                          real(8), intent (in) :: y
                                                                                                                                                                                          real(8), intent (in) :: z
                                                                                                                                                                                          real(8) :: t_0
                                                                                                                                                                                          real(8) :: tmp
                                                                                                                                                                                          t_0 = abs(sin((30.0d0 * x))) - 0.2d0
                                                                                                                                                                                          if (x <= (-1.7d+22)) then
                                                                                                                                                                                              tmp = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
                                                                                                                                                                                          else if (x <= 82000.0d0) then
                                                                                                                                                                                              tmp = fmax((((-30.0d0) * y) - 25.0d0), t_0)
                                                                                                                                                                                          else
                                                                                                                                                                                              tmp = fmax(((30.0d0 * x) - 25.0d0), t_0)
                                                                                                                                                                                          end if
                                                                                                                                                                                          code = tmp
                                                                                                                                                                                      end function
                                                                                                                                                                                      
                                                                                                                                                                                      public static double code(double x, double y, double z) {
                                                                                                                                                                                      	double t_0 = Math.abs(Math.sin((30.0 * x))) - 0.2;
                                                                                                                                                                                      	double tmp;
                                                                                                                                                                                      	if (x <= -1.7e+22) {
                                                                                                                                                                                      		tmp = fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
                                                                                                                                                                                      	} else if (x <= 82000.0) {
                                                                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), t_0);
                                                                                                                                                                                      	} else {
                                                                                                                                                                                      		tmp = fmax(((30.0 * x) - 25.0), t_0);
                                                                                                                                                                                      	}
                                                                                                                                                                                      	return tmp;
                                                                                                                                                                                      }
                                                                                                                                                                                      
                                                                                                                                                                                      def code(x, y, z):
                                                                                                                                                                                      	t_0 = math.fabs(math.sin((30.0 * x))) - 0.2
                                                                                                                                                                                      	tmp = 0
                                                                                                                                                                                      	if x <= -1.7e+22:
                                                                                                                                                                                      		tmp = fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2))
                                                                                                                                                                                      	elif x <= 82000.0:
                                                                                                                                                                                      		tmp = fmax(((-30.0 * y) - 25.0), t_0)
                                                                                                                                                                                      	else:
                                                                                                                                                                                      		tmp = fmax(((30.0 * x) - 25.0), t_0)
                                                                                                                                                                                      	return tmp
                                                                                                                                                                                      
                                                                                                                                                                                      function code(x, y, z)
                                                                                                                                                                                      	t_0 = Float64(abs(sin(Float64(30.0 * x))) - 0.2)
                                                                                                                                                                                      	tmp = 0.0
                                                                                                                                                                                      	if (x <= -1.7e+22)
                                                                                                                                                                                      		tmp = fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2));
                                                                                                                                                                                      	elseif (x <= 82000.0)
                                                                                                                                                                                      		tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_0);
                                                                                                                                                                                      	else
                                                                                                                                                                                      		tmp = fmax(Float64(Float64(30.0 * x) - 25.0), t_0);
                                                                                                                                                                                      	end
                                                                                                                                                                                      	return tmp
                                                                                                                                                                                      end
                                                                                                                                                                                      
                                                                                                                                                                                      function tmp_2 = code(x, y, z)
                                                                                                                                                                                      	t_0 = abs(sin((30.0 * x))) - 0.2;
                                                                                                                                                                                      	tmp = 0.0;
                                                                                                                                                                                      	if (x <= -1.7e+22)
                                                                                                                                                                                      		tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2));
                                                                                                                                                                                      	elseif (x <= 82000.0)
                                                                                                                                                                                      		tmp = max(((-30.0 * y) - 25.0), t_0);
                                                                                                                                                                                      	else
                                                                                                                                                                                      		tmp = max(((30.0 * x) - 25.0), t_0);
                                                                                                                                                                                      	end
                                                                                                                                                                                      	tmp_2 = tmp;
                                                                                                                                                                                      end
                                                                                                                                                                                      
                                                                                                                                                                                      code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -1.7e+22], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], If[LessEqual[x, 82000.0], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
                                                                                                                                                                                      
                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                      
                                                                                                                                                                                      \\
                                                                                                                                                                                      \begin{array}{l}
                                                                                                                                                                                      t_0 := \left|\sin \left(30 \cdot x\right)\right| - 0.2\\
                                                                                                                                                                                      \mathbf{if}\;x \leq -1.7 \cdot 10^{+22}:\\
                                                                                                                                                                                      \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)\\
                                                                                                                                                                                      
                                                                                                                                                                                      \mathbf{elif}\;x \leq 82000:\\
                                                                                                                                                                                      \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_0\right)\\
                                                                                                                                                                                      
                                                                                                                                                                                      \mathbf{else}:\\
                                                                                                                                                                                      \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\
                                                                                                                                                                                      
                                                                                                                                                                                      
                                                                                                                                                                                      \end{array}
                                                                                                                                                                                      \end{array}
                                                                                                                                                                                      
                                                                                                                                                                                      Derivation
                                                                                                                                                                                      1. Split input into 3 regimes
                                                                                                                                                                                      2. if x < -1.7e22

                                                                                                                                                                                        1. Initial program 29.1%

                                                                                                                                                                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                        3. Taylor expanded in x around -inf

                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                          1. Applied rewrites54.9%

                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                          2. Taylor expanded in z around 0

                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                            1. Applied rewrites54.9%

                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \cos \left(-30 \cdot y\right), \sin \left(y \cdot 30\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                            2. Taylor expanded in y around 0

                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                              1. Applied rewrites54.9%

                                                                                                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                              2. Taylor expanded in x around 0

                                                                                                                                                                                                \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                1. Applied rewrites54.9%

                                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right) \]

                                                                                                                                                                                                if -1.7e22 < x < 82000

                                                                                                                                                                                                1. Initial program 62.2%

                                                                                                                                                                                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                3. Taylor expanded in z around 0

                                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                  1. Applied rewrites66.8%

                                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                  2. Taylor expanded in y around 0

                                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                    1. Applied rewrites65.8%

                                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                                    2. Taylor expanded in z around 0

                                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                      1. Applied rewrites64.3%

                                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                                      2. Taylor expanded in y around -inf

                                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                        1. Applied rewrites47.7%

                                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]

                                                                                                                                                                                                        if 82000 < x

                                                                                                                                                                                                        1. Initial program 18.3%

                                                                                                                                                                                                          \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                        2. Add Preprocessing
                                                                                                                                                                                                        3. Taylor expanded in z around 0

                                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                        4. Step-by-step derivation
                                                                                                                                                                                                          1. Applied rewrites74.5%

                                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                          2. Taylor expanded in y around 0

                                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                            1. Applied rewrites74.5%

                                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                                            2. Taylor expanded in z around 0

                                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                              1. Applied rewrites74.5%

                                                                                                                                                                                                                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                                              2. Taylor expanded in x around inf

                                                                                                                                                                                                                \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                1. Applied rewrites59.7%

                                                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                                              4. Recombined 3 regimes into one program.
                                                                                                                                                                                                              5. Add Preprocessing

                                                                                                                                                                                                              Alternative 14: 68.3% accurate, 4.7× speedup?

                                                                                                                                                                                                              \[\begin{array}{l} \\ \begin{array}{l} \mathbf{if}\;y \leq -1.4 \cdot 10^{+22}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\right)\\ \end{array} \end{array} \]
                                                                                                                                                                                                              (FPCore (x y z)
                                                                                                                                                                                                               :precision binary64
                                                                                                                                                                                                               (if (<= y -1.4e+22)
                                                                                                                                                                                                                 (fmax (* -30.0 x) (- (fabs (fma y 30.0 (sin (* 30.0 x)))) 0.2))
                                                                                                                                                                                                                 (fmax (- (* y 30.0) 25.0) (- (fabs (fma 30.0 x (sin (* z 30.0)))) 0.2))))
                                                                                                                                                                                                              double code(double x, double y, double z) {
                                                                                                                                                                                                              	double tmp;
                                                                                                                                                                                                              	if (y <= -1.4e+22) {
                                                                                                                                                                                                              		tmp = fmax((-30.0 * x), (fabs(fma(y, 30.0, sin((30.0 * x)))) - 0.2));
                                                                                                                                                                                                              	} else {
                                                                                                                                                                                                              		tmp = fmax(((y * 30.0) - 25.0), (fabs(fma(30.0, x, sin((z * 30.0)))) - 0.2));
                                                                                                                                                                                                              	}
                                                                                                                                                                                                              	return tmp;
                                                                                                                                                                                                              }
                                                                                                                                                                                                              
                                                                                                                                                                                                              function code(x, y, z)
                                                                                                                                                                                                              	tmp = 0.0
                                                                                                                                                                                                              	if (y <= -1.4e+22)
                                                                                                                                                                                                              		tmp = fmax(Float64(-30.0 * x), Float64(abs(fma(y, 30.0, sin(Float64(30.0 * x)))) - 0.2));
                                                                                                                                                                                                              	else
                                                                                                                                                                                                              		tmp = fmax(Float64(Float64(y * 30.0) - 25.0), Float64(abs(fma(30.0, x, sin(Float64(z * 30.0)))) - 0.2));
                                                                                                                                                                                                              	end
                                                                                                                                                                                                              	return tmp
                                                                                                                                                                                                              end
                                                                                                                                                                                                              
                                                                                                                                                                                                              code[x_, y_, z_] := If[LessEqual[y, -1.4e+22], N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(y * 30.0 + N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(y * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x + N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]]
                                                                                                                                                                                                              
                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                              
                                                                                                                                                                                                              \\
                                                                                                                                                                                                              \begin{array}{l}
                                                                                                                                                                                                              \mathbf{if}\;y \leq -1.4 \cdot 10^{+22}:\\
                                                                                                                                                                                                              \;\;\;\;\mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, 30, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right)\\
                                                                                                                                                                                                              
                                                                                                                                                                                                              \mathbf{else}:\\
                                                                                                                                                                                                              \;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, \left|\mathsf{fma}\left(30, x, \sin \left(z \cdot 30\right)\right)\right| - 0.2\right)\\
                                                                                                                                                                                                              
                                                                                                                                                                                                              
                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                              \end{array}
                                                                                                                                                                                                              
                                                                                                                                                                                                              Derivation
                                                                                                                                                                                                              1. Split input into 2 regimes
                                                                                                                                                                                                              2. if y < -1.4e22

                                                                                                                                                                                                                1. Initial program 31.6%

                                                                                                                                                                                                                  \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                2. Add Preprocessing
                                                                                                                                                                                                                3. Taylor expanded in x around -inf

                                                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                4. Step-by-step derivation
                                                                                                                                                                                                                  1. Applied rewrites11.0%

                                                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                  2. Taylor expanded in z around 0

                                                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                    1. Applied rewrites10.9%

                                                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \cos \left(-30 \cdot y\right), \sin \left(y \cdot 30\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                                                    2. Taylor expanded in y around 0

                                                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right) + \color{blue}{30 \cdot y}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                    3. Step-by-step derivation
                                                                                                                                                                                                                      1. Applied rewrites70.6%

                                                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\mathsf{fma}\left(y, \color{blue}{30}, \sin \left(30 \cdot x\right)\right)\right| - 0.2\right) \]

                                                                                                                                                                                                                      if -1.4e22 < y

                                                                                                                                                                                                                      1. Initial program 47.6%

                                                                                                                                                                                                                        \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                      2. Add Preprocessing
                                                                                                                                                                                                                      3. Taylor expanded in z around 0

                                                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                      4. Step-by-step derivation
                                                                                                                                                                                                                        1. Applied rewrites65.0%

                                                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                        2. Taylor expanded in y around 0

                                                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                          1. Applied rewrites64.3%

                                                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                                                          2. Taylor expanded in x around 0

                                                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{y} - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                            1. Applied rewrites35.2%

                                                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(y \cdot \color{blue}{30} - 25, \left|\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                            2. Taylor expanded in x around 0

                                                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(y \cdot 30 - 25, \left|\sin \left(30 \cdot z\right) + \color{blue}{30 \cdot x}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                            3. Step-by-step derivation
                                                                                                                                                                                                                              1. Applied rewrites63.1%

                                                                                                                                                                                                                                \[\leadsto \mathsf{max}\left(y \cdot 30 - 25, \left|\mathsf{fma}\left(30, \color{blue}{x}, \sin \left(z \cdot 30\right)\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                            4. Recombined 2 regimes into one program.
                                                                                                                                                                                                                            5. Add Preprocessing

                                                                                                                                                                                                                            Alternative 15: 70.6% accurate, 4.8× speedup?

                                                                                                                                                                                                                            \[\begin{array}{l} \\ \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|30 \cdot x\right| - 0.2\right) \end{array} \]
                                                                                                                                                                                                                            (FPCore (x y z)
                                                                                                                                                                                                                             :precision binary64
                                                                                                                                                                                                                             (fmax (- (hypot (* -30.0 x) (* -30.0 y)) 25.0) (- (fabs (* 30.0 x)) 0.2)))
                                                                                                                                                                                                                            double code(double x, double y, double z) {
                                                                                                                                                                                                                            	return fmax((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (fabs((30.0 * x)) - 0.2));
                                                                                                                                                                                                                            }
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            public static double code(double x, double y, double z) {
                                                                                                                                                                                                                            	return fmax((Math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (Math.abs((30.0 * x)) - 0.2));
                                                                                                                                                                                                                            }
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            def code(x, y, z):
                                                                                                                                                                                                                            	return fmax((math.hypot((-30.0 * x), (-30.0 * y)) - 25.0), (math.fabs((30.0 * x)) - 0.2))
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            function code(x, y, z)
                                                                                                                                                                                                                            	return fmax(Float64(hypot(Float64(-30.0 * x), Float64(-30.0 * y)) - 25.0), Float64(abs(Float64(30.0 * x)) - 0.2))
                                                                                                                                                                                                                            end
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            function tmp = code(x, y, z)
                                                                                                                                                                                                                            	tmp = max((hypot((-30.0 * x), (-30.0 * y)) - 25.0), (abs((30.0 * x)) - 0.2));
                                                                                                                                                                                                                            end
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[(-30.0 * x), $MachinePrecision] ^ 2 + N[(-30.0 * y), $MachinePrecision] ^ 2], $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            \begin{array}{l}
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            \\
                                                                                                                                                                                                                            \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|30 \cdot x\right| - 0.2\right)
                                                                                                                                                                                                                            \end{array}
                                                                                                                                                                                                                            
                                                                                                                                                                                                                            Derivation
                                                                                                                                                                                                                            1. Initial program 43.8%

                                                                                                                                                                                                                              \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                            2. Add Preprocessing
                                                                                                                                                                                                                            3. Taylor expanded in z around 0

                                                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(\color{blue}{\sqrt{900 \cdot {x}^{2} + 900 \cdot {y}^{2}}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                            4. Step-by-step derivation
                                                                                                                                                                                                                              1. Applied rewrites68.9%

                                                                                                                                                                                                                                \[\leadsto \mathsf{max}\left(\color{blue}{\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                              2. Taylor expanded in y around 0

                                                                                                                                                                                                                                \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                              3. Step-by-step derivation
                                                                                                                                                                                                                                1. Applied rewrites68.4%

                                                                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\color{blue}{\mathsf{fma}\left(\sin \left(z \cdot 30\right), \cos \left(-30 \cdot x\right), \sin \left(30 \cdot x\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                                                                2. Taylor expanded in z around 0

                                                                                                                                                                                                                                  \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                                3. Step-by-step derivation
                                                                                                                                                                                                                                  1. Applied rewrites67.6%

                                                                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                                  2. Taylor expanded in x around 0

                                                                                                                                                                                                                                    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|30 \cdot x\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                                  3. Step-by-step derivation
                                                                                                                                                                                                                                    1. Applied rewrites67.2%

                                                                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(-30 \cdot x, -30 \cdot y\right) - 25, \left|30 \cdot x\right| - 0.2\right) \]
                                                                                                                                                                                                                                    2. Add Preprocessing

                                                                                                                                                                                                                                    Alternative 16: 32.0% accurate, 9.4× speedup?

                                                                                                                                                                                                                                    \[\begin{array}{l} \\ \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right) \end{array} \]
                                                                                                                                                                                                                                    (FPCore (x y z)
                                                                                                                                                                                                                                     :precision binary64
                                                                                                                                                                                                                                     (fmax (* -30.0 x) (- (fabs (* 30.0 x)) 0.2)))
                                                                                                                                                                                                                                    double code(double x, double y, double z) {
                                                                                                                                                                                                                                    	return fmax((-30.0 * x), (fabs((30.0 * x)) - 0.2));
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    module fmin_fmax_functions
                                                                                                                                                                                                                                        implicit none
                                                                                                                                                                                                                                        private
                                                                                                                                                                                                                                        public fmax
                                                                                                                                                                                                                                        public fmin
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                        interface fmax
                                                                                                                                                                                                                                            module procedure fmax88
                                                                                                                                                                                                                                            module procedure fmax44
                                                                                                                                                                                                                                            module procedure fmax84
                                                                                                                                                                                                                                            module procedure fmax48
                                                                                                                                                                                                                                        end interface
                                                                                                                                                                                                                                        interface fmin
                                                                                                                                                                                                                                            module procedure fmin88
                                                                                                                                                                                                                                            module procedure fmin44
                                                                                                                                                                                                                                            module procedure fmin84
                                                                                                                                                                                                                                            module procedure fmin48
                                                                                                                                                                                                                                        end interface
                                                                                                                                                                                                                                    contains
                                                                                                                                                                                                                                        real(8) function fmax88(x, y) result (res)
                                                                                                                                                                                                                                            real(8), intent (in) :: x
                                                                                                                                                                                                                                            real(8), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        real(4) function fmax44(x, y) result (res)
                                                                                                                                                                                                                                            real(4), intent (in) :: x
                                                                                                                                                                                                                                            real(4), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(y, merge(x, max(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        real(8) function fmax84(x, y) result(res)
                                                                                                                                                                                                                                            real(8), intent (in) :: x
                                                                                                                                                                                                                                            real(4), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        real(8) function fmax48(x, y) result(res)
                                                                                                                                                                                                                                            real(4), intent (in) :: x
                                                                                                                                                                                                                                            real(8), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        real(8) function fmin88(x, y) result (res)
                                                                                                                                                                                                                                            real(8), intent (in) :: x
                                                                                                                                                                                                                                            real(8), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        real(4) function fmin44(x, y) result (res)
                                                                                                                                                                                                                                            real(4), intent (in) :: x
                                                                                                                                                                                                                                            real(4), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(y, merge(x, min(x, y), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        real(8) function fmin84(x, y) result(res)
                                                                                                                                                                                                                                            real(8), intent (in) :: x
                                                                                                                                                                                                                                            real(4), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                        real(8) function fmin48(x, y) result(res)
                                                                                                                                                                                                                                            real(4), intent (in) :: x
                                                                                                                                                                                                                                            real(8), intent (in) :: y
                                                                                                                                                                                                                                            res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
                                                                                                                                                                                                                                        end function
                                                                                                                                                                                                                                    end module
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    real(8) function code(x, y, z)
                                                                                                                                                                                                                                    use fmin_fmax_functions
                                                                                                                                                                                                                                        real(8), intent (in) :: x
                                                                                                                                                                                                                                        real(8), intent (in) :: y
                                                                                                                                                                                                                                        real(8), intent (in) :: z
                                                                                                                                                                                                                                        code = fmax(((-30.0d0) * x), (abs((30.0d0 * x)) - 0.2d0))
                                                                                                                                                                                                                                    end function
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    public static double code(double x, double y, double z) {
                                                                                                                                                                                                                                    	return fmax((-30.0 * x), (Math.abs((30.0 * x)) - 0.2));
                                                                                                                                                                                                                                    }
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    def code(x, y, z):
                                                                                                                                                                                                                                    	return fmax((-30.0 * x), (math.fabs((30.0 * x)) - 0.2))
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    function code(x, y, z)
                                                                                                                                                                                                                                    	return fmax(Float64(-30.0 * x), Float64(abs(Float64(30.0 * x)) - 0.2))
                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    function tmp = code(x, y, z)
                                                                                                                                                                                                                                    	tmp = max((-30.0 * x), (abs((30.0 * x)) - 0.2));
                                                                                                                                                                                                                                    end
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    code[x_, y_, z_] := N[Max[N[(-30.0 * x), $MachinePrecision], N[(N[Abs[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    \begin{array}{l}
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    \\
                                                                                                                                                                                                                                    \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right)
                                                                                                                                                                                                                                    \end{array}
                                                                                                                                                                                                                                    
                                                                                                                                                                                                                                    Derivation
                                                                                                                                                                                                                                    1. Initial program 43.8%

                                                                                                                                                                                                                                      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                                    2. Add Preprocessing
                                                                                                                                                                                                                                    3. Taylor expanded in x around -inf

                                                                                                                                                                                                                                      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                                    4. Step-by-step derivation
                                                                                                                                                                                                                                      1. Applied rewrites17.2%

                                                                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x}, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                                      2. Taylor expanded in z around 0

                                                                                                                                                                                                                                        \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\sin \left(30 \cdot y\right) + \cos \left(30 \cdot y\right) \cdot \sin \left(30 \cdot x\right)}\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                                      3. Step-by-step derivation
                                                                                                                                                                                                                                        1. Applied rewrites16.8%

                                                                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\color{blue}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \cos \left(-30 \cdot y\right), \sin \left(y \cdot 30\right)\right)}\right| - 0.2\right) \]
                                                                                                                                                                                                                                        2. Taylor expanded in y around 0

                                                                                                                                                                                                                                          \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                                        3. Step-by-step derivation
                                                                                                                                                                                                                                          1. Applied rewrites16.3%

                                                                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|\sin \left(30 \cdot x\right)\right| - 0.2\right) \]
                                                                                                                                                                                                                                          2. Taylor expanded in x around 0

                                                                                                                                                                                                                                            \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - \frac{1}{5}\right) \]
                                                                                                                                                                                                                                          3. Step-by-step derivation
                                                                                                                                                                                                                                            1. Applied rewrites29.0%

                                                                                                                                                                                                                                              \[\leadsto \mathsf{max}\left(-30 \cdot x, \left|30 \cdot x\right| - 0.2\right) \]
                                                                                                                                                                                                                                            2. Add Preprocessing

                                                                                                                                                                                                                                            Reproduce

                                                                                                                                                                                                                                            ?
                                                                                                                                                                                                                                            herbie shell --seed 2025018 
                                                                                                                                                                                                                                            (FPCore (x y z)
                                                                                                                                                                                                                                              :name "Gyroid sphere"
                                                                                                                                                                                                                                              :precision binary64
                                                                                                                                                                                                                                              (fmax (- (sqrt (+ (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0)) (pow (* z 30.0) 2.0))) 25.0) (- (fabs (+ (+ (* (sin (* x 30.0)) (cos (* y 30.0))) (* (sin (* y 30.0)) (cos (* z 30.0)))) (* (sin (* z 30.0)) (cos (* x 30.0))))) 0.2)))