
(FPCore (x y) :precision binary64 (+ (- (* 9.0 (pow x 4.0)) (pow y 4.0)) (* 2.0 (* y y))))
double code(double x, double y) {
return ((9.0 * pow(x, 4.0)) - pow(y, 4.0)) + (2.0 * (y * y));
}
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
code = ((9.0d0 * (x ** 4.0d0)) - (y ** 4.0d0)) + (2.0d0 * (y * y))
end function
public static double code(double x, double y) {
return ((9.0 * Math.pow(x, 4.0)) - Math.pow(y, 4.0)) + (2.0 * (y * y));
}
def code(x, y): return ((9.0 * math.pow(x, 4.0)) - math.pow(y, 4.0)) + (2.0 * (y * y))
function code(x, y) return Float64(Float64(Float64(9.0 * (x ^ 4.0)) - (y ^ 4.0)) + Float64(2.0 * Float64(y * y))) end
function tmp = code(x, y) tmp = ((9.0 * (x ^ 4.0)) - (y ^ 4.0)) + (2.0 * (y * y)); end
code[x_, y_] := N[(N[(N[(9.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right)
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y) :precision binary64 (+ (- (* 9.0 (pow x 4.0)) (pow y 4.0)) (* 2.0 (* y y))))
double code(double x, double y) {
return ((9.0 * pow(x, 4.0)) - pow(y, 4.0)) + (2.0 * (y * y));
}
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
code = ((9.0d0 * (x ** 4.0d0)) - (y ** 4.0d0)) + (2.0d0 * (y * y))
end function
public static double code(double x, double y) {
return ((9.0 * Math.pow(x, 4.0)) - Math.pow(y, 4.0)) + (2.0 * (y * y));
}
def code(x, y): return ((9.0 * math.pow(x, 4.0)) - math.pow(y, 4.0)) + (2.0 * (y * y))
function code(x, y) return Float64(Float64(Float64(9.0 * (x ^ 4.0)) - (y ^ 4.0)) + Float64(2.0 * Float64(y * y))) end
function tmp = code(x, y) tmp = ((9.0 * (x ^ 4.0)) - (y ^ 4.0)) + (2.0 * (y * y)); end
code[x_, y_] := N[(N[(N[(9.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(9 \cdot {x}^{4} - {y}^{4}\right) + 2 \cdot \left(y \cdot y\right)
\end{array}
(FPCore (x y)
:precision binary64
(let* ((t_0 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
(t_1 (* (log y) 2.0))
(t_2 (- (* (pow x 4.0) 9.0) (pow y 4.0)))
(t_3 (* (pow x 8.0) 81.0)))
(/
(- (pow t_2 3.0) (pow (* -2.0 (+ (cosh t_1) (sinh t_1))) 3.0))
(+
(/
(+ (pow t_3 3.0) (pow t_0 3.0))
(+ (pow t_3 2.0) (- (pow t_0 2.0) (* t_3 t_0))))
(+ (* (pow y 4.0) 4.0) (* t_2 (* -2.0 (* y y))))))))
double code(double x, double y) {
double t_0 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
double t_1 = log(y) * 2.0;
double t_2 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
double t_3 = pow(x, 8.0) * 81.0;
return (pow(t_2, 3.0) - pow((-2.0 * (cosh(t_1) + sinh(t_1))), 3.0)) / (((pow(t_3, 3.0) + pow(t_0, 3.0)) / (pow(t_3, 2.0) + (pow(t_0, 2.0) - (t_3 * t_0)))) + ((pow(y, 4.0) * 4.0) + (t_2 * (-2.0 * (y * y)))));
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
t_0 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
t_1 = log(y) * 2.0d0
t_2 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
t_3 = (x ** 8.0d0) * 81.0d0
code = ((t_2 ** 3.0d0) - (((-2.0d0) * (cosh(t_1) + sinh(t_1))) ** 3.0d0)) / ((((t_3 ** 3.0d0) + (t_0 ** 3.0d0)) / ((t_3 ** 2.0d0) + ((t_0 ** 2.0d0) - (t_3 * t_0)))) + (((y ** 4.0d0) * 4.0d0) + (t_2 * ((-2.0d0) * (y * y)))))
end function
public static double code(double x, double y) {
double t_0 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
double t_1 = Math.log(y) * 2.0;
double t_2 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
double t_3 = Math.pow(x, 8.0) * 81.0;
return (Math.pow(t_2, 3.0) - Math.pow((-2.0 * (Math.cosh(t_1) + Math.sinh(t_1))), 3.0)) / (((Math.pow(t_3, 3.0) + Math.pow(t_0, 3.0)) / (Math.pow(t_3, 2.0) + (Math.pow(t_0, 2.0) - (t_3 * t_0)))) + ((Math.pow(y, 4.0) * 4.0) + (t_2 * (-2.0 * (y * y)))));
}
def code(x, y): t_0 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0) t_1 = math.log(y) * 2.0 t_2 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0) t_3 = math.pow(x, 8.0) * 81.0 return (math.pow(t_2, 3.0) - math.pow((-2.0 * (math.cosh(t_1) + math.sinh(t_1))), 3.0)) / (((math.pow(t_3, 3.0) + math.pow(t_0, 3.0)) / (math.pow(t_3, 2.0) + (math.pow(t_0, 2.0) - (t_3 * t_0)))) + ((math.pow(y, 4.0) * 4.0) + (t_2 * (-2.0 * (y * y)))))
function code(x, y) t_0 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) t_1 = Float64(log(y) * 2.0) t_2 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) t_3 = Float64((x ^ 8.0) * 81.0) return Float64(Float64((t_2 ^ 3.0) - (Float64(-2.0 * Float64(cosh(t_1) + sinh(t_1))) ^ 3.0)) / Float64(Float64(Float64((t_3 ^ 3.0) + (t_0 ^ 3.0)) / Float64((t_3 ^ 2.0) + Float64((t_0 ^ 2.0) - Float64(t_3 * t_0)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_2 * Float64(-2.0 * Float64(y * y)))))) end
function tmp = code(x, y) t_0 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0); t_1 = log(y) * 2.0; t_2 = ((x ^ 4.0) * 9.0) - (y ^ 4.0); t_3 = (x ^ 8.0) * 81.0; tmp = ((t_2 ^ 3.0) - ((-2.0 * (cosh(t_1) + sinh(t_1))) ^ 3.0)) / ((((t_3 ^ 3.0) + (t_0 ^ 3.0)) / ((t_3 ^ 2.0) + ((t_0 ^ 2.0) - (t_3 * t_0)))) + (((y ^ 4.0) * 4.0) + (t_2 * (-2.0 * (y * y))))); end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Log[y], $MachinePrecision] * 2.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, N[(N[(N[Power[t$95$2, 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[(N[Cosh[t$95$1], $MachinePrecision] + N[Sinh[t$95$1], $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$3, 3.0], $MachinePrecision] + N[Power[t$95$0, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$3, 2.0], $MachinePrecision] + N[(N[Power[t$95$0, 2.0], $MachinePrecision] - N[(t$95$3 * t$95$0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$2 * N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
t_1 := \log y \cdot 2\\
t_2 := {x}^{4} \cdot 9 - {y}^{4}\\
t_3 := {x}^{8} \cdot 81\\
\frac{{t\_2}^{3} - {\left(-2 \cdot \left(\cosh t\_1 + \sinh t\_1\right)\right)}^{3}}{\frac{{t\_3}^{3} + {t\_0}^{3}}{{t\_3}^{2} + \left({t\_0}^{2} - t\_3 \cdot t\_0\right)} + \left({y}^{4} \cdot 4 + t\_2 \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}
\end{array}
\end{array}
Initial program 18.8%
Applied rewrites18.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6422.6
Applied rewrites22.6%
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip3-+N/A
lower-/.f64N/A
Applied rewrites30.9%
lift-*.f64N/A
pow2N/A
pow-to-expN/A
sinh-+-cosh-revN/A
lower-+.f64N/A
lower-cosh.f64N/A
lift-log.f64N/A
lift-*.f64N/A
lower-sinh.f64N/A
lift-log.f64N/A
lift-*.f6430.9
Applied rewrites30.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (* (pow x 4.0) 9.0) (pow y 4.0)))
(t_1 (* (pow x 8.0) 81.0))
(t_2 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0))))
(/
(- (pow t_0 3.0) (pow (* -2.0 (exp (* (log y) 2.0))) 3.0))
(+
(/
(+ (pow t_1 3.0) (pow t_2 3.0))
(+ (pow t_1 2.0) (- (pow t_2 2.0) (* t_1 t_2))))
(+ (* (pow y 4.0) 4.0) (* t_0 (* -2.0 (* y y))))))))
double code(double x, double y) {
double t_0 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
double t_1 = pow(x, 8.0) * 81.0;
double t_2 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
return (pow(t_0, 3.0) - pow((-2.0 * exp((log(y) * 2.0))), 3.0)) / (((pow(t_1, 3.0) + pow(t_2, 3.0)) / (pow(t_1, 2.0) + (pow(t_2, 2.0) - (t_1 * t_2)))) + ((pow(y, 4.0) * 4.0) + (t_0 * (-2.0 * (y * y)))));
}
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
real(8) :: t_1
real(8) :: t_2
t_0 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
t_1 = (x ** 8.0d0) * 81.0d0
t_2 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
code = ((t_0 ** 3.0d0) - (((-2.0d0) * exp((log(y) * 2.0d0))) ** 3.0d0)) / ((((t_1 ** 3.0d0) + (t_2 ** 3.0d0)) / ((t_1 ** 2.0d0) + ((t_2 ** 2.0d0) - (t_1 * t_2)))) + (((y ** 4.0d0) * 4.0d0) + (t_0 * ((-2.0d0) * (y * y)))))
end function
public static double code(double x, double y) {
double t_0 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
double t_1 = Math.pow(x, 8.0) * 81.0;
double t_2 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
return (Math.pow(t_0, 3.0) - Math.pow((-2.0 * Math.exp((Math.log(y) * 2.0))), 3.0)) / (((Math.pow(t_1, 3.0) + Math.pow(t_2, 3.0)) / (Math.pow(t_1, 2.0) + (Math.pow(t_2, 2.0) - (t_1 * t_2)))) + ((Math.pow(y, 4.0) * 4.0) + (t_0 * (-2.0 * (y * y)))));
}
def code(x, y): t_0 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0) t_1 = math.pow(x, 8.0) * 81.0 t_2 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0) return (math.pow(t_0, 3.0) - math.pow((-2.0 * math.exp((math.log(y) * 2.0))), 3.0)) / (((math.pow(t_1, 3.0) + math.pow(t_2, 3.0)) / (math.pow(t_1, 2.0) + (math.pow(t_2, 2.0) - (t_1 * t_2)))) + ((math.pow(y, 4.0) * 4.0) + (t_0 * (-2.0 * (y * y)))))
function code(x, y) t_0 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) t_1 = Float64((x ^ 8.0) * 81.0) t_2 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) return Float64(Float64((t_0 ^ 3.0) - (Float64(-2.0 * exp(Float64(log(y) * 2.0))) ^ 3.0)) / Float64(Float64(Float64((t_1 ^ 3.0) + (t_2 ^ 3.0)) / Float64((t_1 ^ 2.0) + Float64((t_2 ^ 2.0) - Float64(t_1 * t_2)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_0 * Float64(-2.0 * Float64(y * y)))))) end
function tmp = code(x, y) t_0 = ((x ^ 4.0) * 9.0) - (y ^ 4.0); t_1 = (x ^ 8.0) * 81.0; t_2 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0); tmp = ((t_0 ^ 3.0) - ((-2.0 * exp((log(y) * 2.0))) ^ 3.0)) / ((((t_1 ^ 3.0) + (t_2 ^ 3.0)) / ((t_1 ^ 2.0) + ((t_2 ^ 2.0) - (t_1 * t_2)))) + (((y ^ 4.0) * 4.0) + (t_0 * (-2.0 * (y * y))))); end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[Exp[N[(N[Log[y], $MachinePrecision] * 2.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$1, 3.0], $MachinePrecision] + N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$1, 2.0], $MachinePrecision] + N[(N[Power[t$95$2, 2.0], $MachinePrecision] - N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$0 * N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} \cdot 9 - {y}^{4}\\
t_1 := {x}^{8} \cdot 81\\
t_2 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
\frac{{t\_0}^{3} - {\left(-2 \cdot e^{\log y \cdot 2}\right)}^{3}}{\frac{{t\_1}^{3} + {t\_2}^{3}}{{t\_1}^{2} + \left({t\_2}^{2} - t\_1 \cdot t\_2\right)} + \left({y}^{4} \cdot 4 + t\_0 \cdot \left(-2 \cdot \left(y \cdot y\right)\right)\right)}
\end{array}
\end{array}
Initial program 18.8%
Applied rewrites18.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6422.6
Applied rewrites22.6%
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip3-+N/A
lower-/.f64N/A
Applied rewrites30.9%
lift-*.f64N/A
pow2N/A
pow-to-expN/A
lift-log.f64N/A
lift-*.f64N/A
lift-exp.f6430.9
Applied rewrites30.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (* (pow x 8.0) 81.0))
(t_1 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
(t_2 (* -2.0 (* y y))))
(/
(- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 3.0) (pow t_2 3.0))
(+
(/
(+ (pow t_0 3.0) (pow t_1 3.0))
(+ (pow t_0 2.0) (- (pow t_1 2.0) (* t_0 t_1))))
(+
(* (pow y 4.0) 4.0)
(* (- (* (exp (* (log x) 4.0)) 9.0) (pow y 4.0)) t_2))))))
double code(double x, double y) {
double t_0 = pow(x, 8.0) * 81.0;
double t_1 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
double t_2 = -2.0 * (y * y);
return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 3.0) - pow(t_2, 3.0)) / (((pow(t_0, 3.0) + pow(t_1, 3.0)) / (pow(t_0, 2.0) + (pow(t_1, 2.0) - (t_0 * t_1)))) + ((pow(y, 4.0) * 4.0) + (((exp((log(x) * 4.0)) * 9.0) - pow(y, 4.0)) * t_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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8) :: t_0
real(8) :: t_1
real(8) :: t_2
t_0 = (x ** 8.0d0) * 81.0d0
t_1 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
t_2 = (-2.0d0) * (y * y)
code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 3.0d0) - (t_2 ** 3.0d0)) / ((((t_0 ** 3.0d0) + (t_1 ** 3.0d0)) / ((t_0 ** 2.0d0) + ((t_1 ** 2.0d0) - (t_0 * t_1)))) + (((y ** 4.0d0) * 4.0d0) + (((exp((log(x) * 4.0d0)) * 9.0d0) - (y ** 4.0d0)) * t_2)))
end function
public static double code(double x, double y) {
double t_0 = Math.pow(x, 8.0) * 81.0;
double t_1 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
double t_2 = -2.0 * (y * y);
return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 3.0) - Math.pow(t_2, 3.0)) / (((Math.pow(t_0, 3.0) + Math.pow(t_1, 3.0)) / (Math.pow(t_0, 2.0) + (Math.pow(t_1, 2.0) - (t_0 * t_1)))) + ((Math.pow(y, 4.0) * 4.0) + (((Math.exp((Math.log(x) * 4.0)) * 9.0) - Math.pow(y, 4.0)) * t_2)));
}
def code(x, y): t_0 = math.pow(x, 8.0) * 81.0 t_1 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0) t_2 = -2.0 * (y * y) return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 3.0) - math.pow(t_2, 3.0)) / (((math.pow(t_0, 3.0) + math.pow(t_1, 3.0)) / (math.pow(t_0, 2.0) + (math.pow(t_1, 2.0) - (t_0 * t_1)))) + ((math.pow(y, 4.0) * 4.0) + (((math.exp((math.log(x) * 4.0)) * 9.0) - math.pow(y, 4.0)) * t_2)))
function code(x, y) t_0 = Float64((x ^ 8.0) * 81.0) t_1 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) t_2 = Float64(-2.0 * Float64(y * y)) return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (t_2 ^ 3.0)) / Float64(Float64(Float64((t_0 ^ 3.0) + (t_1 ^ 3.0)) / Float64((t_0 ^ 2.0) + Float64((t_1 ^ 2.0) - Float64(t_0 * t_1)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(Float64(Float64(exp(Float64(log(x) * 4.0)) * 9.0) - (y ^ 4.0)) * t_2)))) end
function tmp = code(x, y) t_0 = (x ^ 8.0) * 81.0; t_1 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0); t_2 = -2.0 * (y * y); tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (t_2 ^ 3.0)) / ((((t_0 ^ 3.0) + (t_1 ^ 3.0)) / ((t_0 ^ 2.0) + ((t_1 ^ 2.0) - (t_0 * t_1)))) + (((y ^ 4.0) * 4.0) + (((exp((log(x) * 4.0)) * 9.0) - (y ^ 4.0)) * t_2))); end
code[x_, y_] := Block[{t$95$0 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, Block[{t$95$1 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] + N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$0, 2.0], $MachinePrecision] + N[(N[Power[t$95$1, 2.0], $MachinePrecision] - N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(N[(N[(N[Exp[N[(N[Log[x], $MachinePrecision] * 4.0), $MachinePrecision]], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{8} \cdot 81\\
t_1 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
t_2 := -2 \cdot \left(y \cdot y\right)\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {t\_2}^{3}}{\frac{{t\_0}^{3} + {t\_1}^{3}}{{t\_0}^{2} + \left({t\_1}^{2} - t\_0 \cdot t\_1\right)} + \left({y}^{4} \cdot 4 + \left(e^{\log x \cdot 4} \cdot 9 - {y}^{4}\right) \cdot t\_2\right)}
\end{array}
\end{array}
Initial program 18.8%
Applied rewrites18.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6422.6
Applied rewrites22.6%
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip3-+N/A
lower-/.f64N/A
Applied rewrites30.9%
lift-pow.f64N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6430.9
Applied rewrites30.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (* (pow x 4.0) 9.0) (pow y 4.0)))
(t_1 (* (pow x 8.0) 81.0))
(t_2 (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)))
(t_3 (* -2.0 (* y y))))
(/
(- (pow t_0 3.0) (pow t_3 3.0))
(+
(/
(+ (pow t_1 3.0) (pow t_2 3.0))
(+ (pow t_1 2.0) (- (pow y 16.0) (* t_1 t_2))))
(+ (* (pow y 4.0) 4.0) (* t_0 t_3))))))
double code(double x, double y) {
double t_0 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
double t_1 = pow(x, 8.0) * 81.0;
double t_2 = (pow((y * x), 4.0) * -18.0) + pow(y, 8.0);
double t_3 = -2.0 * (y * y);
return (pow(t_0, 3.0) - pow(t_3, 3.0)) / (((pow(t_1, 3.0) + pow(t_2, 3.0)) / (pow(t_1, 2.0) + (pow(y, 16.0) - (t_1 * t_2)))) + ((pow(y, 4.0) * 4.0) + (t_0 * t_3)));
}
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
real(8) :: t_1
real(8) :: t_2
real(8) :: t_3
t_0 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
t_1 = (x ** 8.0d0) * 81.0d0
t_2 = (((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)
t_3 = (-2.0d0) * (y * y)
code = ((t_0 ** 3.0d0) - (t_3 ** 3.0d0)) / ((((t_1 ** 3.0d0) + (t_2 ** 3.0d0)) / ((t_1 ** 2.0d0) + ((y ** 16.0d0) - (t_1 * t_2)))) + (((y ** 4.0d0) * 4.0d0) + (t_0 * t_3)))
end function
public static double code(double x, double y) {
double t_0 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
double t_1 = Math.pow(x, 8.0) * 81.0;
double t_2 = (Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0);
double t_3 = -2.0 * (y * y);
return (Math.pow(t_0, 3.0) - Math.pow(t_3, 3.0)) / (((Math.pow(t_1, 3.0) + Math.pow(t_2, 3.0)) / (Math.pow(t_1, 2.0) + (Math.pow(y, 16.0) - (t_1 * t_2)))) + ((Math.pow(y, 4.0) * 4.0) + (t_0 * t_3)));
}
def code(x, y): t_0 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0) t_1 = math.pow(x, 8.0) * 81.0 t_2 = (math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0) t_3 = -2.0 * (y * y) return (math.pow(t_0, 3.0) - math.pow(t_3, 3.0)) / (((math.pow(t_1, 3.0) + math.pow(t_2, 3.0)) / (math.pow(t_1, 2.0) + (math.pow(y, 16.0) - (t_1 * t_2)))) + ((math.pow(y, 4.0) * 4.0) + (t_0 * t_3)))
function code(x, y) t_0 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) t_1 = Float64((x ^ 8.0) * 81.0) t_2 = Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) t_3 = Float64(-2.0 * Float64(y * y)) return Float64(Float64((t_0 ^ 3.0) - (t_3 ^ 3.0)) / Float64(Float64(Float64((t_1 ^ 3.0) + (t_2 ^ 3.0)) / Float64((t_1 ^ 2.0) + Float64((y ^ 16.0) - Float64(t_1 * t_2)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_0 * t_3)))) end
function tmp = code(x, y) t_0 = ((x ^ 4.0) * 9.0) - (y ^ 4.0); t_1 = (x ^ 8.0) * 81.0; t_2 = (((y * x) ^ 4.0) * -18.0) + (y ^ 8.0); t_3 = -2.0 * (y * y); tmp = ((t_0 ^ 3.0) - (t_3 ^ 3.0)) / ((((t_1 ^ 3.0) + (t_2 ^ 3.0)) / ((t_1 ^ 2.0) + ((y ^ 16.0) - (t_1 * t_2)))) + (((y ^ 4.0) * 4.0) + (t_0 * t_3))); end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision]}, Block[{t$95$2 = N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] - N[Power[t$95$3, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[t$95$1, 3.0], $MachinePrecision] + N[Power[t$95$2, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[Power[t$95$1, 2.0], $MachinePrecision] + N[(N[Power[y, 16.0], $MachinePrecision] - N[(t$95$1 * t$95$2), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$0 * t$95$3), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} \cdot 9 - {y}^{4}\\
t_1 := {x}^{8} \cdot 81\\
t_2 := {\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\\
t_3 := -2 \cdot \left(y \cdot y\right)\\
\frac{{t\_0}^{3} - {t\_3}^{3}}{\frac{{t\_1}^{3} + {t\_2}^{3}}{{t\_1}^{2} + \left({y}^{16} - t\_1 \cdot t\_2\right)} + \left({y}^{4} \cdot 4 + t\_0 \cdot t\_3\right)}
\end{array}
\end{array}
Initial program 18.8%
Applied rewrites18.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6422.6
Applied rewrites22.6%
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip3-+N/A
lower-/.f64N/A
Applied rewrites30.9%
Taylor expanded in x around 0
lower-pow.f6430.9
Applied rewrites30.9%
(FPCore (x y)
:precision binary64
(let* ((t_0 (- (* (pow x 4.0) 9.0) (pow y 4.0))) (t_1 (* -2.0 (* y y))))
(/
(- (pow t_0 3.0) (pow t_1 3.0))
(+
(/
(+
(pow (* (pow x 8.0) 81.0) 3.0)
(pow (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0)) 3.0))
(- (* (* 1458.0 (pow x 12.0)) (pow y 4.0)) (* -6561.0 (pow x 16.0))))
(+ (* (pow y 4.0) 4.0) (* t_0 t_1))))))
double code(double x, double y) {
double t_0 = (pow(x, 4.0) * 9.0) - pow(y, 4.0);
double t_1 = -2.0 * (y * y);
return (pow(t_0, 3.0) - pow(t_1, 3.0)) / (((pow((pow(x, 8.0) * 81.0), 3.0) + pow(((pow((y * x), 4.0) * -18.0) + pow(y, 8.0)), 3.0)) / (((1458.0 * pow(x, 12.0)) * pow(y, 4.0)) - (-6561.0 * pow(x, 16.0)))) + ((pow(y, 4.0) * 4.0) + (t_0 * t_1)));
}
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
real(8) :: t_1
t_0 = ((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)
t_1 = (-2.0d0) * (y * y)
code = ((t_0 ** 3.0d0) - (t_1 ** 3.0d0)) / ((((((x ** 8.0d0) * 81.0d0) ** 3.0d0) + (((((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0)) ** 3.0d0)) / (((1458.0d0 * (x ** 12.0d0)) * (y ** 4.0d0)) - ((-6561.0d0) * (x ** 16.0d0)))) + (((y ** 4.0d0) * 4.0d0) + (t_0 * t_1)))
end function
public static double code(double x, double y) {
double t_0 = (Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0);
double t_1 = -2.0 * (y * y);
return (Math.pow(t_0, 3.0) - Math.pow(t_1, 3.0)) / (((Math.pow((Math.pow(x, 8.0) * 81.0), 3.0) + Math.pow(((Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0)), 3.0)) / (((1458.0 * Math.pow(x, 12.0)) * Math.pow(y, 4.0)) - (-6561.0 * Math.pow(x, 16.0)))) + ((Math.pow(y, 4.0) * 4.0) + (t_0 * t_1)));
}
def code(x, y): t_0 = (math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0) t_1 = -2.0 * (y * y) return (math.pow(t_0, 3.0) - math.pow(t_1, 3.0)) / (((math.pow((math.pow(x, 8.0) * 81.0), 3.0) + math.pow(((math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0)), 3.0)) / (((1458.0 * math.pow(x, 12.0)) * math.pow(y, 4.0)) - (-6561.0 * math.pow(x, 16.0)))) + ((math.pow(y, 4.0) * 4.0) + (t_0 * t_1)))
function code(x, y) t_0 = Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) t_1 = Float64(-2.0 * Float64(y * y)) return Float64(Float64((t_0 ^ 3.0) - (t_1 ^ 3.0)) / Float64(Float64(Float64((Float64((x ^ 8.0) * 81.0) ^ 3.0) + (Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) ^ 3.0)) / Float64(Float64(Float64(1458.0 * (x ^ 12.0)) * (y ^ 4.0)) - Float64(-6561.0 * (x ^ 16.0)))) + Float64(Float64((y ^ 4.0) * 4.0) + Float64(t_0 * t_1)))) end
function tmp = code(x, y) t_0 = ((x ^ 4.0) * 9.0) - (y ^ 4.0); t_1 = -2.0 * (y * y); tmp = ((t_0 ^ 3.0) - (t_1 ^ 3.0)) / ((((((x ^ 8.0) * 81.0) ^ 3.0) + (((((y * x) ^ 4.0) * -18.0) + (y ^ 8.0)) ^ 3.0)) / (((1458.0 * (x ^ 12.0)) * (y ^ 4.0)) - (-6561.0 * (x ^ 16.0)))) + (((y ^ 4.0) * 4.0) + (t_0 * t_1))); end
code[x_, y_] := Block[{t$95$0 = N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision]}, Block[{t$95$1 = N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]}, N[(N[(N[Power[t$95$0, 3.0], $MachinePrecision] - N[Power[t$95$1, 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision], 3.0], $MachinePrecision] + N[Power[N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(1458.0 * N[Power[x, 12.0], $MachinePrecision]), $MachinePrecision] * N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] - N[(-6561.0 * N[Power[x, 16.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision] + N[(t$95$0 * t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_0 := {x}^{4} \cdot 9 - {y}^{4}\\
t_1 := -2 \cdot \left(y \cdot y\right)\\
\frac{{t\_0}^{3} - {t\_1}^{3}}{\frac{{\left({x}^{8} \cdot 81\right)}^{3} + {\left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)}^{3}}{\left(1458 \cdot {x}^{12}\right) \cdot {y}^{4} - -6561 \cdot {x}^{16}} + \left({y}^{4} \cdot 4 + t\_0 \cdot t\_1\right)}
\end{array}
\end{array}
Initial program 18.8%
Applied rewrites18.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6422.6
Applied rewrites22.6%
lift-+.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip3-+N/A
lower-/.f64N/A
Applied rewrites30.9%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
lower--.f64N/A
associate-*r*N/A
metadata-evalN/A
lower-*.f64N/A
metadata-evalN/A
lower-*.f64N/A
lower-pow.f64N/A
lift-pow.f64N/A
lower-*.f64N/A
metadata-evalN/A
lower-pow.f6430.9
Applied rewrites30.9%
(FPCore (x y) :precision binary64 (/ (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 3.0) (pow (* -2.0 (* y y)) 3.0)) (+ (+ (* (pow x 8.0) 81.0) (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0))) (* (+ (/ (* -18.0 (pow x 4.0)) (pow y 4.0)) 2.0) (pow y 6.0)))))
double code(double x, double y) {
return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 3.0) - pow((-2.0 * (y * y)), 3.0)) / (((pow(x, 8.0) * 81.0) + ((pow((y * x), 4.0) * -18.0) + pow(y, 8.0))) + ((((-18.0 * pow(x, 4.0)) / pow(y, 4.0)) + 2.0) * pow(y, 6.0)));
}
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
code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 3.0d0) - (((-2.0d0) * (y * y)) ** 3.0d0)) / ((((x ** 8.0d0) * 81.0d0) + ((((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0))) + (((((-18.0d0) * (x ** 4.0d0)) / (y ** 4.0d0)) + 2.0d0) * (y ** 6.0d0)))
end function
public static double code(double x, double y) {
return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 3.0) - Math.pow((-2.0 * (y * y)), 3.0)) / (((Math.pow(x, 8.0) * 81.0) + ((Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0))) + ((((-18.0 * Math.pow(x, 4.0)) / Math.pow(y, 4.0)) + 2.0) * Math.pow(y, 6.0)));
}
def code(x, y): return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 3.0) - math.pow((-2.0 * (y * y)), 3.0)) / (((math.pow(x, 8.0) * 81.0) + ((math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0))) + ((((-18.0 * math.pow(x, 4.0)) / math.pow(y, 4.0)) + 2.0) * math.pow(y, 6.0)))
function code(x, y) return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (Float64(-2.0 * Float64(y * y)) ^ 3.0)) / Float64(Float64(Float64((x ^ 8.0) * 81.0) + Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + Float64(Float64(Float64(Float64(-18.0 * (x ^ 4.0)) / (y ^ 4.0)) + 2.0) * (y ^ 6.0)))) end
function tmp = code(x, y) tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - ((-2.0 * (y * y)) ^ 3.0)) / ((((x ^ 8.0) * 81.0) + ((((y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + ((((-18.0 * (x ^ 4.0)) / (y ^ 4.0)) + 2.0) * (y ^ 6.0))); end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision] + N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(-18.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision] / N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision] + 2.0), $MachinePrecision] * N[Power[y, 6.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\frac{-18 \cdot {x}^{4}}{{y}^{4}} + 2\right) \cdot {y}^{6}}
\end{array}
Initial program 18.8%
Applied rewrites18.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6422.6
Applied rewrites22.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
Applied rewrites22.6%
Taylor expanded in x around inf
associate-*r/N/A
lift-pow.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-/.f6424.7
Applied rewrites24.7%
(FPCore (x y) :precision binary64 (/ (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 3.0) (pow (* -2.0 (* y y)) 3.0)) (+ (+ (* (pow x 8.0) 81.0) (+ (* (pow (* y x) 4.0) -18.0) (pow y 8.0))) (* (+ (* (+ (* (* y y) 2.0) 4.0) (* y y)) (* -18.0 (pow x 4.0))) (* y y)))))
double code(double x, double y) {
return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 3.0) - pow((-2.0 * (y * y)), 3.0)) / (((pow(x, 8.0) * 81.0) + ((pow((y * x), 4.0) * -18.0) + pow(y, 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * pow(x, 4.0))) * (y * y)));
}
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
code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 3.0d0) - (((-2.0d0) * (y * y)) ** 3.0d0)) / ((((x ** 8.0d0) * 81.0d0) + ((((y * x) ** 4.0d0) * (-18.0d0)) + (y ** 8.0d0))) + ((((((y * y) * 2.0d0) + 4.0d0) * (y * y)) + ((-18.0d0) * (x ** 4.0d0))) * (y * y)))
end function
public static double code(double x, double y) {
return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 3.0) - Math.pow((-2.0 * (y * y)), 3.0)) / (((Math.pow(x, 8.0) * 81.0) + ((Math.pow((y * x), 4.0) * -18.0) + Math.pow(y, 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * Math.pow(x, 4.0))) * (y * y)));
}
def code(x, y): return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 3.0) - math.pow((-2.0 * (y * y)), 3.0)) / (((math.pow(x, 8.0) * 81.0) + ((math.pow((y * x), 4.0) * -18.0) + math.pow(y, 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * math.pow(x, 4.0))) * (y * y)))
function code(x, y) return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - (Float64(-2.0 * Float64(y * y)) ^ 3.0)) / Float64(Float64(Float64((x ^ 8.0) * 81.0) + Float64(Float64((Float64(y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + Float64(Float64(Float64(Float64(Float64(Float64(y * y) * 2.0) + 4.0) * Float64(y * y)) + Float64(-18.0 * (x ^ 4.0))) * Float64(y * y)))) end
function tmp = code(x, y) tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 3.0) - ((-2.0 * (y * y)) ^ 3.0)) / ((((x ^ 8.0) * 81.0) + ((((y * x) ^ 4.0) * -18.0) + (y ^ 8.0))) + ((((((y * y) * 2.0) + 4.0) * (y * y)) + (-18.0 * (x ^ 4.0))) * (y * y))); end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision] - N[Power[N[(-2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision], 3.0], $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[Power[x, 8.0], $MachinePrecision] * 81.0), $MachinePrecision] + N[(N[(N[Power[N[(y * x), $MachinePrecision], 4.0], $MachinePrecision] * -18.0), $MachinePrecision] + N[Power[y, 8.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(N[(N[(N[(N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision] + 4.0), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(-18.0 * N[Power[x, 4.0], $MachinePrecision]), $MachinePrecision]), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{3} - {\left(-2 \cdot \left(y \cdot y\right)\right)}^{3}}{\left({x}^{8} \cdot 81 + \left({\left(y \cdot x\right)}^{4} \cdot -18 + {y}^{8}\right)\right) + \left(\left(\left(y \cdot y\right) \cdot 2 + 4\right) \cdot \left(y \cdot y\right) + -18 \cdot {x}^{4}\right) \cdot \left(y \cdot y\right)}
\end{array}
Initial program 18.8%
Applied rewrites18.8%
Taylor expanded in y around 0
distribute-rgt-inN/A
associate-*r*N/A
pow-prod-upN/A
metadata-evalN/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
lower-pow.f64N/A
lower-+.f64N/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
pow-prod-downN/A
lower-pow.f64N/A
lower-*.f64N/A
lower-pow.f6422.6
Applied rewrites22.6%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
Applied rewrites22.6%
(FPCore (x y) :precision binary64 (/ (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 2.0) (* (pow y 4.0) 4.0)) (- (- (* (* (* (* x x) x) x) 9.0) (pow (exp (log y)) 4.0)) (* (* y y) 2.0))))
double code(double x, double y) {
return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 2.0) - (pow(y, 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - pow(exp(log(y)), 4.0)) - ((y * y) * 2.0));
}
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
code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 2.0d0) - ((y ** 4.0d0) * 4.0d0)) / ((((((x * x) * x) * x) * 9.0d0) - (exp(log(y)) ** 4.0d0)) - ((y * y) * 2.0d0))
end function
public static double code(double x, double y) {
return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 2.0) - (Math.pow(y, 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - Math.pow(Math.exp(Math.log(y)), 4.0)) - ((y * y) * 2.0));
}
def code(x, y): return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 2.0) - (math.pow(y, 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - math.pow(math.exp(math.log(y)), 4.0)) - ((y * y) * 2.0))
function code(x, y) return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - Float64((y ^ 4.0) * 4.0)) / Float64(Float64(Float64(Float64(Float64(Float64(x * x) * x) * x) * 9.0) - (exp(log(y)) ^ 4.0)) - Float64(Float64(y * y) * 2.0))) end
function tmp = code(x, y) tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - ((y ^ 4.0) * 4.0)) / ((((((x * x) * x) * x) * 9.0) - (exp(log(y)) ^ 4.0)) - ((y * y) * 2.0)); end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(N[(x * x), $MachinePrecision] * x), $MachinePrecision] * x), $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[N[Exp[N[Log[y], $MachinePrecision]], $MachinePrecision], 4.0], $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(\left(x \cdot x\right) \cdot x\right) \cdot x\right) \cdot 9 - {\left(e^{\log y}\right)}^{4}\right) - \left(y \cdot y\right) \cdot 2}
\end{array}
Initial program 18.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip-+N/A
lower-/.f64N/A
Applied rewrites18.8%
lift-pow.f64N/A
pow-to-expN/A
exp-prodN/A
lower-pow.f64N/A
lower-exp.f64N/A
lower-log.f6418.8
Applied rewrites18.8%
lift-pow.f64N/A
sqr-powN/A
metadata-evalN/A
pow2N/A
lift-*.f64N/A
metadata-evalN/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6418.8
Applied rewrites18.8%
(FPCore (x y) :precision binary64 (/ (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 2.0) (* (pow y 4.0) 4.0)) (- (- (* (* (* x x) (* x x)) 9.0) (exp (* (log y) 4.0))) (* (* y y) 2.0))))
double code(double x, double y) {
return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 2.0) - (pow(y, 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - exp((log(y) * 4.0))) - ((y * y) * 2.0));
}
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
code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 2.0d0) - ((y ** 4.0d0) * 4.0d0)) / (((((x * x) * (x * x)) * 9.0d0) - exp((log(y) * 4.0d0))) - ((y * y) * 2.0d0))
end function
public static double code(double x, double y) {
return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 2.0) - (Math.pow(y, 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - Math.exp((Math.log(y) * 4.0))) - ((y * y) * 2.0));
}
def code(x, y): return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 2.0) - (math.pow(y, 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - math.exp((math.log(y) * 4.0))) - ((y * y) * 2.0))
function code(x, y) return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - Float64((y ^ 4.0) * 4.0)) / Float64(Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * 9.0) - exp(Float64(log(y) * 4.0))) - Float64(Float64(y * y) * 2.0))) end
function tmp = code(x, y) tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - ((y ^ 4.0) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - exp((log(y) * 4.0))) - ((y * y) * 2.0)); end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - N[(N[Power[y, 4.0], $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] - N[Exp[N[(N[Log[y], $MachinePrecision] * 4.0), $MachinePrecision]], $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - {y}^{4} \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - e^{\log y \cdot 4}\right) - \left(y \cdot y\right) \cdot 2}
\end{array}
Initial program 18.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip-+N/A
lower-/.f64N/A
Applied rewrites18.8%
lift-pow.f64N/A
pow-to-expN/A
lower-exp.f64N/A
lower-*.f64N/A
lower-log.f6418.8
Applied rewrites18.8%
lift-pow.f64N/A
metadata-evalN/A
pow-unpowN/A
pow2N/A
lift-*.f64N/A
pow2N/A
lower-*.f6418.8
Applied rewrites18.8%
(FPCore (x y) :precision binary64 (/ (- (pow (- (* (pow x 4.0) 9.0) (pow y 4.0)) 2.0) (* (* (* (* y y) y) y) 4.0)) (- (- (* (* (* x x) (* x x)) 9.0) (* (* y y) (* y y))) (* (* y y) 2.0))))
double code(double x, double y) {
return (pow(((pow(x, 4.0) * 9.0) - pow(y, 4.0)), 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0));
}
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
code = (((((x ** 4.0d0) * 9.0d0) - (y ** 4.0d0)) ** 2.0d0) - ((((y * y) * y) * y) * 4.0d0)) / (((((x * x) * (x * x)) * 9.0d0) - ((y * y) * (y * y))) - ((y * y) * 2.0d0))
end function
public static double code(double x, double y) {
return (Math.pow(((Math.pow(x, 4.0) * 9.0) - Math.pow(y, 4.0)), 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0));
}
def code(x, y): return (math.pow(((math.pow(x, 4.0) * 9.0) - math.pow(y, 4.0)), 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0))
function code(x, y) return Float64(Float64((Float64(Float64((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - Float64(Float64(Float64(Float64(y * y) * y) * y) * 4.0)) / Float64(Float64(Float64(Float64(Float64(x * x) * Float64(x * x)) * 9.0) - Float64(Float64(y * y) * Float64(y * y))) - Float64(Float64(y * y) * 2.0))) end
function tmp = code(x, y) tmp = (((((x ^ 4.0) * 9.0) - (y ^ 4.0)) ^ 2.0) - ((((y * y) * y) * y) * 4.0)) / (((((x * x) * (x * x)) * 9.0) - ((y * y) * (y * y))) - ((y * y) * 2.0)); end
code[x_, y_] := N[(N[(N[Power[N[(N[(N[Power[x, 4.0], $MachinePrecision] * 9.0), $MachinePrecision] - N[Power[y, 4.0], $MachinePrecision]), $MachinePrecision], 2.0], $MachinePrecision] - N[(N[(N[(N[(y * y), $MachinePrecision] * y), $MachinePrecision] * y), $MachinePrecision] * 4.0), $MachinePrecision]), $MachinePrecision] / N[(N[(N[(N[(N[(x * x), $MachinePrecision] * N[(x * x), $MachinePrecision]), $MachinePrecision] * 9.0), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * 2.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{{\left({x}^{4} \cdot 9 - {y}^{4}\right)}^{2} - \left(\left(\left(y \cdot y\right) \cdot y\right) \cdot y\right) \cdot 4}{\left(\left(\left(x \cdot x\right) \cdot \left(x \cdot x\right)\right) \cdot 9 - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) - \left(y \cdot y\right) \cdot 2}
\end{array}
Initial program 18.8%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-pow.f64N/A
lift-pow.f64N/A
flip-+N/A
lower-/.f64N/A
Applied rewrites18.8%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6418.8
Applied rewrites18.8%
lift-pow.f64N/A
metadata-evalN/A
pow-unpowN/A
pow2N/A
lift-*.f64N/A
pow2N/A
lower-*.f6418.8
Applied rewrites18.8%
lift-pow.f64N/A
sqr-powN/A
metadata-evalN/A
metadata-evalN/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
pow2N/A
lift-*.f6418.8
Applied rewrites18.8%
(FPCore (x y) :precision binary64 (+ (- (* (* x x) (* (* x x) 9.0)) (* (* y y) (* y y))) (* 2.0 (* y y))))
double code(double x, double y) {
return (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y));
}
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
code = (((x * x) * ((x * x) * 9.0d0)) - ((y * y) * (y * y))) + (2.0d0 * (y * y))
end function
public static double code(double x, double y) {
return (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y));
}
def code(x, y): return (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y))
function code(x, y) return Float64(Float64(Float64(Float64(x * x) * Float64(Float64(x * x) * 9.0)) - Float64(Float64(y * y) * Float64(y * y))) + Float64(2.0 * Float64(y * y))) end
function tmp = code(x, y) tmp = (((x * x) * ((x * x) * 9.0)) - ((y * y) * (y * y))) + (2.0 * (y * y)); end
code[x_, y_] := N[(N[(N[(N[(x * x), $MachinePrecision] * N[(N[(x * x), $MachinePrecision] * 9.0), $MachinePrecision]), $MachinePrecision] - N[(N[(y * y), $MachinePrecision] * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(2.0 * N[(y * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(\left(x \cdot x\right) \cdot \left(\left(x \cdot x\right) \cdot 9\right) - \left(y \cdot y\right) \cdot \left(y \cdot y\right)\right) + 2 \cdot \left(y \cdot y\right)
\end{array}
Initial program 18.8%
lift-*.f64N/A
lift-pow.f64N/A
*-commutativeN/A
sqr-powN/A
associate-*l*N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f64N/A
lower-*.f64N/A
metadata-evalN/A
unpow2N/A
lower-*.f6418.8
Applied rewrites18.8%
lift-pow.f64N/A
metadata-evalN/A
pow-prod-upN/A
lower-*.f64N/A
pow2N/A
lift-*.f64N/A
pow2N/A
lift-*.f6418.8
Applied rewrites18.8%
(FPCore (x y) :precision binary64 (* (* 2.0 y) y))
double code(double x, double y) {
return (2.0 * y) * y;
}
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
code = (2.0d0 * y) * y
end function
public static double code(double x, double y) {
return (2.0 * y) * y;
}
def code(x, y): return (2.0 * y) * y
function code(x, y) return Float64(Float64(2.0 * y) * y) end
function tmp = code(x, y) tmp = (2.0 * y) * y; end
code[x_, y_] := N[(N[(2.0 * y), $MachinePrecision] * y), $MachinePrecision]
\begin{array}{l}
\\
\left(2 \cdot y\right) \cdot y
\end{array}
Initial program 18.8%
Taylor expanded in x around 0
metadata-evalN/A
pow-prod-upN/A
cancel-sign-sub-invN/A
mul-1-negN/A
distribute-rgt-inN/A
*-commutativeN/A
pow2N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f64N/A
cancel-sign-subN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
pow2N/A
lift-*.f641.5
Applied rewrites1.5%
Taylor expanded in y around 0
Applied rewrites11.1%
herbie shell --seed 2025065
(FPCore (x y)
:name "From Rump in a 1983 paper"
:precision binary64
:pre (and (== x 10864.0) (== y 18817.0))
(+ (- (* 9.0 (pow x 4.0)) (pow y 4.0)) (* 2.0 (* y y))))