Gyroid sphere

Percentage Accurate: 45.2% → 99.9%
Time: 34.0s
Alternatives: 10
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}

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 10 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: 45.2% 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 z\right)}^{1}, {\left(30 \cdot y\right)}^{1}\right), 30 \cdot x\right) - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (fmax
  (- (hypot (hypot (pow (* 30.0 z) 1.0) (pow (* 30.0 y) 1.0)) (* 30.0 x)) 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((hypot(hypot(pow((30.0 * z), 1.0), pow((30.0 * y), 1.0)), (30.0 * x)) - 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));
}
public static double code(double x, double y, double z) {
	return fmax((Math.hypot(Math.hypot(Math.pow((30.0 * z), 1.0), Math.pow((30.0 * y), 1.0)), (30.0 * x)) - 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.hypot(math.hypot(math.pow((30.0 * z), 1.0), math.pow((30.0 * y), 1.0)), (30.0 * x)) - 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(hypot(hypot((Float64(30.0 * z) ^ 1.0), (Float64(30.0 * y) ^ 1.0)), Float64(30.0 * x)) - 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((hypot(hypot(((30.0 * z) ^ 1.0), ((30.0 * y) ^ 1.0)), (30.0 * x)) - 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[Sqrt[N[Power[N[(30.0 * z), $MachinePrecision], 1.0], $MachinePrecision] ^ 2 + N[Power[N[(30.0 * y), $MachinePrecision], 1.0], $MachinePrecision] ^ 2], $MachinePrecision] ^ 2 + N[(30.0 * x), $MachinePrecision] ^ 2], $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(\mathsf{hypot}\left(\mathsf{hypot}\left({\left(30 \cdot z\right)}^{1}, {\left(30 \cdot y\right)}^{1}\right), 30 \cdot x\right) - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right)
\end{array}
Derivation
  1. Initial program 45.2%

    \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
  2. Step-by-step derivation
    1. lift-sqrt.f64N/A

      \[\leadsto \mathsf{max}\left(\color{blue}{\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| - \frac{1}{5}\right) \]
    2. lift-+.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\color{blue}{\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| - \frac{1}{5}\right) \]
    3. lift-+.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\color{blue}{\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| - \frac{1}{5}\right) \]
    4. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\left({\color{blue}{\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| - \frac{1}{5}\right) \]
    5. lift-pow.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\left(\color{blue}{{\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| - \frac{1}{5}\right) \]
    6. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\color{blue}{\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| - \frac{1}{5}\right) \]
    7. lift-pow.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + \color{blue}{{\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| - \frac{1}{5}\right) \]
    8. lift-*.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\color{blue}{\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| - \frac{1}{5}\right) \]
    9. lift-pow.f64N/A

      \[\leadsto \mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + \color{blue}{{\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| - \frac{1}{5}\right) \]
    10. associate-+l+N/A

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

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

      \[\leadsto \mathsf{max}\left(\sqrt{{x}^{2} \cdot \color{blue}{900} + \left({\left(y \cdot 30\right)}^{2} + {\left(z \cdot 30\right)}^{2}\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
    13. *-commutativeN/A

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

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

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

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

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

      \[\leadsto \mathsf{max}\left(\sqrt{900 \cdot {x}^{2} + \left(900 \cdot {y}^{2} + {z}^{2} \cdot \color{blue}{900}\right)} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
    19. *-commutativeN/A

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

\\
\begin{array}{l}
t_0 := \sin \left(y \cdot 30\right)\\
t_1 := \sin \left(z \cdot 30\right)\\
t_2 := \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + t\_0 \cdot \cos \left(z \cdot 30\right)\right) + t\_1 \cdot \cos \left(x \cdot 30\right)\right| - 0.2\\
t_3 := \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(t\_0, \sin \left(\mathsf{fma}\left(z, 30, \frac{\pi}{2}\right)\right), t\_1 \cdot \sin \left(\mathsf{fma}\left(30, x, \frac{\pi}{2}\right)\right)\right)\right)\right|\\
\mathbf{if}\;x \leq -1.06 \cdot 10^{+161}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_2\right)\\

\mathbf{elif}\;x \leq 5.4 \cdot 10^{+151}:\\
\;\;\;\;\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\_3 \cdot t\_3 + \left(0.04 + t\_3 \cdot 0.2\right)}\right)\\

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


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

    1. Initial program 8.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6477.1

        \[\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) \]
    4. Applied rewrites77.1%

      \[\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.06e161 < x < 5.4000000000000003e151

    1. Initial program 57.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. Applied rewrites57.4%

      \[\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 5.4000000000000003e151 < x

    1. Initial program 9.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6477.8

        \[\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) \]
    4. Applied rewrites77.8%

      \[\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 3 regimes into one program.
  4. Add Preprocessing

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

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

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

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


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

    1. Initial program 8.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6477.1

        \[\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) \]
    4. Applied rewrites77.1%

      \[\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.06e161 < x < 5.4000000000000003e151

    1. Initial program 57.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) \]

    if 5.4000000000000003e151 < x

    1. Initial program 9.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6477.8

        \[\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) \]
    4. Applied rewrites77.8%

      \[\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 3 regimes into one program.
  4. Add Preprocessing

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

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;x \leq -0.84:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_0\right)\\ \mathbf{elif}\;x \leq 4 \cdot 10^{+30}:\\ \;\;\;\;\mathsf{max}\left(z \cdot 30 - 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (-
          (fabs
           (+
            (+
             (* (sin (* 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)))
   (if (<= x -0.84)
     (fmax (- (* -30.0 x) 25.0) t_0)
     (if (<= x 4e+30)
       (fmax (- (* z 30.0) 25.0) t_0)
       (fmax (- (* 30.0 x) 25.0) t_0)))))
double code(double x, double y, double z) {
	double t_0 = fabs((((sin((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 tmp;
	if (x <= -0.84) {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	} else if (x <= 4e+30) {
		tmp = fmax(((z * 30.0) - 25.0), t_0);
	} else {
		tmp = fmax(((30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs((((sin((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
    if (x <= (-0.84d0)) then
        tmp = fmax((((-30.0d0) * x) - 25.0d0), t_0)
    else if (x <= 4d+30) then
        tmp = fmax(((z * 30.0d0) - 25.0d0), t_0)
    else
        tmp = fmax(((30.0d0 * x) - 25.0d0), t_0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.abs((((Math.sin((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;
	double tmp;
	if (x <= -0.84) {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	} else if (x <= 4e+30) {
		tmp = fmax(((z * 30.0) - 25.0), t_0);
	} else {
		tmp = fmax(((30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.fabs((((math.sin((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
	tmp = 0
	if x <= -0.84:
		tmp = fmax(((-30.0 * x) - 25.0), t_0)
	elif x <= 4e+30:
		tmp = fmax(((z * 30.0) - 25.0), t_0)
	else:
		tmp = fmax(((30.0 * x) - 25.0), t_0)
	return tmp
function code(x, y, z)
	t_0 = Float64(abs(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)
	tmp = 0.0
	if (x <= -0.84)
		tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), t_0);
	elseif (x <= 4e+30)
		tmp = fmax(Float64(Float64(z * 30.0) - 25.0), t_0);
	else
		tmp = fmax(Float64(Float64(30.0 * x) - 25.0), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = abs((((sin((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;
	tmp = 0.0;
	if (x <= -0.84)
		tmp = max(((-30.0 * x) - 25.0), t_0);
	elseif (x <= 4e+30)
		tmp = max(((z * 30.0) - 25.0), t_0);
	else
		tmp = max(((30.0 * x) - 25.0), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(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]}, If[LessEqual[x, -0.84], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 4e+30], N[Max[N[(N[(z * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 34.0%

      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    2. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6460.3

        \[\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) \]
    4. Applied rewrites60.3%

      \[\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 -0.839999999999999969 < x < 4.0000000000000001e30

    1. Initial program 57.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. 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) \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{max}\left(z \cdot \color{blue}{30} - 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) \]
      2. lift-*.f6444.0

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

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

    1. Initial program 29.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6463.2

        \[\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) \]
    4. Applied rewrites63.2%

      \[\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 3 regimes into one program.
  4. Add Preprocessing

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

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;x \leq -0.84:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_0\right)\\ \mathbf{elif}\;x \leq 7.5 \cdot 10^{-80}:\\ \;\;\;\;\mathsf{max}\left(y \cdot 30 - 25, t\_0\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+30}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (-
          (fabs
           (+
            (+
             (* (sin (* 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)))
   (if (<= x -0.84)
     (fmax (- (* -30.0 x) 25.0) t_0)
     (if (<= x 7.5e-80)
       (fmax (- (* y 30.0) 25.0) t_0)
       (if (<= x 1.05e+30)
         (fmax (- (* -30.0 z) 25.0) t_0)
         (fmax (- (* 30.0 x) 25.0) t_0))))))
double code(double x, double y, double z) {
	double t_0 = fabs((((sin((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 tmp;
	if (x <= -0.84) {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	} else if (x <= 7.5e-80) {
		tmp = fmax(((y * 30.0) - 25.0), t_0);
	} else if (x <= 1.05e+30) {
		tmp = fmax(((-30.0 * z) - 25.0), t_0);
	} else {
		tmp = fmax(((30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs((((sin((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
    if (x <= (-0.84d0)) then
        tmp = fmax((((-30.0d0) * x) - 25.0d0), t_0)
    else if (x <= 7.5d-80) then
        tmp = fmax(((y * 30.0d0) - 25.0d0), t_0)
    else if (x <= 1.05d+30) then
        tmp = fmax((((-30.0d0) * z) - 25.0d0), t_0)
    else
        tmp = fmax(((30.0d0 * x) - 25.0d0), t_0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.abs((((Math.sin((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;
	double tmp;
	if (x <= -0.84) {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	} else if (x <= 7.5e-80) {
		tmp = fmax(((y * 30.0) - 25.0), t_0);
	} else if (x <= 1.05e+30) {
		tmp = fmax(((-30.0 * z) - 25.0), t_0);
	} else {
		tmp = fmax(((30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.fabs((((math.sin((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
	tmp = 0
	if x <= -0.84:
		tmp = fmax(((-30.0 * x) - 25.0), t_0)
	elif x <= 7.5e-80:
		tmp = fmax(((y * 30.0) - 25.0), t_0)
	elif x <= 1.05e+30:
		tmp = fmax(((-30.0 * z) - 25.0), t_0)
	else:
		tmp = fmax(((30.0 * x) - 25.0), t_0)
	return tmp
function code(x, y, z)
	t_0 = Float64(abs(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)
	tmp = 0.0
	if (x <= -0.84)
		tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), t_0);
	elseif (x <= 7.5e-80)
		tmp = fmax(Float64(Float64(y * 30.0) - 25.0), t_0);
	elseif (x <= 1.05e+30)
		tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), t_0);
	else
		tmp = fmax(Float64(Float64(30.0 * x) - 25.0), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = abs((((sin((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;
	tmp = 0.0;
	if (x <= -0.84)
		tmp = max(((-30.0 * x) - 25.0), t_0);
	elseif (x <= 7.5e-80)
		tmp = max(((y * 30.0) - 25.0), t_0);
	elseif (x <= 1.05e+30)
		tmp = max(((-30.0 * z) - 25.0), t_0);
	else
		tmp = max(((30.0 * x) - 25.0), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(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]}, If[LessEqual[x, -0.84], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 7.5e-80], N[Max[N[(N[(y * 30.0), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 1.05e+30], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]]
\begin{array}{l}

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

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

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

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


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

    1. Initial program 34.0%

      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    2. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6460.3

        \[\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) \]
    4. Applied rewrites60.3%

      \[\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 -0.839999999999999969 < x < 7.49999999999999999e-80

    1. Initial program 57.1%

      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    2. 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) \]
    3. Step-by-step derivation
      1. *-commutativeN/A

        \[\leadsto \mathsf{max}\left(y \cdot \color{blue}{30} - 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) \]
      2. lift-*.f6446.1

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

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

    1. Initial program 57.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6438.3

        \[\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) \]
    4. Applied rewrites38.3%

      \[\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.05e30 < x

    1. Initial program 29.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6463.1

        \[\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) \]
    4. Applied rewrites63.1%

      \[\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. Add Preprocessing

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

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;x \leq -0.84:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_0\right)\\ \mathbf{elif}\;x \leq 1.05 \cdot 10^{+30}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot z - 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(30 \cdot x - 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (-
          (fabs
           (+
            (+
             (* (sin (* 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)))
   (if (<= x -0.84)
     (fmax (- (* -30.0 x) 25.0) t_0)
     (if (<= x 1.05e+30)
       (fmax (- (* -30.0 z) 25.0) t_0)
       (fmax (- (* 30.0 x) 25.0) t_0)))))
double code(double x, double y, double z) {
	double t_0 = fabs((((sin((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 tmp;
	if (x <= -0.84) {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	} else if (x <= 1.05e+30) {
		tmp = fmax(((-30.0 * z) - 25.0), t_0);
	} else {
		tmp = fmax(((30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs((((sin((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
    if (x <= (-0.84d0)) then
        tmp = fmax((((-30.0d0) * x) - 25.0d0), t_0)
    else if (x <= 1.05d+30) then
        tmp = fmax((((-30.0d0) * z) - 25.0d0), t_0)
    else
        tmp = fmax(((30.0d0 * x) - 25.0d0), t_0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.abs((((Math.sin((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;
	double tmp;
	if (x <= -0.84) {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	} else if (x <= 1.05e+30) {
		tmp = fmax(((-30.0 * z) - 25.0), t_0);
	} else {
		tmp = fmax(((30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.fabs((((math.sin((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
	tmp = 0
	if x <= -0.84:
		tmp = fmax(((-30.0 * x) - 25.0), t_0)
	elif x <= 1.05e+30:
		tmp = fmax(((-30.0 * z) - 25.0), t_0)
	else:
		tmp = fmax(((30.0 * x) - 25.0), t_0)
	return tmp
function code(x, y, z)
	t_0 = Float64(abs(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)
	tmp = 0.0
	if (x <= -0.84)
		tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), t_0);
	elseif (x <= 1.05e+30)
		tmp = fmax(Float64(Float64(-30.0 * z) - 25.0), t_0);
	else
		tmp = fmax(Float64(Float64(30.0 * x) - 25.0), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = abs((((sin((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;
	tmp = 0.0;
	if (x <= -0.84)
		tmp = max(((-30.0 * x) - 25.0), t_0);
	elseif (x <= 1.05e+30)
		tmp = max(((-30.0 * z) - 25.0), t_0);
	else
		tmp = max(((30.0 * x) - 25.0), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(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]}, If[LessEqual[x, -0.84], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], If[LessEqual[x, 1.05e+30], N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]]
\begin{array}{l}

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

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

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


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

    1. Initial program 34.0%

      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    2. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6460.3

        \[\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) \]
    4. Applied rewrites60.3%

      \[\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 -0.839999999999999969 < x < 1.05e30

    1. Initial program 57.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6443.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) \]
    4. Applied rewrites43.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.05e30 < x

    1. Initial program 29.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6463.1

        \[\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) \]
    4. Applied rewrites63.1%

      \[\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 3 regimes into one program.
  4. Add Preprocessing

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

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

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

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


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

    1. Initial program 34.0%

      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    2. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6460.3

        \[\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) \]
    4. Applied rewrites60.3%

      \[\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 -0.839999999999999969 < x

    1. Initial program 49.1%

      \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    2. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6434.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) \]
    4. Applied rewrites34.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 2 regimes into one program.
  4. Add Preprocessing

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

\[\begin{array}{l} \\ \begin{array}{l} t_0 := \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\\ \mathbf{if}\;y \leq -4.6 \cdot 10^{+35}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot y - 25, t\_0\right)\\ \mathbf{else}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, t\_0\right)\\ \end{array} \end{array} \]
(FPCore (x y z)
 :precision binary64
 (let* ((t_0
         (-
          (fabs
           (+
            (+
             (* (sin (* 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)))
   (if (<= y -4.6e+35)
     (fmax (- (* -30.0 y) 25.0) t_0)
     (fmax (- (* -30.0 x) 25.0) t_0))))
double code(double x, double y, double z) {
	double t_0 = fabs((((sin((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 tmp;
	if (y <= -4.6e+35) {
		tmp = fmax(((-30.0 * y) - 25.0), t_0);
	} else {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
module fmin_fmax_functions
    implicit none
    private
    public fmax
    public fmin

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

real(8) function code(x, y, z)
use fmin_fmax_functions
    real(8), intent (in) :: x
    real(8), intent (in) :: y
    real(8), intent (in) :: z
    real(8) :: t_0
    real(8) :: tmp
    t_0 = abs((((sin((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
    if (y <= (-4.6d+35)) then
        tmp = fmax((((-30.0d0) * y) - 25.0d0), t_0)
    else
        tmp = fmax((((-30.0d0) * x) - 25.0d0), t_0)
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = Math.abs((((Math.sin((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;
	double tmp;
	if (y <= -4.6e+35) {
		tmp = fmax(((-30.0 * y) - 25.0), t_0);
	} else {
		tmp = fmax(((-30.0 * x) - 25.0), t_0);
	}
	return tmp;
}
def code(x, y, z):
	t_0 = math.fabs((((math.sin((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
	tmp = 0
	if y <= -4.6e+35:
		tmp = fmax(((-30.0 * y) - 25.0), t_0)
	else:
		tmp = fmax(((-30.0 * x) - 25.0), t_0)
	return tmp
function code(x, y, z)
	t_0 = Float64(abs(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)
	tmp = 0.0
	if (y <= -4.6e+35)
		tmp = fmax(Float64(Float64(-30.0 * y) - 25.0), t_0);
	else
		tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), t_0);
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = abs((((sin((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;
	tmp = 0.0;
	if (y <= -4.6e+35)
		tmp = max(((-30.0 * y) - 25.0), t_0);
	else
		tmp = max(((-30.0 * x) - 25.0), t_0);
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[(N[Abs[N[(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]}, If[LessEqual[y, -4.6e+35], N[Max[N[(N[(-30.0 * y), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], t$95$0], $MachinePrecision]]]
\begin{array}{l}

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

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


\end{array}
\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -4.5999999999999996e35

    1. Initial program 30.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6464.8

        \[\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) \]
    4. Applied rewrites64.8%

      \[\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 -4.5999999999999996e35 < y

    1. Initial program 49.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. 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) \]
    3. Step-by-step derivation
      1. lower-*.f6435.1

        \[\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) \]
    4. Applied rewrites35.1%

      \[\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 2 regimes into one program.
  4. Add Preprocessing

Alternative 9: 30.0% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{max}\left(-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) \end{array} \]
(FPCore (x y z)
 :precision binary64
 (fmax
  (- (* -30.0 x) 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(((-30.0 * x) - 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((((-30.0d0) * x) - 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(((-30.0 * x) - 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(((-30.0 * x) - 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(Float64(-30.0 * x) - 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(((-30.0 * x) - 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[(-30.0 * x), $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(-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)
\end{array}
Derivation
  1. Initial program 45.2%

    \[\mathsf{max}\left(\sqrt{\left({\left(x \cdot 30\right)}^{2} + {\left(y \cdot 30\right)}^{2}\right) + {\left(z \cdot 30\right)}^{2}} - 25, \left|\left(\sin \left(x \cdot 30\right) \cdot \cos \left(y \cdot 30\right) + \sin \left(y \cdot 30\right) \cdot \cos \left(z \cdot 30\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
  2. 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) \]
  3. Step-by-step derivation
    1. lower-*.f6430.0

      \[\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) \]
  4. Applied rewrites30.0%

    \[\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) \]
  5. Add Preprocessing

Alternative 10: 26.3% accurate, N/A× speedup?

\[\begin{array}{l} \\ \mathsf{max}\left(\left(\mathsf{fma}\left(\frac{\frac{\mathsf{fma}\left(z \cdot z, 900, \left(y \cdot y\right) \cdot 900\right)}{x} \cdot -0.016666666666666666 - 25}{x}, -1, 30\right) \cdot x\right) \cdot -1, \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
  (*
   (*
    (fma
     (/
      (-
       (* (/ (fma (* z z) 900.0 (* (* y y) 900.0)) x) -0.016666666666666666)
       25.0)
      x)
     -1.0
     30.0)
    x)
   -1.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(((fma(((((fma((z * z), 900.0, ((y * y) * 900.0)) / x) * -0.016666666666666666) - 25.0) / x), -1.0, 30.0) * x) * -1.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));
}
function code(x, y, z)
	return fmax(Float64(Float64(fma(Float64(Float64(Float64(Float64(fma(Float64(z * z), 900.0, Float64(Float64(y * y) * 900.0)) / x) * -0.016666666666666666) - 25.0) / x), -1.0, 30.0) * x) * -1.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
code[x_, y_, z_] := N[Max[N[(N[(N[(N[(N[(N[(N[(N[(N[(z * z), $MachinePrecision] * 900.0 + N[(N[(y * y), $MachinePrecision] * 900.0), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision] * -0.016666666666666666), $MachinePrecision] - 25.0), $MachinePrecision] / x), $MachinePrecision] * -1.0 + 30.0), $MachinePrecision] * x), $MachinePrecision] * -1.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(\left(\mathsf{fma}\left(\frac{\frac{\mathsf{fma}\left(z \cdot z, 900, \left(y \cdot y\right) \cdot 900\right)}{x} \cdot -0.016666666666666666 - 25}{x}, -1, 30\right) \cdot x\right) \cdot -1, \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}
Derivation
  1. Initial program 45.2%

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

    \[\leadsto \mathsf{max}\left(\color{blue}{-1 \cdot \left(x \cdot \left(30 + -1 \cdot \frac{\frac{-1}{60} \cdot \frac{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}{x} - 25}{x}\right)\right)}, \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) \]
  3. Step-by-step derivation
    1. *-commutativeN/A

      \[\leadsto \mathsf{max}\left(\left(x \cdot \left(30 + -1 \cdot \frac{\frac{-1}{60} \cdot \frac{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}{x} - 25}{x}\right)\right) \cdot \color{blue}{-1}, \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) \]
    2. lower-*.f64N/A

      \[\leadsto \mathsf{max}\left(\left(x \cdot \left(30 + -1 \cdot \frac{\frac{-1}{60} \cdot \frac{900 \cdot {y}^{2} + 900 \cdot {z}^{2}}{x} - 25}{x}\right)\right) \cdot \color{blue}{-1}, \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. Applied rewrites26.3%

    \[\leadsto \mathsf{max}\left(\color{blue}{\left(\mathsf{fma}\left(\frac{\frac{\mathsf{fma}\left(z \cdot z, 900, \left(y \cdot y\right) \cdot 900\right)}{x} \cdot -0.016666666666666666 - 25}{x}, -1, 30\right) \cdot x\right) \cdot -1}, \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. Add Preprocessing

Reproduce

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