Gyroid sphere

Percentage Accurate: 46.5% → 99.9%
Time: 10.0s
Alternatives: 8
Speedup: N/A×

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 8 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.5% 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: 99.9% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) + -1 \cdot 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - 0.2\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (fmax
  (+
   (hypot (hypot (pow (* 30.0 y) 1.0) (pow (* 30.0 x) 1.0)) (* z 30.0))
   (* -1.0 25.0))
  (-
   (fabs
    (fma
     (sin (* 30.0 x))
     (sin (fma y 30.0 (/ PI 2.0)))
     (fma
      (sin (* y 30.0))
      (sin (fma z 30.0 (/ PI 2.0)))
      (* (sin (* z 30.0)) (sin (fma 30.0 x (/ PI 2.0)))))))
   0.2)))
double code(double x, double y, double z) {
	return fmax((hypot(hypot(pow((30.0 * y), 1.0), pow((30.0 * x), 1.0)), (z * 30.0)) + (-1.0 * 25.0)), (fabs(fma(sin((30.0 * x)), sin(fma(y, 30.0, (((double) M_PI) / 2.0))), fma(sin((y * 30.0)), sin(fma(z, 30.0, (((double) M_PI) / 2.0))), (sin((z * 30.0)) * sin(fma(30.0, x, (((double) M_PI) / 2.0))))))) - 0.2));
}
function code(x, y, z)
	return fmax(Float64(hypot(hypot((Float64(30.0 * y) ^ 1.0), (Float64(30.0 * x) ^ 1.0)), Float64(z * 30.0)) + Float64(-1.0 * 25.0)), Float64(abs(fma(sin(Float64(30.0 * x)), sin(fma(y, 30.0, Float64(pi / 2.0))), fma(sin(Float64(y * 30.0)), sin(fma(z, 30.0, Float64(pi / 2.0))), Float64(sin(Float64(z * 30.0)) * sin(fma(30.0, x, Float64(pi / 2.0))))))) - 0.2))
