
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (+ (pow (- y 0.275) 2.0) (pow (- x 0.275) 2.0)))))
(fmin
(fmin
(fmin
(fmin
(fmax (fmax (fmax (- y 0.55) (- y)) (- x 0.825)) (- 0.725 x))
(- (sqrt (+ (pow (- y 0.7) 2.0) (pow (- x 0.775) 2.0))) 0.075))
(fmax (fmax (fmax (- y) (- y 0.275)) (- x 0.55)) (- 0.45 x)))
(fmax (fmax (fmax (- y) (- y 1.0)) (- x 0.1)) (- x)))
(fmax
(fmax
(fmax (fmax (fmax (- y 0.55) (- x 0.55)) (- x)) (- 0.275 y))
(- 0.175 t_0))
(- t_0 0.275)))))
double code(double x, double y) {
double t_0 = sqrt((pow((y - 0.275), 2.0) + pow((x - 0.275), 2.0)));
return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (sqrt((pow((y - 0.7), 2.0) + pow((x - 0.775), 2.0))) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275)));
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = sqrt((((y - 0.275d0) ** 2.0d0) + ((x - 0.275d0) ** 2.0d0)))
code = fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55d0), -y), (x - 0.825d0)), (0.725d0 - x)), (sqrt((((y - 0.7d0) ** 2.0d0) + ((x - 0.775d0) ** 2.0d0))) - 0.075d0)), fmax(fmax(fmax(-y, (y - 0.275d0)), (x - 0.55d0)), (0.45d0 - x))), fmax(fmax(fmax(-y, (y - 1.0d0)), (x - 0.1d0)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55d0), (x - 0.55d0)), -x), (0.275d0 - y)), (0.175d0 - t_0)), (t_0 - 0.275d0)))
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((Math.pow((y - 0.275), 2.0) + Math.pow((x - 0.275), 2.0)));
return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (Math.sqrt((Math.pow((y - 0.7), 2.0) + Math.pow((x - 0.775), 2.0))) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275)));
}
def code(x, y): t_0 = math.sqrt((math.pow((y - 0.275), 2.0) + math.pow((x - 0.275), 2.0))) return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (math.sqrt((math.pow((y - 0.7), 2.0) + math.pow((x - 0.775), 2.0))) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275)))
function code(x, y) t_0 = sqrt(Float64((Float64(y - 0.275) ^ 2.0) + (Float64(x - 0.275) ^ 2.0))) return fmin(fmin(fmin(fmin(fmax(fmax(fmax(Float64(y - 0.55), Float64(-y)), Float64(x - 0.825)), Float64(0.725 - x)), Float64(sqrt(Float64((Float64(y - 0.7) ^ 2.0) + (Float64(x - 0.775) ^ 2.0))) - 0.075)), fmax(fmax(fmax(Float64(-y), Float64(y - 0.275)), Float64(x - 0.55)), Float64(0.45 - x))), fmax(fmax(fmax(Float64(-y), Float64(y - 1.0)), Float64(x - 0.1)), Float64(-x))), fmax(fmax(fmax(fmax(fmax(Float64(y - 0.55), Float64(x - 0.55)), Float64(-x)), Float64(0.275 - y)), Float64(0.175 - t_0)), Float64(t_0 - 0.275))) end
function tmp = code(x, y) t_0 = sqrt((((y - 0.275) ^ 2.0) + ((x - 0.275) ^ 2.0))); tmp = min(min(min(min(max(max(max((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (sqrt((((y - 0.7) ^ 2.0) + ((x - 0.775) ^ 2.0))) - 0.075)), max(max(max(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), max(max(max(-y, (y - 1.0)), (x - 0.1)), -x)), max(max(max(max(max((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275))); end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(N[Power[N[(y - 0.275), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(x - 0.275), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Min[N[Min[N[Min[N[Min[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], (-y)], $MachinePrecision], N[(x - 0.825), $MachinePrecision]], $MachinePrecision], N[(0.725 - x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[Power[N[(y - 0.7), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(x - 0.775), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.075), $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 0.275), $MachinePrecision]], $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], N[(0.45 - x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 1.0), $MachinePrecision]], $MachinePrecision], N[(x - 0.1), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision], N[(0.275 - y), $MachinePrecision]], $MachinePrecision], N[(0.175 - t$95$0), $MachinePrecision]], $MachinePrecision], N[(t$95$0 - 0.275), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(y - 0.275\right)}^{2} + {\left(x - 0.275\right)}^{2}}\\
\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, -y\right), x - 0.825\right), 0.725 - x\right), \sqrt{{\left(y - 0.7\right)}^{2} + {\left(x - 0.775\right)}^{2}} - 0.075\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 0.275\right), x - 0.55\right), 0.45 - x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 1\right), x - 0.1\right), -x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, x - 0.55\right), -x\right), 0.275 - y\right), 0.175 - t\_0\right), t\_0 - 0.275\right)\right)
\end{array}
\end{array}
Herbie found 4 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y)
:precision binary64
(let* ((t_0 (sqrt (+ (pow (- y 0.275) 2.0) (pow (- x 0.275) 2.0)))))
(fmin
(fmin
(fmin
(fmin
(fmax (fmax (fmax (- y 0.55) (- y)) (- x 0.825)) (- 0.725 x))
(- (sqrt (+ (pow (- y 0.7) 2.0) (pow (- x 0.775) 2.0))) 0.075))
(fmax (fmax (fmax (- y) (- y 0.275)) (- x 0.55)) (- 0.45 x)))
(fmax (fmax (fmax (- y) (- y 1.0)) (- x 0.1)) (- x)))
(fmax
(fmax
(fmax (fmax (fmax (- y 0.55) (- x 0.55)) (- x)) (- 0.275 y))
(- 0.175 t_0))
(- t_0 0.275)))))
double code(double x, double y) {
double t_0 = sqrt((pow((y - 0.275), 2.0) + pow((x - 0.275), 2.0)));
return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (sqrt((pow((y - 0.7), 2.0) + pow((x - 0.775), 2.0))) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275)));
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
t_0 = sqrt((((y - 0.275d0) ** 2.0d0) + ((x - 0.275d0) ** 2.0d0)))
code = fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55d0), -y), (x - 0.825d0)), (0.725d0 - x)), (sqrt((((y - 0.7d0) ** 2.0d0) + ((x - 0.775d0) ** 2.0d0))) - 0.075d0)), fmax(fmax(fmax(-y, (y - 0.275d0)), (x - 0.55d0)), (0.45d0 - x))), fmax(fmax(fmax(-y, (y - 1.0d0)), (x - 0.1d0)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55d0), (x - 0.55d0)), -x), (0.275d0 - y)), (0.175d0 - t_0)), (t_0 - 0.275d0)))
end function
public static double code(double x, double y) {
double t_0 = Math.sqrt((Math.pow((y - 0.275), 2.0) + Math.pow((x - 0.275), 2.0)));
return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (Math.sqrt((Math.pow((y - 0.7), 2.0) + Math.pow((x - 0.775), 2.0))) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275)));
}
def code(x, y): t_0 = math.sqrt((math.pow((y - 0.275), 2.0) + math.pow((x - 0.275), 2.0))) return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (math.sqrt((math.pow((y - 0.7), 2.0) + math.pow((x - 0.775), 2.0))) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275)))
function code(x, y) t_0 = sqrt(Float64((Float64(y - 0.275) ^ 2.0) + (Float64(x - 0.275) ^ 2.0))) return fmin(fmin(fmin(fmin(fmax(fmax(fmax(Float64(y - 0.55), Float64(-y)), Float64(x - 0.825)), Float64(0.725 - x)), Float64(sqrt(Float64((Float64(y - 0.7) ^ 2.0) + (Float64(x - 0.775) ^ 2.0))) - 0.075)), fmax(fmax(fmax(Float64(-y), Float64(y - 0.275)), Float64(x - 0.55)), Float64(0.45 - x))), fmax(fmax(fmax(Float64(-y), Float64(y - 1.0)), Float64(x - 0.1)), Float64(-x))), fmax(fmax(fmax(fmax(fmax(Float64(y - 0.55), Float64(x - 0.55)), Float64(-x)), Float64(0.275 - y)), Float64(0.175 - t_0)), Float64(t_0 - 0.275))) end
function tmp = code(x, y) t_0 = sqrt((((y - 0.275) ^ 2.0) + ((x - 0.275) ^ 2.0))); tmp = min(min(min(min(max(max(max((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (sqrt((((y - 0.7) ^ 2.0) + ((x - 0.775) ^ 2.0))) - 0.075)), max(max(max(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), max(max(max(-y, (y - 1.0)), (x - 0.1)), -x)), max(max(max(max(max((y - 0.55), (x - 0.55)), -x), (0.275 - y)), (0.175 - t_0)), (t_0 - 0.275))); end
code[x_, y_] := Block[{t$95$0 = N[Sqrt[N[(N[Power[N[(y - 0.275), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(x - 0.275), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision]}, N[Min[N[Min[N[Min[N[Min[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], (-y)], $MachinePrecision], N[(x - 0.825), $MachinePrecision]], $MachinePrecision], N[(0.725 - x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[Power[N[(y - 0.7), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(x - 0.775), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.075), $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 0.275), $MachinePrecision]], $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], N[(0.45 - x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 1.0), $MachinePrecision]], $MachinePrecision], N[(x - 0.1), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision], N[(0.275 - y), $MachinePrecision]], $MachinePrecision], N[(0.175 - t$95$0), $MachinePrecision]], $MachinePrecision], N[(t$95$0 - 0.275), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \sqrt{{\left(y - 0.275\right)}^{2} + {\left(x - 0.275\right)}^{2}}\\
\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, -y\right), x - 0.825\right), 0.725 - x\right), \sqrt{{\left(y - 0.7\right)}^{2} + {\left(x - 0.775\right)}^{2}} - 0.075\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 0.275\right), x - 0.55\right), 0.45 - x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 1\right), x - 0.1\right), -x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, x - 0.55\right), -x\right), 0.275 - y\right), 0.175 - t\_0\right), t\_0 - 0.275\right)\right)
\end{array}
\end{array}
(FPCore (x y)
:precision binary64
(fmin
(fmin
(fmin
(fmin
(fmax (fmax (fmax (- y 0.55) (- y)) (- x 0.825)) (- 0.725 x))
(- (sqrt (fma (- x 0.775) (- x 0.775) (* (- y 0.7) (- y 0.7)))) 0.075))
(fmax (fmax (fmax (- y) (- y 0.275)) (- x 0.55)) (- 0.45 x)))
(fmax (fmax (fmax (- y) (- y 1.0)) (- x 0.1)) (- x)))
(fmax
(fmax (fmax (fmax (fmax (- y 0.55) (- x 0.55)) (- x)) (- 0.275 y)) y)
(- (sqrt (fma (- x 0.275) (- x 0.275) (* (- y 0.275) y))) 0.275))))
double code(double x, double y) {
return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (sqrt(fma((x - 0.775), (x - 0.775), ((y - 0.7) * (y - 0.7)))) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), y), (sqrt(fma((x - 0.275), (x - 0.275), ((y - 0.275) * y))) - 0.275)));
}
function code(x, y) return fmin(fmin(fmin(fmin(fmax(fmax(fmax(Float64(y - 0.55), Float64(-y)), Float64(x - 0.825)), Float64(0.725 - x)), Float64(sqrt(fma(Float64(x - 0.775), Float64(x - 0.775), Float64(Float64(y - 0.7) * Float64(y - 0.7)))) - 0.075)), fmax(fmax(fmax(Float64(-y), Float64(y - 0.275)), Float64(x - 0.55)), Float64(0.45 - x))), fmax(fmax(fmax(Float64(-y), Float64(y - 1.0)), Float64(x - 0.1)), Float64(-x))), fmax(fmax(fmax(fmax(fmax(Float64(y - 0.55), Float64(x - 0.55)), Float64(-x)), Float64(0.275 - y)), y), Float64(sqrt(fma(Float64(x - 0.275), Float64(x - 0.275), Float64(Float64(y - 0.275) * y))) - 0.275))) end
code[x_, y_] := N[Min[N[Min[N[Min[N[Min[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], (-y)], $MachinePrecision], N[(x - 0.825), $MachinePrecision]], $MachinePrecision], N[(0.725 - x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(x - 0.775), $MachinePrecision] * N[(x - 0.775), $MachinePrecision] + N[(N[(y - 0.7), $MachinePrecision] * N[(y - 0.7), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.075), $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 0.275), $MachinePrecision]], $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], N[(0.45 - x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 1.0), $MachinePrecision]], $MachinePrecision], N[(x - 0.1), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision], N[(0.275 - y), $MachinePrecision]], $MachinePrecision], y], $MachinePrecision], N[(N[Sqrt[N[(N[(x - 0.275), $MachinePrecision] * N[(x - 0.275), $MachinePrecision] + N[(N[(y - 0.275), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]], $MachinePrecision] - 0.275), $MachinePrecision]], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, -y\right), x - 0.825\right), 0.725 - x\right), \sqrt{\mathsf{fma}\left(x - 0.775, x - 0.775, \left(y - 0.7\right) \cdot \left(y - 0.7\right)\right)} - 0.075\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 0.275\right), x - 0.55\right), 0.45 - x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 1\right), x - 0.1\right), -x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, x - 0.55\right), -x\right), 0.275 - y\right), y\right), \sqrt{\mathsf{fma}\left(x - 0.275, x - 0.275, \left(y - 0.275\right) \cdot y\right)} - 0.275\right)\right)
\end{array}
Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in y around inf
Applied rewrites100.0%
Taylor expanded in y around -inf
Applied rewrites100.0%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fmax (fmax (fmax (- y 0.55) (- x 0.55)) (- x)) (- 0.275 y)))
(t_1 (fmax (fmax (fmax (- y 0.55) (- y)) (- x 0.825)) (- 0.725 x)))
(t_2 (fmax (fmax (fmax (- y) (- y 1.0)) (- x 0.1)) (- x)))
(t_3 (fmax (fmax (fmax (- y) (- y 0.275)) (- x 0.55)) (- 0.45 x)))
(t_4
(fmax
(fmax
t_0
(-
0.175
(sqrt (fma (- x 0.275) (- x 0.275) (* (- y 0.275) (- y 0.275))))))
y)))
(if (<= y -3.2e+25)
(fmin (fmin (fmin (fmin t_1 (- y)) t_3) t_2) t_4)
(if (<= y 5.4e+51)
(fmin
(fmin
(fmin
(fmin t_1 (- (sqrt (fma (- x 0.775) (- x 0.775) 0.49)) 0.075))
t_3)
t_2)
(fmax (fmax t_0 x) y))
(fmin (fmin (fmin (fmin t_1 y) t_3) t_2) t_4)))))
double code(double x, double y) {
double t_0 = fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y));
double t_1 = fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x));
double t_2 = fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x);
double t_3 = fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x));
double t_4 = fmax(fmax(t_0, (0.175 - sqrt(fma((x - 0.275), (x - 0.275), ((y - 0.275) * (y - 0.275)))))), y);
double tmp;
if (y <= -3.2e+25) {
tmp = fmin(fmin(fmin(fmin(t_1, -y), t_3), t_2), t_4);
} else if (y <= 5.4e+51) {
tmp = fmin(fmin(fmin(fmin(t_1, (sqrt(fma((x - 0.775), (x - 0.775), 0.49)) - 0.075)), t_3), t_2), fmax(fmax(t_0, x), y));
} else {
tmp = fmin(fmin(fmin(fmin(t_1, y), t_3), t_2), t_4);
}
return tmp;
}
function code(x, y) t_0 = fmax(fmax(fmax(Float64(y - 0.55), Float64(x - 0.55)), Float64(-x)), Float64(0.275 - y)) t_1 = fmax(fmax(fmax(Float64(y - 0.55), Float64(-y)), Float64(x - 0.825)), Float64(0.725 - x)) t_2 = fmax(fmax(fmax(Float64(-y), Float64(y - 1.0)), Float64(x - 0.1)), Float64(-x)) t_3 = fmax(fmax(fmax(Float64(-y), Float64(y - 0.275)), Float64(x - 0.55)), Float64(0.45 - x)) t_4 = fmax(fmax(t_0, Float64(0.175 - sqrt(fma(Float64(x - 0.275), Float64(x - 0.275), Float64(Float64(y - 0.275) * Float64(y - 0.275)))))), y) tmp = 0.0 if (y <= -3.2e+25) tmp = fmin(fmin(fmin(fmin(t_1, Float64(-y)), t_3), t_2), t_4); elseif (y <= 5.4e+51) tmp = fmin(fmin(fmin(fmin(t_1, Float64(sqrt(fma(Float64(x - 0.775), Float64(x - 0.775), 0.49)) - 0.075)), t_3), t_2), fmax(fmax(t_0, x), y)); else tmp = fmin(fmin(fmin(fmin(t_1, y), t_3), t_2), t_4); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision], N[(0.275 - y), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], (-y)], $MachinePrecision], N[(x - 0.825), $MachinePrecision]], $MachinePrecision], N[(0.725 - x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Max[N[Max[(-y), N[(y - 1.0), $MachinePrecision]], $MachinePrecision], N[(x - 0.1), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[N[Max[(-y), N[(y - 0.275), $MachinePrecision]], $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], N[(0.45 - x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$4 = N[Max[N[Max[t$95$0, N[(0.175 - N[Sqrt[N[(N[(x - 0.275), $MachinePrecision] * N[(x - 0.275), $MachinePrecision] + N[(N[(y - 0.275), $MachinePrecision] * N[(y - 0.275), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y], $MachinePrecision]}, If[LessEqual[y, -3.2e+25], N[Min[N[Min[N[Min[N[Min[t$95$1, (-y)], $MachinePrecision], t$95$3], $MachinePrecision], t$95$2], $MachinePrecision], t$95$4], $MachinePrecision], If[LessEqual[y, 5.4e+51], N[Min[N[Min[N[Min[N[Min[t$95$1, N[(N[Sqrt[N[(N[(x - 0.775), $MachinePrecision] * N[(x - 0.775), $MachinePrecision] + 0.49), $MachinePrecision]], $MachinePrecision] - 0.075), $MachinePrecision]], $MachinePrecision], t$95$3], $MachinePrecision], t$95$2], $MachinePrecision], N[Max[N[Max[t$95$0, x], $MachinePrecision], y], $MachinePrecision]], $MachinePrecision], N[Min[N[Min[N[Min[N[Min[t$95$1, y], $MachinePrecision], t$95$3], $MachinePrecision], t$95$2], $MachinePrecision], t$95$4], $MachinePrecision]]]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, x - 0.55\right), -x\right), 0.275 - y\right)\\
t_1 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, -y\right), x - 0.825\right), 0.725 - x\right)\\
t_2 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 1\right), x - 0.1\right), -x\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 0.275\right), x - 0.55\right), 0.45 - x\right)\\
t_4 := \mathsf{max}\left(\mathsf{max}\left(t\_0, 0.175 - \sqrt{\mathsf{fma}\left(x - 0.275, x - 0.275, \left(y - 0.275\right) \cdot \left(y - 0.275\right)\right)}\right), y\right)\\
\mathbf{if}\;y \leq -3.2 \cdot 10^{+25}:\\
\;\;\;\;\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(t\_1, -y\right), t\_3\right), t\_2\right), t\_4\right)\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(t\_1, \sqrt{\mathsf{fma}\left(x - 0.775, x - 0.775, 0.49\right)} - 0.075\right), t\_3\right), t\_2\right), \mathsf{max}\left(\mathsf{max}\left(t\_0, x\right), y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(t\_1, y\right), t\_3\right), t\_2\right), t\_4\right)\\
\end{array}
\end{array}
if y < -3.1999999999999999e25Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in y around 0
pow2N/A
flip3--N/A
metadata-evalN/A
pow3N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
Applied rewrites32.2%
Taylor expanded in y around inf
Applied rewrites32.2%
Taylor expanded in y around -inf
Applied rewrites79.2%
if -3.1999999999999999e25 < y < 5.39999999999999983e51Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in y around 0
pow2N/A
flip3--N/A
metadata-evalN/A
pow3N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
Applied rewrites95.4%
Taylor expanded in y around inf
Applied rewrites95.4%
Taylor expanded in x around -inf
Applied rewrites95.4%
if 5.39999999999999983e51 < y Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in y around 0
pow2N/A
flip3--N/A
metadata-evalN/A
pow3N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
Applied rewrites30.6%
Taylor expanded in y around inf
Applied rewrites30.6%
Taylor expanded in y around inf
Applied rewrites81.7%
(FPCore (x y)
:precision binary64
(let* ((t_0 (fmax (fmax (fmax (- y) (- y 1.0)) (- x 0.1)) (- x)))
(t_1 (fmax (fmax (fmax (- y 0.55) (- y)) (- x 0.825)) (- 0.725 x)))
(t_2 (fmax (fmax (fmax (- y) (- y 0.275)) (- x 0.55)) (- 0.45 x)))
(t_3 (fmax (fmax (fmax (- y 0.55) (- x 0.55)) (- x)) (- 0.275 y))))
(if (<= y 5.4e+51)
(fmin
(fmin
(fmin
(fmin t_1 (- (sqrt (fma (- x 0.775) (- x 0.775) 0.49)) 0.075))
t_2)
t_0)
(fmax (fmax t_3 x) y))
(fmin
(fmin (fmin (fmin t_1 y) t_2) t_0)
(fmax
(fmax
t_3
(-
0.175
(sqrt (fma (- x 0.275) (- x 0.275) (* (- y 0.275) (- y 0.275))))))
y)))))
double code(double x, double y) {
double t_0 = fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x);
double t_1 = fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x));
double t_2 = fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x));
double t_3 = fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y));
double tmp;
if (y <= 5.4e+51) {
tmp = fmin(fmin(fmin(fmin(t_1, (sqrt(fma((x - 0.775), (x - 0.775), 0.49)) - 0.075)), t_2), t_0), fmax(fmax(t_3, x), y));
} else {
tmp = fmin(fmin(fmin(fmin(t_1, y), t_2), t_0), fmax(fmax(t_3, (0.175 - sqrt(fma((x - 0.275), (x - 0.275), ((y - 0.275) * (y - 0.275)))))), y));
}
return tmp;
}
function code(x, y) t_0 = fmax(fmax(fmax(Float64(-y), Float64(y - 1.0)), Float64(x - 0.1)), Float64(-x)) t_1 = fmax(fmax(fmax(Float64(y - 0.55), Float64(-y)), Float64(x - 0.825)), Float64(0.725 - x)) t_2 = fmax(fmax(fmax(Float64(-y), Float64(y - 0.275)), Float64(x - 0.55)), Float64(0.45 - x)) t_3 = fmax(fmax(fmax(Float64(y - 0.55), Float64(x - 0.55)), Float64(-x)), Float64(0.275 - y)) tmp = 0.0 if (y <= 5.4e+51) tmp = fmin(fmin(fmin(fmin(t_1, Float64(sqrt(fma(Float64(x - 0.775), Float64(x - 0.775), 0.49)) - 0.075)), t_2), t_0), fmax(fmax(t_3, x), y)); else tmp = fmin(fmin(fmin(fmin(t_1, y), t_2), t_0), fmax(fmax(t_3, Float64(0.175 - sqrt(fma(Float64(x - 0.275), Float64(x - 0.275), Float64(Float64(y - 0.275) * Float64(y - 0.275)))))), y)); end return tmp end
code[x_, y_] := Block[{t$95$0 = N[Max[N[Max[N[Max[(-y), N[(y - 1.0), $MachinePrecision]], $MachinePrecision], N[(x - 0.1), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision]}, Block[{t$95$1 = N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], (-y)], $MachinePrecision], N[(x - 0.825), $MachinePrecision]], $MachinePrecision], N[(0.725 - x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$2 = N[Max[N[Max[N[Max[(-y), N[(y - 0.275), $MachinePrecision]], $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], N[(0.45 - x), $MachinePrecision]], $MachinePrecision]}, Block[{t$95$3 = N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision], N[(0.275 - y), $MachinePrecision]], $MachinePrecision]}, If[LessEqual[y, 5.4e+51], N[Min[N[Min[N[Min[N[Min[t$95$1, N[(N[Sqrt[N[(N[(x - 0.775), $MachinePrecision] * N[(x - 0.775), $MachinePrecision] + 0.49), $MachinePrecision]], $MachinePrecision] - 0.075), $MachinePrecision]], $MachinePrecision], t$95$2], $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[Max[t$95$3, x], $MachinePrecision], y], $MachinePrecision]], $MachinePrecision], N[Min[N[Min[N[Min[N[Min[t$95$1, y], $MachinePrecision], t$95$2], $MachinePrecision], t$95$0], $MachinePrecision], N[Max[N[Max[t$95$3, N[(0.175 - N[Sqrt[N[(N[(x - 0.275), $MachinePrecision] * N[(x - 0.275), $MachinePrecision] + N[(N[(y - 0.275), $MachinePrecision] * N[(y - 0.275), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]], $MachinePrecision]), $MachinePrecision]], $MachinePrecision], y], $MachinePrecision]], $MachinePrecision]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 1\right), x - 0.1\right), -x\right)\\
t_1 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, -y\right), x - 0.825\right), 0.725 - x\right)\\
t_2 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 0.275\right), x - 0.55\right), 0.45 - x\right)\\
t_3 := \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, x - 0.55\right), -x\right), 0.275 - y\right)\\
\mathbf{if}\;y \leq 5.4 \cdot 10^{+51}:\\
\;\;\;\;\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(t\_1, \sqrt{\mathsf{fma}\left(x - 0.775, x - 0.775, 0.49\right)} - 0.075\right), t\_2\right), t\_0\right), \mathsf{max}\left(\mathsf{max}\left(t\_3, x\right), y\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(t\_1, y\right), t\_2\right), t\_0\right), \mathsf{max}\left(\mathsf{max}\left(t\_3, 0.175 - \sqrt{\mathsf{fma}\left(x - 0.275, x - 0.275, \left(y - 0.275\right) \cdot \left(y - 0.275\right)\right)}\right), y\right)\right)\\
\end{array}
\end{array}
if y < 5.39999999999999983e51Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in y around 0
pow2N/A
flip3--N/A
metadata-evalN/A
pow3N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
Applied rewrites77.3%
Taylor expanded in y around inf
Applied rewrites77.3%
Taylor expanded in x around -inf
Applied rewrites77.3%
if 5.39999999999999983e51 < y Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in y around 0
pow2N/A
flip3--N/A
metadata-evalN/A
pow3N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
Applied rewrites30.6%
Taylor expanded in y around inf
Applied rewrites30.6%
Taylor expanded in y around inf
Applied rewrites81.7%
(FPCore (x y)
:precision binary64
(fmin
(fmin
(fmin
(fmin
(fmax (fmax (fmax (- y 0.55) (- y)) (- x 0.825)) (- 0.725 x))
(- (sqrt (fma (- x 0.775) (- x 0.775) 0.49)) 0.075))
(fmax (fmax (fmax (- y) (- y 0.275)) (- x 0.55)) (- 0.45 x)))
(fmax (fmax (fmax (- y) (- y 1.0)) (- x 0.1)) (- x)))
(fmax
(fmax (fmax (fmax (fmax (- y 0.55) (- x 0.55)) (- x)) (- 0.275 y)) x)
y)))
double code(double x, double y) {
return fmin(fmin(fmin(fmin(fmax(fmax(fmax((y - 0.55), -y), (x - 0.825)), (0.725 - x)), (sqrt(fma((x - 0.775), (x - 0.775), 0.49)) - 0.075)), fmax(fmax(fmax(-y, (y - 0.275)), (x - 0.55)), (0.45 - x))), fmax(fmax(fmax(-y, (y - 1.0)), (x - 0.1)), -x)), fmax(fmax(fmax(fmax(fmax((y - 0.55), (x - 0.55)), -x), (0.275 - y)), x), y));
}
function code(x, y) return fmin(fmin(fmin(fmin(fmax(fmax(fmax(Float64(y - 0.55), Float64(-y)), Float64(x - 0.825)), Float64(0.725 - x)), Float64(sqrt(fma(Float64(x - 0.775), Float64(x - 0.775), 0.49)) - 0.075)), fmax(fmax(fmax(Float64(-y), Float64(y - 0.275)), Float64(x - 0.55)), Float64(0.45 - x))), fmax(fmax(fmax(Float64(-y), Float64(y - 1.0)), Float64(x - 0.1)), Float64(-x))), fmax(fmax(fmax(fmax(fmax(Float64(y - 0.55), Float64(x - 0.55)), Float64(-x)), Float64(0.275 - y)), x), y)) end
code[x_, y_] := N[Min[N[Min[N[Min[N[Min[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], (-y)], $MachinePrecision], N[(x - 0.825), $MachinePrecision]], $MachinePrecision], N[(0.725 - x), $MachinePrecision]], $MachinePrecision], N[(N[Sqrt[N[(N[(x - 0.775), $MachinePrecision] * N[(x - 0.775), $MachinePrecision] + 0.49), $MachinePrecision]], $MachinePrecision] - 0.075), $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 0.275), $MachinePrecision]], $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], N[(0.45 - x), $MachinePrecision]], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[(-y), N[(y - 1.0), $MachinePrecision]], $MachinePrecision], N[(x - 0.1), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision]], $MachinePrecision], N[Max[N[Max[N[Max[N[Max[N[Max[N[(y - 0.55), $MachinePrecision], N[(x - 0.55), $MachinePrecision]], $MachinePrecision], (-x)], $MachinePrecision], N[(0.275 - y), $MachinePrecision]], $MachinePrecision], x], $MachinePrecision], y], $MachinePrecision]], $MachinePrecision]
\begin{array}{l}
\\
\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{min}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, -y\right), x - 0.825\right), 0.725 - x\right), \sqrt{\mathsf{fma}\left(x - 0.775, x - 0.775, 0.49\right)} - 0.075\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 0.275\right), x - 0.55\right), 0.45 - x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(-y, y - 1\right), x - 0.1\right), -x\right)\right), \mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(\mathsf{max}\left(y - 0.55, x - 0.55\right), -x\right), 0.275 - y\right), x\right), y\right)\right)
\end{array}
Initial program 100.0%
Applied rewrites100.0%
Taylor expanded in y around 0
pow2N/A
flip3--N/A
metadata-evalN/A
pow3N/A
metadata-evalN/A
pow2N/A
+-commutativeN/A
+-commutativeN/A
pow2N/A
lower-fma.f64N/A
Applied rewrites67.7%
Taylor expanded in y around inf
Applied rewrites67.7%
Taylor expanded in x around -inf
Applied rewrites67.7%
herbie shell --seed 2025101
(FPCore (x y)
:name "The letters hi in the upper-right quadrant"
:precision binary64
(fmin (fmin (fmin (fmin (fmax (fmax (fmax (- y 0.55) (- y)) (- x 0.825)) (- 0.725 x)) (- (sqrt (+ (pow (- y 0.7) 2.0) (pow (- x 0.775) 2.0))) 0.075)) (fmax (fmax (fmax (- y) (- y 0.275)) (- x 0.55)) (- 0.45 x))) (fmax (fmax (fmax (- y) (- y 1.0)) (- x 0.1)) (- x))) (fmax (fmax (fmax (fmax (fmax (- y 0.55) (- x 0.55)) (- x)) (- 0.275 y)) (- 0.175 (sqrt (+ (pow (- y 0.275) 2.0) (pow (- x 0.275) 2.0))))) (- (sqrt (+ (pow (- y 0.275) 2.0) (pow (- x 0.275) 2.0))) 0.275))))