Gyroid sphere

Percentage Accurate: 46.2% → 85.7%
Time: 5.0s
Alternatives: 2
Speedup: 8.6×

Specification

?
\[\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) \]
(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]
\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)

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 2 alternatives:

AlternativeAccuracySpeedup
The accuracy (vertical axis) and speed (horizontal axis) of each alternatives. Up and to the right is better. The red square shows the initial program, and each blue circle shows an alternative.The line shows the best available speed-accuracy tradeoffs.

Initial Program: 46.2% accurate, 1.0× speedup?

\[\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) \]
(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]
\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)

Alternative 1: 85.7% accurate, 3.1× speedup?

\[\begin{array}{l} t_0 := \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot y\right) + \sin \left(30 \cdot z\right)\right| - 0.2\right)\\ \mathbf{if}\;y \leq -8 \cdot 10^{+73}:\\ \;\;\;\;t\_0\\ \mathbf{elif}\;y \leq 3.2 \cdot 10^{+83}:\\ \;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - 0.2\right)\\ \mathbf{else}:\\ \;\;\;\;t\_0\\ \end{array} \]
(FPCore (x y z)
  :precision binary64
  (let* ((t_0
        (fmax
         (- (* -30.0 z) 25.0)
         (-
          (fabs (+ (+ (sin (* 30.0 x)) (* 30.0 y)) (sin (* 30.0 z))))
          0.2))))
  (if (<= y -8e+73)
    t_0
    (if (<= y 3.2e+83)
      (fmax
       (- (* -30.0 x) 25.0)
       (- (fabs (+ (* 30.0 x) (* 30.0 z))) 0.2))
      t_0))))