end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[Sqrt[N[Power[N[(30.0 * y), $MachinePrecision], 1.0], $MachinePrecision] ^ 2 + N[Power[N[(30.0 * x), $MachinePrecision], 1.0], $MachinePrecision] ^ 2], $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y * 30.0 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Sin[N[(y * 30.0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(z * 30.0 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(N[Sin[N[(z * 30.0), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(30.0 * x + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) + -1 \cdot 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - 0.2\right)
\end{array}
Derivation
  1. Initial program 42.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. Applied rewrites54.3%

    \[\leadsto \color{blue}{\mathsf{max}\left(\mathsf{hypot}\left({\left(\mathsf{fma}\left(y \cdot y, 900, \left(x \cdot x\right) \cdot 900\right)\right)}^{0.5}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - 0.2\right)} \]
  4. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\color{blue}{{\left(\mathsf{fma}\left(y \cdot y, 900, \left(x \cdot x\right) \cdot 900\right)\right)}^{\frac{1}{2}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    2. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\left(\mathsf{fma}\left(\color{blue}{y \cdot y}, 900, \left(x \cdot x\right) \cdot 900\right)\right)}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    3. lift-fma.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\color{blue}{\left(\left(y \cdot y\right) \cdot 900 + \left(x \cdot x\right) \cdot 900\right)}}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\left(\left(y \cdot y\right) \cdot 900 + \color{blue}{\left(x \cdot x\right) \cdot 900}\right)}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    5. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\left(\left(y \cdot y\right) \cdot 900 + \color{blue}{\left(x \cdot x\right)} \cdot 900\right)}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    6. unpow1/2N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\color{blue}{\sqrt{\left(y \cdot y\right) \cdot 900 + \left(x \cdot x\right) \cdot 900}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    7. pow2N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{\color{blue}{{y}^{2}} \cdot 900 + \left(x \cdot x\right) \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{y}^{2} \cdot \color{blue}{{30}^{2}} + \left(x \cdot x\right) \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    9. unpow-prod-downN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{\color{blue}{{\left(y \cdot 30\right)}^{2}} + \left(x \cdot x\right) \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    10. pow2N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{2} + \color{blue}{{x}^{2}} \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{2} + {x}^{2} \cdot \color{blue}{{30}^{2}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    12. unpow-prod-downN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{2} + \color{blue}{{\left(x \cdot 30\right)}^{2}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    13. sqr-powN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{\color{blue}{{\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)}} + {\left(x \cdot 30\right)}^{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    14. sqr-powN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)} + \color{blue}{{\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    15. lower-hypot.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\color{blue}{\mathsf{hypot}\left({\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right)}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\color{blue}{\left(30 \cdot y\right)}}^{\left(\frac{2}{2}\right)}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{\color{blue}{1}}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    18. lower-pow.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left(\color{blue}{{\left(30 \cdot y\right)}^{1}}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    19. lower-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\color{blue}{\left(30 \cdot y\right)}}^{1}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
  5. Applied rewrites99.9%

    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\color{blue}{\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right)}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - 0.2\right) \]
  6. Final simplification99.9%

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

Alternative 2: 99.6% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) + -1 \cdot 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot x\right)\right)\right)\right)\right| - 0.2\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (fmax
  (+
   (hypot (hypot (pow (* 30.0 y) 1.0) (pow (* 30.0 x) 1.0)) (* z 30.0))
   (* -1.0 25.0))
  (-
   (fabs
    (fma
     (sin (* 30.0 x))
     (sin (fma y 30.0 (/ PI 2.0)))
     (fma
      30.0
      (* y (sin (fma 0.5 PI (* 30.0 z))))
      (* (sin (* 30.0 z)) (sin (fma 0.5 PI (* 30.0 x)))))))
   0.2)))
double code(double x, double y, double z) {
	return fmax((hypot(hypot(pow((30.0 * y), 1.0), pow((30.0 * x), 1.0)), (z * 30.0)) + (-1.0 * 25.0)), (fabs(fma(sin((30.0 * x)), sin(fma(y, 30.0, (((double) M_PI) / 2.0))), fma(30.0, (y * sin(fma(0.5, ((double) M_PI), (30.0 * z)))), (sin((30.0 * z)) * sin(fma(0.5, ((double) M_PI), (30.0 * x))))))) - 0.2));
}
function code(x, y, z)
	return fmax(Float64(hypot(hypot((Float64(30.0 * y) ^ 1.0), (Float64(30.0 * x) ^ 1.0)), Float64(z * 30.0)) + Float64(-1.0 * 25.0)), Float64(abs(fma(sin(Float64(30.0 * x)), sin(fma(y, 30.0, Float64(pi / 2.0))), fma(30.0, Float64(y * sin(fma(0.5, pi, Float64(30.0 * z)))), Float64(sin(Float64(30.0 * z)) * sin(fma(0.5, pi, Float64(30.0 * x))))))) - 0.2))
end
code[x_, y_, z_] := N[Max[N[(N[Sqrt[N[Sqrt[N[Power[N[(30.0 * y), $MachinePrecision], 1.0], $MachinePrecision] ^ 2 + N[Power[N[(30.0 * x), $MachinePrecision], 1.0], $MachinePrecision] ^ 2], $MachinePrecision] ^ 2 + N[(z * 30.0), $MachinePrecision] ^ 2], $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], N[(N[Abs[N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y * 30.0 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(30.0 * N[(y * N[Sin[N[(0.5 * Pi + N[(30.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] + N[(N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(0.5 * Pi + N[(30.0 * x), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\begin{array}{l}

\\
\mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) + -1 \cdot 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot x\right)\right)\right)\right)\right| - 0.2\right)
\end{array}
Derivation
  1. Initial program 42.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. Applied rewrites54.3%

    \[\leadsto \color{blue}{\mathsf{max}\left(\mathsf{hypot}\left({\left(\mathsf{fma}\left(y \cdot y, 900, \left(x \cdot x\right) \cdot 900\right)\right)}^{0.5}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - 0.2\right)} \]
  4. Step-by-step derivation
    1. lift-pow.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\color{blue}{{\left(\mathsf{fma}\left(y \cdot y, 900, \left(x \cdot x\right) \cdot 900\right)\right)}^{\frac{1}{2}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    2. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\left(\mathsf{fma}\left(\color{blue}{y \cdot y}, 900, \left(x \cdot x\right) \cdot 900\right)\right)}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    3. lift-fma.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\color{blue}{\left(\left(y \cdot y\right) \cdot 900 + \left(x \cdot x\right) \cdot 900\right)}}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\left(\left(y \cdot y\right) \cdot 900 + \color{blue}{\left(x \cdot x\right) \cdot 900}\right)}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    5. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left({\left(\left(y \cdot y\right) \cdot 900 + \color{blue}{\left(x \cdot x\right)} \cdot 900\right)}^{\frac{1}{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    6. unpow1/2N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\color{blue}{\sqrt{\left(y \cdot y\right) \cdot 900 + \left(x \cdot x\right) \cdot 900}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    7. pow2N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{\color{blue}{{y}^{2}} \cdot 900 + \left(x \cdot x\right) \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    8. metadata-evalN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{y}^{2} \cdot \color{blue}{{30}^{2}} + \left(x \cdot x\right) \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    9. unpow-prod-downN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{\color{blue}{{\left(y \cdot 30\right)}^{2}} + \left(x \cdot x\right) \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    10. pow2N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{2} + \color{blue}{{x}^{2}} \cdot 900}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    11. metadata-evalN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{2} + {x}^{2} \cdot \color{blue}{{30}^{2}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    12. unpow-prod-downN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{2} + \color{blue}{{\left(x \cdot 30\right)}^{2}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    13. sqr-powN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{\color{blue}{{\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)}} + {\left(x \cdot 30\right)}^{2}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    14. sqr-powN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\sqrt{{\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)} + \color{blue}{{\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)} \cdot {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}}}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    15. lower-hypot.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\color{blue}{\mathsf{hypot}\left({\left(y \cdot 30\right)}^{\left(\frac{2}{2}\right)}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right)}, z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    16. *-commutativeN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\color{blue}{\left(30 \cdot y\right)}}^{\left(\frac{2}{2}\right)}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    17. metadata-evalN/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{\color{blue}{1}}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    18. lower-pow.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left(\color{blue}{{\left(30 \cdot y\right)}^{1}}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
    19. lower-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\color{blue}{\left(30 \cdot y\right)}}^{1}, {\left(x \cdot 30\right)}^{\left(\frac{2}{2}\right)}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
  5. Applied rewrites99.9%

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

    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \color{blue}{30 \cdot \left(y \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot z\right)\right) + \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)}\right)\right| - \frac{1}{5}\right) \]
  7. Step-by-step derivation
    1. lower-fma.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, \color{blue}{y \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot z\right)}, \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    2. lower-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \color{blue}{\sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot z\right)}, \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    3. lower-sin.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot z\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    4. lower-fma.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \mathsf{PI}\left(\right), 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    5. lift-PI.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    6. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    7. lower-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    8. lift-sin.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    9. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    10. lower-sin.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\frac{1}{2} \cdot \mathsf{PI}\left(\right) + 30 \cdot x\right)\right)\right)\right| - \frac{1}{5}\right) \]
    11. lower-fma.f64N/A

      \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\mathsf{fma}\left(\frac{1}{2}, \mathsf{PI}\left(\right), 30 \cdot x\right)\right)\right)\right)\right| - \frac{1}{5}\right) \]
  8. Applied rewrites99.6%

    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) - 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \color{blue}{\mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot x\right)\right)\right)}\right)\right| - 0.2\right) \]
  9. Final simplification99.6%

    \[\leadsto \mathsf{max}\left(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot y\right)}^{1}, {\left(30 \cdot x\right)}^{1}\right), z \cdot 30\right) + -1 \cdot 25, \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(30, y \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot z\right)\right), \sin \left(30 \cdot z\right) \cdot \sin \left(\mathsf{fma}\left(0.5, \pi, 30 \cdot x\right)\right)\right)\right)\right| - 0.2\right) \]
  10. Add Preprocessing

Alternative 3: 58.7% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \sin \left(z \cdot 30\right)\\ t_1 := \sin \left(y \cdot 30\right)\\ t_2 := \mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(t\_1, \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), t\_0 \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\\ t_3 := \left|t\_2\right|\\ t_4 := \left|t\_0 \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + t\_1 \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_4\right)\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-131}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_4\right)\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{+148}:\\ \;\;\;\;\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, \frac{{t\_3}^{3} - 0.008}{t\_2 \cdot t\_2 + \left(0.04 + t\_3 \cdot 0.2\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 25, t\_4\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0 (sin (* z 30.0)))
        (t_1 (sin (* y 30.0)))
        (t_2
         (fma
          (sin (* 30.0 x))
          (sin (fma y 30.0 (/ PI 2.0)))
          (fma
           t_1
           (sin (fma z 30.0 (/ PI 2.0)))
           (* t_0 (sin (fma 30.0 x (/ PI 2.0)))))))
        (t_3 (fabs t_2))
        (t_4
         (-
          (fabs
           (+
            (* t_0 (cos (* x 30.0)))
            (+
             (* (sin (* x 30.0)) (cos (* y 30.0)))
             (* t_1 (cos (* z 30.0))))))
          0.2)))
   (if (<= x -1.15e+112)
     (fmax (+ (* -30.0 x) (* -1.0 25.0)) t_4)
     (if (<= x -2.1e-131)
       (fmax (+ (* -30.0 y) (* -1.0 25.0)) t_4)
       (if (<= x 6.5e+148)
         (fmax
          (-
           (sqrt
            (+
             (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
             (pow (* z 30.0) 2.0)))
           25.0)
          (/ (- (pow t_3 3.0) 0.008) (+ (* t_2 t_2) (+ 0.04 (* t_3 0.2)))))
         (fmax (+ (* 30.0 x) (* -1.0 25.0)) t_4))))))