double code(double x, double y, double z) {
	double t_0 = fmax(((-30.0 * z) - 25.0), (fabs(((sin((30.0 * x)) + (30.0 * y)) + sin((30.0 * z)))) - 0.2));
	double tmp;
	if (y <= -8e+73) {
		tmp = t_0;
	} else if (y <= 3.2e+83) {
		tmp = fmax(((-30.0 * x) - 25.0), (fabs(((30.0 * x) + (30.0 * z))) - 0.2));
	} else {
		tmp = 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 = fmax((((-30.0d0) * z) - 25.0d0), (abs(((sin((30.0d0 * x)) + (30.0d0 * y)) + sin((30.0d0 * z)))) - 0.2d0))
    if (y <= (-8d+73)) then
        tmp = t_0
    else if (y <= 3.2d+83) then
        tmp = fmax((((-30.0d0) * x) - 25.0d0), (abs(((30.0d0 * x) + (30.0d0 * z))) - 0.2d0))
    else
        tmp = t_0
    end if
    code = tmp
end function
public static double code(double x, double y, double z) {
	double t_0 = fmax(((-30.0 * z) - 25.0), (Math.abs(((Math.sin((30.0 * x)) + (30.0 * y)) + Math.sin((30.0 * z)))) - 0.2));
	double tmp;
	if (y <= -8e+73) {
		tmp = t_0;
	} else if (y <= 3.2e+83) {
		tmp = fmax(((-30.0 * x) - 25.0), (Math.abs(((30.0 * x) + (30.0 * z))) - 0.2));
	} else {
		tmp = t_0;
	}
	return tmp;
}
def code(x, y, z):
	t_0 = fmax(((-30.0 * z) - 25.0), (math.fabs(((math.sin((30.0 * x)) + (30.0 * y)) + math.sin((30.0 * z)))) - 0.2))
	tmp = 0
	if y <= -8e+73:
		tmp = t_0
	elif y <= 3.2e+83:
		tmp = fmax(((-30.0 * x) - 25.0), (math.fabs(((30.0 * x) + (30.0 * z))) - 0.2))
	else:
		tmp = t_0
	return tmp
function code(x, y, z)
	t_0 = fmax(Float64(Float64(-30.0 * z) - 25.0), Float64(abs(Float64(Float64(sin(Float64(30.0 * x)) + Float64(30.0 * y)) + sin(Float64(30.0 * z)))) - 0.2))
	tmp = 0.0
	if (y <= -8e+73)
		tmp = t_0;
	elseif (y <= 3.2e+83)
		tmp = fmax(Float64(Float64(-30.0 * x) - 25.0), Float64(abs(Float64(Float64(30.0 * x) + Float64(30.0 * z))) - 0.2));
	else
		tmp = t_0;
	end
	return tmp
end
function tmp_2 = code(x, y, z)
	t_0 = max(((-30.0 * z) - 25.0), (abs(((sin((30.0 * x)) + (30.0 * y)) + sin((30.0 * z)))) - 0.2));
	tmp = 0.0;
	if (y <= -8e+73)
		tmp = t_0;
	elseif (y <= 3.2e+83)
		tmp = max(((-30.0 * x) - 25.0), (abs(((30.0 * x) + (30.0 * z))) - 0.2));
	else
		tmp = t_0;
	end
	tmp_2 = tmp;
end
code[x_, y_, z_] := Block[{t$95$0 = N[Max[N[(N[(-30.0 * z), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(N[Sin[N[(30.0 * x), $MachinePrecision]], $MachinePrecision] + N[(30.0 * y), $MachinePrecision]), $MachinePrecision] + N[Sin[N[(30.0 * z), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, -8e+73], t$95$0, If[LessEqual[y, 3.2e+83], N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x), $MachinePrecision] + N[(30.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot y\right) + \sin \left(30 \cdot z\right)\right| - 0.2\right)\\
\mathbf{if}\;y \leq -8 \cdot 10^{+73}:\\
\;\;\;\;t\_0\\

\mathbf{elif}\;y \leq 3.2 \cdot 10^{+83}:\\
\;\;\;\;\mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - 0.2\right)\\

\mathbf{else}:\\
\;\;\;\;t\_0\\


\end{array}
Derivation
  1. Split input into 2 regimes
  2. if y < -7.9999999999999999e73 or 3.1999999999999999e83 < y

    1. Initial program 46.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 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| - 0.2\right) \]
    3. Step-by-step derivation
      1. lower-*.f6430.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 rewrites30.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) \]
    5. Taylor expanded in y around 0

      \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\color{blue}{\left(\sin \left(30 \cdot x\right) + 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right)} + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    6. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

        \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
      7. lower-*.f6449.3%

        \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot \left(y \cdot \cos \left(30 \cdot z\right)\right)\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    7. Applied rewrites49.3%

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

      \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + \color{blue}{30 \cdot y}\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    9. Step-by-step derivation
      1. lower-+.f64N/A

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

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

        \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot y\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - \frac{1}{5}\right) \]
      4. lower-*.f6457.6%

        \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot y\right) + \sin \left(z \cdot 30\right) \cdot \cos \left(x \cdot 30\right)\right| - 0.2\right) \]
    10. Applied rewrites57.6%

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

      \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot y\right) + \color{blue}{\sin \left(30 \cdot z\right)}\right| - 0.2\right) \]
    12. Step-by-step derivation
      1. lower-sin.f64N/A

        \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot y\right) + \sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
      2. lower-*.f6457.5%

        \[\leadsto \mathsf{max}\left(-30 \cdot z - 25, \left|\left(\sin \left(30 \cdot x\right) + 30 \cdot y\right) + \sin \left(30 \cdot z\right)\right| - 0.2\right) \]
    13. Applied rewrites57.5%

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

    if -7.9999999999999999e73 < y < 3.1999999999999999e83

    1. Initial program 46.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| - 0.2\right) \]
    3. Step-by-step derivation
      1. lower-*.f6430.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 rewrites30.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) \]
    5. Taylor expanded in y around 0

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - 0.2\right) \]
    6. Step-by-step derivation
      1. lower-+.f64N/A

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

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

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

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

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

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

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
      8. lower-*.f6429.3%

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)\right| - 0.2\right) \]
    7. Applied rewrites29.3%

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

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + \color{blue}{30 \cdot x}\right| - 0.2\right) \]
    9. Step-by-step derivation
      1. lower-+.f64N/A

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

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - \frac{1}{5}\right) \]
      3. lower-*.f64N/A

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - \frac{1}{5}\right) \]
      4. lower-*.f6443.2%

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - 0.2\right) \]
    10. Applied rewrites43.2%

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

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot \color{blue}{z}\right| - 0.2\right) \]
    12. Step-by-step derivation
      1. lower-+.f64N/A

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - \frac{1}{5}\right) \]
      2. lower-*.f64N/A

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - \frac{1}{5}\right) \]
      3. lower-*.f6470.2%

        \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - 0.2\right) \]
    13. Applied rewrites70.2%

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