double code(double x, double y, double z) {
	double t_0 = sin((z * 30.0));
	double t_1 = sin((y * 30.0));
	double t_2 = fma(sin((30.0 * x)), sin(fma(y, 30.0, (((double) M_PI) / 2.0))), fma(t_1, sin(fma(z, 30.0, (((double) M_PI) / 2.0))), (t_0 * sin(fma(30.0, x, (((double) M_PI) / 2.0))))));
	double t_3 = fabs(t_2);
	double t_4 = fabs(((t_0 * cos((x * 30.0))) + ((sin((x * 30.0)) * cos((y * 30.0))) + (t_1 * cos((z * 30.0)))))) - 0.2;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_4);
	} else if (x <= -2.1e-131) {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_4);
	} else if (x <= 6.5e+148) {
		tmp = fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), ((pow(t_3, 3.0) - 0.008) / ((t_2 * t_2) + (0.04 + (t_3 * 0.2)))));
	} else {
		tmp = fmax(((30.0 * x) + (-1.0 * 25.0)), t_4);
	}
	return tmp;
}
function code(x, y, z)
	t_0 = sin(Float64(z * 30.0))
	t_1 = sin(Float64(y * 30.0))
	t_2 = fma(sin(Float64(30.0 * x)), sin(fma(y, 30.0, Float64(pi / 2.0))), fma(t_1, sin(fma(z, 30.0, Float64(pi / 2.0))), Float64(t_0 * sin(fma(30.0, x, Float64(pi / 2.0))))))
	t_3 = abs(t_2)
	t_4 = Float64(abs(Float64(Float64(t_0 * cos(Float64(x * 30.0))) + Float64(Float64(sin(Float64(x * 30.0)) * cos(Float64(y * 30.0))) + Float64(t_1 * cos(Float64(z * 30.0)))))) - 0.2)
	tmp = 0.0
	if (x <= -1.15e+112)
		tmp = fmax(Float64(Float64(-30.0 * x) + Float64(-1.0 * 25.0)), t_4);
	elseif (x <= -2.1e-131)
		tmp = fmax(Float64(Float64(-30.0 * y) + Float64(-1.0 * 25.0)), t_4);
	elseif (x <= 6.5e+148)
		tmp = 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(Float64((t_3 ^ 3.0) - 0.008) / Float64(Float64(t_2 * t_2) + Float64(0.04 + Float64(t_3 * 0.2)))));
	else
		tmp = fmax(Float64(Float64(30.0 * x) + Float64(-1.0 * 25.0)), t_4);
	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[(y * 30.0), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] * N[Sin[N[(y * 30.0 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(t$95$1 * N[Sin[N[(z * 30.0 + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] + N[(t$95$0 * N[Sin[N[(30.0 * x + N[(Pi / 2.0), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[Abs[t$95$2], $MachinePrecision]}, Block[{t$95$4 = 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[(t$95$1 * N[Cos[N[(z * 30.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]}, If[LessEqual[x, -1.15e+112], N[Max[N[(N[(-30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$4], $MachinePrecision], If[LessEqual[x, -2.1e-131], N[Max[N[(N[(-30.0 * y), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$4], $MachinePrecision], If[LessEqual[x, 6.5e+148], 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[(N[Power[t$95$3, 3.0], $MachinePrecision] - 0.008), $MachinePrecision] / N[(N[(t$95$2 * t$95$2), $MachinePrecision] + N[(0.04 + N[(t$95$3 * 0.2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$4], $MachinePrecision]]]]]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \sin \left(z \cdot 30\right)\\
t_1 := \sin \left(y \cdot 30\right)\\
t_2 := \mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(t\_1, \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), t\_0 \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\\
t_3 := \left|t\_2\right|\\
t_4 := \left|t\_0 \cdot \cos \left(x \cdot 30\right) + \left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + t\_1 \cdot \cos \left(z \cdot 30\right)\right)\right| - 0.2\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_4\right)\\

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-131}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_4\right)\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{+148}:\\
\;\;\;\;\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, \frac{{t\_3}^{3} - 0.008}{t\_2 \cdot t\_2 + \left(0.04 + t\_3 \cdot 0.2\right)}\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 25, t\_4\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.15e112

    1. Initial program 12.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 x around -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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. lower-*.f6479.5

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites79.5%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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 -1.15e112 < x < -2.09999999999999997e-131

    1. Initial program 45.5%

      \[\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 -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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. lower-*.f6456.7

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 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) \]
    5. Applied rewrites56.7%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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.09999999999999997e-131 < x < 6.49999999999999947e148

    1. Initial program 59.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. Applied rewrites59.6%

      \[\leadsto \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, \color{blue}{\frac{{\left(\left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right|\right)}^{3} - 0.008}{\left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| \cdot \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| + \left(0.04 + \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| \cdot 0.2\right)}}\right) \]

    if 6.49999999999999947e148 < x

    1. Initial program 11.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 x around inf

      \[\leadsto \mathsf{max}\left(\color{blue}{30 \cdot x} - 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. lower-*.f6478.6

        \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites78.6%

      \[\leadsto \mathsf{max}\left(\color{blue}{30 \cdot x} - 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) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 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{elif}\;x \leq -2.1 \cdot 10^{-131}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 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{elif}\;x \leq 6.5 \cdot 10^{+148}:\\ \;\;\;\;\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, \frac{{\left(\left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right|\right)}^{3} - 0.008}{\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right) \cdot \mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right) + \left(0.04 + \left|\mathsf{fma}\left(\sin \left(30 \cdot x\right), \sin \left(\mathsf{fma}\left(y, 30, \frac{\pi}{2}\right)\right), \mathsf{fma}\left(\sin \left(y \cdot 30\right), \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), \sin \left(z \cdot 30\right) \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right| \cdot 0.2\right)}\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 4: 58.7% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\ \mathbf{elif}\;x \leq -2.1 \cdot 10^{-131}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\ \mathbf{elif}\;x \leq 6.5 \cdot 10^{+148}:\\ \;\;\;\;\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, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_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)))
   (if (<= x -1.15e+112)
     (fmax (+ (* -30.0 x) (* -1.0 25.0)) t_0)
     (if (<= x -2.1e-131)
       (fmax (+ (* -30.0 y) (* -1.0 25.0)) t_0)
       (if (<= x 6.5e+148)
         (fmax
          (-
           (sqrt
            (+
             (+ (pow (* x 30.0) 2.0) (pow (* y 30.0) 2.0))
             (pow (* z 30.0) 2.0)))
           25.0)
          t_0)
         (fmax (+ (* 30.0 x) (* -1.0 25.0)) t_0))))))
double code(double x, double y, double z) {
	double t_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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else if (x <= -2.1e-131) {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	} else if (x <= 6.5e+148) {
		tmp = fmax((sqrt(((pow((x * 30.0), 2.0) + pow((y * 30.0), 2.0)) + pow((z * 30.0), 2.0))) - 25.0), t_0);
	} else {
		tmp = fmax(((30.0 * x) + (-1.0 * 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((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
    if (x <= (-1.15d+112)) then
        tmp = fmax((((-30.0d0) * x) + ((-1.0d0) * 25.0d0)), t_0)
    else if (x <= (-2.1d-131)) then
        tmp = fmax((((-30.0d0) * y) + ((-1.0d0) * 25.0d0)), t_0)
    else if (x <= 6.5d+148) then
        tmp = fmax((sqrt(((((x * 30.0d0) ** 2.0d0) + ((y * 30.0d0) ** 2.0d0)) + ((z * 30.0d0) ** 2.0d0))) - 25.0d0), t_0)
    else
        tmp = fmax(((30.0d0 * x) + ((-1.0d0) * 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((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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else if (x <= -2.1e-131) {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	} else if (x <= 6.5e+148) {
		tmp = 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), t_0);
	} else {
		tmp = fmax(((30.0 * x) + (-1.0 * 25.0)), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_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
	tmp = 0
	if x <= -1.15e+112:
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0)
	elif x <= -2.1e-131:
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0)
	elif x <= 6.5e+148:
		tmp = 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), t_0)
	else:
		tmp = fmax(((30.0 * x) + (-1.0 * 25.0)), t_0)
	return tmp
function code(x, y, z)
	t_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)
	tmp = 0.0
	if (x <= -1.15e+112)
		tmp = fmax(Float64(Float64(-30.0 * x) + Float64(-1.0 * 25.0)), t_0);
	elseif (x <= -2.1e-131)
		tmp = fmax(Float64(Float64(-30.0 * y) + Float64(-1.0 * 25.0)), t_0);
	elseif (x <= 6.5e+148)
		tmp = 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), t_0);
	else
		tmp = fmax(Float64(Float64(30.0 * x) + Float64(-1.0 * 25.0)), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_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;
	tmp = 0.0;
	if (x <= -1.15e+112)
		tmp = max(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	elseif (x <= -2.1e-131)
		tmp = max(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	elseif (x <= 6.5e+148)
		tmp = max((sqrt(((((x * 30.0) ^ 2.0) + ((y * 30.0) ^ 2.0)) + ((z * 30.0) ^ 2.0))) - 25.0), t_0);
	else
		tmp = max(((30.0 * x) + (-1.0 * 25.0)), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[x, -1.15e+112], N[Max[N[(N[(-30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, -2.1e-131], N[Max[N[(N[(-30.0 * y), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 6.5e+148], 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], t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \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\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\

\mathbf{elif}\;x \leq -2.1 \cdot 10^{-131}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\

\mathbf{elif}\;x \leq 6.5 \cdot 10^{+148}:\\
\;\;\;\;\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, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 25, t\_0\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.15e112

    1. Initial program 12.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 x around -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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. lower-*.f6479.5

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites79.5%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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 -1.15e112 < x < -2.09999999999999997e-131

    1. Initial program 45.5%

      \[\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 -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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. lower-*.f6456.7

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 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) \]
    5. Applied rewrites56.7%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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.09999999999999997e-131 < x < 6.49999999999999947e148

    1. Initial program 59.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

    if 6.49999999999999947e148 < x

    1. Initial program 11.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 x around inf

      \[\leadsto \mathsf{max}\left(\color{blue}{30 \cdot x} - 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. lower-*.f6478.6

        \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites78.6%

      \[\leadsto \mathsf{max}\left(\color{blue}{30 \cdot x} - 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) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification65.0%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 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{elif}\;x \leq -2.1 \cdot 10^{-131}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 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{elif}\;x \leq 6.5 \cdot 10^{+148}:\\ \;\;\;\;\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)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 5: 50.8% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-220}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\ \mathbf{elif}\;x \leq 1.3 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot z + -1 \cdot 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_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)))
   (if (<= x -1.15e+112)
     (fmax (+ (* -30.0 x) (* -1.0 25.0)) t_0)
     (if (<= x -3.5e-220)
       (fmax (+ (* -30.0 y) (* -1.0 25.0)) t_0)
       (if (<= x 1.3e+68)
         (fmax (+ (* -30.0 z) (* -1.0 25.0)) t_0)
         (fmax (+ (* 30.0 x) (* -1.0 25.0)) t_0))))))
double code(double x, double y, double z) {
	double t_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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else if (x <= -3.5e-220) {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	} else if (x <= 1.3e+68) {
		tmp = fmax(((-30.0 * z) + (-1.0 * 25.0)), t_0);
	} else {
		tmp = fmax(((30.0 * x) + (-1.0 * 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((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
    if (x <= (-1.15d+112)) then
        tmp = fmax((((-30.0d0) * x) + ((-1.0d0) * 25.0d0)), t_0)
    else if (x <= (-3.5d-220)) then
        tmp = fmax((((-30.0d0) * y) + ((-1.0d0) * 25.0d0)), t_0)
    else if (x <= 1.3d+68) then
        tmp = fmax((((-30.0d0) * z) + ((-1.0d0) * 25.0d0)), t_0)
    else
        tmp = fmax(((30.0d0 * x) + ((-1.0d0) * 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((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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else if (x <= -3.5e-220) {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	} else if (x <= 1.3e+68) {
		tmp = fmax(((-30.0 * z) + (-1.0 * 25.0)), t_0);
	} else {
		tmp = fmax(((30.0 * x) + (-1.0 * 25.0)), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_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
	tmp = 0
	if x <= -1.15e+112:
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0)
	elif x <= -3.5e-220:
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0)
	elif x <= 1.3e+68:
		tmp = fmax(((-30.0 * z) + (-1.0 * 25.0)), t_0)
	else:
		tmp = fmax(((30.0 * x) + (-1.0 * 25.0)), t_0)
	return tmp
function code(x, y, z)
	t_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)
	tmp = 0.0
	if (x <= -1.15e+112)
		tmp = fmax(Float64(Float64(-30.0 * x) + Float64(-1.0 * 25.0)), t_0);
	elseif (x <= -3.5e-220)
		tmp = fmax(Float64(Float64(-30.0 * y) + Float64(-1.0 * 25.0)), t_0);
	elseif (x <= 1.3e+68)
		tmp = fmax(Float64(Float64(-30.0 * z) + Float64(-1.0 * 25.0)), t_0);
	else
		tmp = fmax(Float64(Float64(30.0 * x) + Float64(-1.0 * 25.0)), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_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;
	tmp = 0.0;
	if (x <= -1.15e+112)
		tmp = max(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	elseif (x <= -3.5e-220)
		tmp = max(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	elseif (x <= 1.3e+68)
		tmp = max(((-30.0 * z) + (-1.0 * 25.0)), t_0);
	else
		tmp = max(((30.0 * x) + (-1.0 * 25.0)), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[x, -1.15e+112], N[Max[N[(N[(-30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, -3.5e-220], N[Max[N[(N[(-30.0 * y), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 1.3e+68], N[Max[N[(N[(-30.0 * z), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \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\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\

\mathbf{elif}\;x \leq -3.5 \cdot 10^{-220}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\

\mathbf{elif}\;x \leq 1.3 \cdot 10^{+68}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z + -1 \cdot 25, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(30 \cdot x + -1 \cdot 25, t\_0\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 4 regimes
  2. if x < -1.15e112

    1. Initial program 12.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 x around -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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. lower-*.f6479.5

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites79.5%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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 -1.15e112 < x < -3.49999999999999988e-220

    1. Initial program 48.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 -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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. lower-*.f6454.5

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 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) \]
    5. Applied rewrites54.5%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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 -3.49999999999999988e-220 < x < 1.2999999999999999e68

    1. Initial program 58.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 -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot z} - 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. lower-*.f6450.8

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{z} - 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) \]
    5. Applied rewrites50.8%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot z} - 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 1.2999999999999999e68 < x

    1. Initial program 27.5%

      \[\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} - 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. lower-*.f6473.7

        \[\leadsto \mathsf{max}\left(30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites73.7%

      \[\leadsto \mathsf{max}\left(\color{blue}{30 \cdot x} - 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) \]
  3. Recombined 4 regimes into one program.
  4. Final simplification61.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 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{elif}\;x \leq -3.5 \cdot 10^{-220}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 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{elif}\;x \leq 1.3 \cdot 10^{+68}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot z + -1 \cdot 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(30 \cdot x + -1 \cdot 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 6: 40.0% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\ \mathbf{elif}\;x \leq -3.5 \cdot 10^{-220}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot z + -1 \cdot 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_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)))
   (if (<= x -1.15e+112)
     (fmax (+ (* -30.0 x) (* -1.0 25.0)) t_0)
     (if (<= x -3.5e-220)
       (fmax (+ (* -30.0 y) (* -1.0 25.0)) t_0)
       (fmax (+ (* -30.0 z) (* -1.0 25.0)) t_0)))))
double code(double x, double y, double z) {
	double t_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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else if (x <= -3.5e-220) {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	} else {
		tmp = fmax(((-30.0 * z) + (-1.0 * 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((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
    if (x <= (-1.15d+112)) then
        tmp = fmax((((-30.0d0) * x) + ((-1.0d0) * 25.0d0)), t_0)
    else if (x <= (-3.5d-220)) then
        tmp = fmax((((-30.0d0) * y) + ((-1.0d0) * 25.0d0)), t_0)
    else
        tmp = fmax((((-30.0d0) * z) + ((-1.0d0) * 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((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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else if (x <= -3.5e-220) {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	} else {
		tmp = fmax(((-30.0 * z) + (-1.0 * 25.0)), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_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
	tmp = 0
	if x <= -1.15e+112:
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0)
	elif x <= -3.5e-220:
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0)
	else:
		tmp = fmax(((-30.0 * z) + (-1.0 * 25.0)), t_0)
	return tmp
function code(x, y, z)
	t_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)
	tmp = 0.0
	if (x <= -1.15e+112)
		tmp = fmax(Float64(Float64(-30.0 * x) + Float64(-1.0 * 25.0)), t_0);
	elseif (x <= -3.5e-220)
		tmp = fmax(Float64(Float64(-30.0 * y) + Float64(-1.0 * 25.0)), t_0);
	else
		tmp = fmax(Float64(Float64(-30.0 * z) + Float64(-1.0 * 25.0)), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_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;
	tmp = 0.0;
	if (x <= -1.15e+112)
		tmp = max(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	elseif (x <= -3.5e-220)
		tmp = max(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	else
		tmp = max(((-30.0 * z) + (-1.0 * 25.0)), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[x, -1.15e+112], N[Max[N[(N[(-30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, -3.5e-220], N[Max[N[(N[(-30.0 * y), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(-30.0 * z), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \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\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\

\mathbf{elif}\;x \leq -3.5 \cdot 10^{-220}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot z + -1 \cdot 25, t\_0\right)\\


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

    1. Initial program 12.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 x around -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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. lower-*.f6479.5

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites79.5%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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 -1.15e112 < x < -3.49999999999999988e-220

    1. Initial program 48.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 -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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. lower-*.f6454.5

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 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) \]
    5. Applied rewrites54.5%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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 -3.49999999999999988e-220 < x

    1. Initial program 45.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 -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot z} - 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. lower-*.f6435.7

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{z} - 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) \]
    5. Applied rewrites35.7%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot z} - 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) \]
  3. Recombined 3 regimes into one program.
  4. Final simplification47.2%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 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{elif}\;x \leq -3.5 \cdot 10^{-220}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 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(-30 \cdot z + -1 \cdot 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 7: 39.5% accurate, N/A× speedup?

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_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)))
   (if (<= x -1.15e+112)
     (fmax (+ (* -30.0 x) (* -1.0 25.0)) t_0)
     (fmax (+ (* -30.0 y) (* -1.0 25.0)) t_0))))
double code(double x, double y, double z) {
	double t_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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else {
		tmp = fmax(((-30.0 * y) + (-1.0 * 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((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
    if (x <= (-1.15d+112)) then
        tmp = fmax((((-30.0d0) * x) + ((-1.0d0) * 25.0d0)), t_0)
    else
        tmp = fmax((((-30.0d0) * y) + ((-1.0d0) * 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((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;
	double tmp;
	if (x <= -1.15e+112) {
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	} else {
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_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
	tmp = 0
	if x <= -1.15e+112:
		tmp = fmax(((-30.0 * x) + (-1.0 * 25.0)), t_0)
	else:
		tmp = fmax(((-30.0 * y) + (-1.0 * 25.0)), t_0)
	return tmp
function code(x, y, z)
	t_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)
	tmp = 0.0
	if (x <= -1.15e+112)
		tmp = fmax(Float64(Float64(-30.0 * x) + Float64(-1.0 * 25.0)), t_0);
	else
		tmp = fmax(Float64(Float64(-30.0 * y) + Float64(-1.0 * 25.0)), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_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;
	tmp = 0.0;
	if (x <= -1.15e+112)
		tmp = max(((-30.0 * x) + (-1.0 * 25.0)), t_0);
	else
		tmp = max(((-30.0 * y) + (-1.0 * 25.0)), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = 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]}, If[LessEqual[x, -1.15e+112], N[Max[N[(N[(-30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(-30.0 * y), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $MachinePrecision], t$95$0], $MachinePrecision]]]
\begin{array}{l}

\\
\begin{array}{l}
t_0 := \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\\
\mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 25, t\_0\right)\\

\mathbf{else}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot y + -1 \cdot 25, t\_0\right)\\


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if x < -1.15e112

    1. Initial program 12.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 x around -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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. lower-*.f6479.5

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 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) \]
    5. Applied rewrites79.5%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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 -1.15e112 < x

    1. Initial program 46.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 y around -inf

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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. lower-*.f6435.4

        \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{y} - 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) \]
    5. Applied rewrites35.4%

      \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot y} - 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) \]
  3. Recombined 2 regimes into one program.
  4. Final simplification41.6%

    \[\leadsto \begin{array}{l} \mathbf{if}\;x \leq -1.15 \cdot 10^{+112}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x + -1 \cdot 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(-30 \cdot y + -1 \cdot 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)\\ \end{array} \]
  5. Add Preprocessing

Alternative 8: 30.5% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{max}\left(-30 \cdot x + -1 \cdot 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) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (fmax
  (+ (* -30.0 x) (* -1.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)))
double code(double x, double y, double z) {
	return fmax(((-30.0 * x) + (-1.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));
}
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) + ((-1.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))
end function
public static double code(double x, double y, double z) {
	return fmax(((-30.0 * x) + (-1.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));
}
def code(x, y, z):
	return fmax(((-30.0 * x) + (-1.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))
function code(x, y, z)
	return fmax(Float64(Float64(-30.0 * x) + Float64(-1.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))
end
function tmp = code(x, y, z)
	tmp = max(((-30.0 * x) + (-1.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));
end
code[x_, y_, z_] := N[Max[N[(N[(-30.0 * x), $MachinePrecision] + N[(-1.0 * 25.0), $MachinePrecision]), $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]
\begin{array}{l}

\\
\mathsf{max}\left(-30 \cdot x + -1 \cdot 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)
\end{array}
Derivation
  1. Initial program 42.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} - 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. lower-*.f6427.4

      \[\leadsto \mathsf{max}\left(-30 \cdot \color{blue}{x} - 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) \]
  5. Applied rewrites27.4%

    \[\leadsto \mathsf{max}\left(\color{blue}{-30 \cdot x} - 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) \]
  6. Final simplification27.4%

    \[\leadsto \mathsf{max}\left(-30 \cdot x + -1 \cdot 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) \]
  7. Add Preprocessing

Reproduce

?
herbie shell --seed 2025065 
(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)))