Alternative 2: 70.2% accurate, 8.6× speedup?

\[\mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - 0.2\right) \]
(FPCore (x y z)
  :precision binary64
  (fmax (- (* -30.0 x) 25.0) (- (fabs (+ (* 30.0 x) (* 30.0 z))) 0.2)))
double code(double x, double y, double z) {
	return fmax(((-30.0 * x) - 25.0), (fabs(((30.0 * x) + (30.0 * z))) - 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(((30.0d0 * x) + (30.0d0 * z))) - 0.2d0))
end function
public static double code(double x, double y, double z) {
	return fmax(((-30.0 * x) - 25.0), (Math.abs(((30.0 * x) + (30.0 * z))) - 0.2));
}
def code(x, y, z):
	return fmax(((-30.0 * x) - 25.0), (math.fabs(((30.0 * x) + (30.0 * z))) - 0.2))
function code(x, y, z)
	return fmax(Float64(Float64(-30.0 * x) - 25.0), Float64(abs(Float64(Float64(30.0 * x) + Float64(30.0 * z))) - 0.2))
end
function tmp = code(x, y, z)
	tmp = max(((-30.0 * x) - 25.0), (abs(((30.0 * x) + (30.0 * z))) - 0.2));
end
code[x_, y_, z_] := N[Max[N[(N[(-30.0 * x), $MachinePrecision] - 25.0), $MachinePrecision], N[(N[Abs[N[(N[(30.0 * x), $MachinePrecision] + N[(30.0 * z), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.2), $MachinePrecision]], $MachinePrecision]
\mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - 0.2\right)
Derivation
  1. Initial program 46.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| - 0.2\right) \]
  3. Step-by-step derivation
    1. lower-*.f6430.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 rewrites30.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) \]
  5. Taylor expanded in y around 0

    \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\color{blue}{\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)}\right| - 0.2\right) \]
  6. Step-by-step derivation
    1. lower-+.f64N/A

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

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

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

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

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

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

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)\right| - \frac{1}{5}\right) \]
    8. lower-*.f6429.3%

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot x\right) + \cos \left(30 \cdot x\right) \cdot \sin \left(30 \cdot z\right)\right| - 0.2\right) \]
  7. Applied rewrites29.3%

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

    \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + \color{blue}{30 \cdot x}\right| - 0.2\right) \]
  9. Step-by-step derivation
    1. lower-+.f64N/A

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

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - \frac{1}{5}\right) \]
    3. lower-*.f64N/A

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - \frac{1}{5}\right) \]
    4. lower-*.f6443.2%

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|\sin \left(30 \cdot z\right) + 30 \cdot x\right| - 0.2\right) \]
  10. Applied rewrites43.2%

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

    \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot \color{blue}{z}\right| - 0.2\right) \]
  12. Step-by-step derivation
    1. lower-+.f64N/A

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - \frac{1}{5}\right) \]
    2. lower-*.f64N/A

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - \frac{1}{5}\right) \]
    3. lower-*.f6470.2%

      \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot z\right| - 0.2\right) \]
  13. Applied rewrites70.2%

    \[\leadsto \mathsf{max}\left(-30 \cdot x - 25, \left|30 \cdot x + 30 \cdot \color{blue}{z}\right| - 0.2\right) \]
  14. Add Preprocessing

Reproduce

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