
(FPCore (x y z t) :precision binary64 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * x) / (y * y)) + ((z * z) / (t * t))
end function
public static double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
def code(x, y, z, t): return ((x * x) / (y * y)) + ((z * z) / (t * t))
function code(x, y, z, t) return Float64(Float64(Float64(x * x) / Float64(y * y)) + Float64(Float64(z * z) / Float64(t * t))) end
function tmp = code(x, y, z, t) tmp = ((x * x) / (y * y)) + ((z * z) / (t * t)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 15 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))
double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * x) / (y * y)) + ((z * z) / (t * t))
end function
public static double code(double x, double y, double z, double t) {
return ((x * x) / (y * y)) + ((z * z) / (t * t));
}
def code(x, y, z, t): return ((x * x) / (y * y)) + ((z * z) / (t * t))
function code(x, y, z, t) return Float64(Float64(Float64(x * x) / Float64(y * y)) + Float64(Float64(z * z) / Float64(t * t))) end
function tmp = code(x, y, z, t) tmp = ((x * x) / (y * y)) + ((z * z) / (t * t)); end
code[x_, y_, z_, t_] := N[(N[(N[(x * x), $MachinePrecision] / N[(y * y), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x \cdot x}{y \cdot y} + \frac{z \cdot z}{t \cdot t}
\end{array}
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (if (<= y_m 7.6e-250) (+ (/ (* (/ x y_m) x) y_m) (/ (* (/ z t) z) t)) (fma (/ (/ x y_m) y_m) x (pow (/ z t) 2.0))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double tmp;
if (y_m <= 7.6e-250) {
tmp = (((x / y_m) * x) / y_m) + (((z / t) * z) / t);
} else {
tmp = fma(((x / y_m) / y_m), x, pow((z / t), 2.0));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z, t) tmp = 0.0 if (y_m <= 7.6e-250) tmp = Float64(Float64(Float64(Float64(x / y_m) * x) / y_m) + Float64(Float64(Float64(z / t) * z) / t)); else tmp = fma(Float64(Float64(x / y_m) / y_m), x, (Float64(z / t) ^ 2.0)); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := If[LessEqual[y$95$m, 7.6e-250], N[(N[(N[(N[(x / y$95$m), $MachinePrecision] * x), $MachinePrecision] / y$95$m), $MachinePrecision] + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;y\_m \leq 7.6 \cdot 10^{-250}:\\
\;\;\;\;\frac{\frac{x}{y\_m} \cdot x}{y\_m} + \frac{\frac{z}{t} \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, {\left(\frac{z}{t}\right)}^{2}\right)\\
\end{array}
\end{array}
if y < 7.59999999999999942e-250Initial program 63.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lower-*.f64N/A
lift-/.f6492.9
Applied rewrites92.9%
if 7.59999999999999942e-250 < y Initial program 60.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (if (<= z 2e+266) (fma (/ (/ x y_m) y_m) x (/ (* (/ z t) z) t)) (pow (/ z t) 2.0)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double tmp;
if (z <= 2e+266) {
tmp = fma(((x / y_m) / y_m), x, (((z / t) * z) / t));
} else {
tmp = pow((z / t), 2.0);
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z, t) tmp = 0.0 if (z <= 2e+266) tmp = fma(Float64(Float64(x / y_m) / y_m), x, Float64(Float64(Float64(z / t) * z) / t)); else tmp = Float64(z / t) ^ 2.0; end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := If[LessEqual[z, 2e+266], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;z \leq 2 \cdot 10^{+266}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;{\left(\frac{z}{t}\right)}^{2}\\
\end{array}
\end{array}
if z < 2.0000000000000001e266Initial program 61.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6497.3
Applied rewrites97.3%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6495.0
Applied rewrites95.0%
if 2.0000000000000001e266 < z Initial program 62.5%
Taylor expanded in x around 0
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
:precision binary64
(let* ((t_1 (/ (* x x) (* y_m y_m))))
(if (<= t_1 4e-141)
(+ t_1 (* (/ z t) (/ z t)))
(if (<= t_1 INFINITY)
(fma (/ x (* y_m y_m)) x (/ (* (/ z t) z) t))
(+ (* (/ x y_m) (/ x y_m)) (/ (* z z) (* t t)))))))y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double t_1 = (x * x) / (y_m * y_m);
double tmp;
if (t_1 <= 4e-141) {
tmp = t_1 + ((z / t) * (z / t));
} else if (t_1 <= ((double) INFINITY)) {
tmp = fma((x / (y_m * y_m)), x, (((z / t) * z) / t));
} else {
tmp = ((x / y_m) * (x / y_m)) + ((z * z) / (t * t));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z, t) t_1 = Float64(Float64(x * x) / Float64(y_m * y_m)) tmp = 0.0 if (t_1 <= 4e-141) tmp = Float64(t_1 + Float64(Float64(z / t) * Float64(z / t))); elseif (t_1 <= Inf) tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) * z) / t)); else tmp = Float64(Float64(Float64(x / y_m) * Float64(x / y_m)) + Float64(Float64(z * z) / Float64(t * t))); end return tmp end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 4e-141], N[(t$95$1 + N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, Infinity], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{y\_m \cdot y\_m}\\
\mathbf{if}\;t\_1 \leq 4 \cdot 10^{-141}:\\
\;\;\;\;t\_1 + \frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{elif}\;t\_1 \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{y\_m} + \frac{z \cdot z}{t \cdot t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 4.0000000000000002e-141Initial program 63.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6494.5
Applied rewrites94.5%
if 4.0000000000000002e-141 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0Initial program 78.2%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6498.4
Applied rewrites98.4%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6498.4
Applied rewrites98.4%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
lift-*.f6498.4
Applied rewrites98.4%
if +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
:precision binary64
(let* ((t_1 (/ (* z z) (* t t))))
(if (<= t_1 5e-185)
(/ (* (* (/ x y_m) x) t) (* t y_m))
(if (<= t_1 1e+252)
(+ (/ (* x x) (* y_m y_m)) t_1)
(/ (* (* (/ z t) y_m) z) (* t y_m))))))y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= 5e-185) {
tmp = (((x / y_m) * x) * t) / (t * y_m);
} else if (t_1 <= 1e+252) {
tmp = ((x * x) / (y_m * y_m)) + t_1;
} else {
tmp = (((z / t) * y_m) * z) / (t * y_m);
}
return tmp;
}
y_m = private
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_m, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (z * z) / (t * t)
if (t_1 <= 5d-185) then
tmp = (((x / y_m) * x) * t) / (t * y_m)
else if (t_1 <= 1d+252) then
tmp = ((x * x) / (y_m * y_m)) + t_1
else
tmp = (((z / t) * y_m) * z) / (t * y_m)
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if (t_1 <= 5e-185) {
tmp = (((x / y_m) * x) * t) / (t * y_m);
} else if (t_1 <= 1e+252) {
tmp = ((x * x) / (y_m * y_m)) + t_1;
} else {
tmp = (((z / t) * y_m) * z) / (t * y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z, t): t_1 = (z * z) / (t * t) tmp = 0 if t_1 <= 5e-185: tmp = (((x / y_m) * x) * t) / (t * y_m) elif t_1 <= 1e+252: tmp = ((x * x) / (y_m * y_m)) + t_1 else: tmp = (((z / t) * y_m) * z) / (t * y_m) return tmp
y_m = abs(y) function code(x, y_m, z, t) t_1 = Float64(Float64(z * z) / Float64(t * t)) tmp = 0.0 if (t_1 <= 5e-185) tmp = Float64(Float64(Float64(Float64(x / y_m) * x) * t) / Float64(t * y_m)); elseif (t_1 <= 1e+252) tmp = Float64(Float64(Float64(x * x) / Float64(y_m * y_m)) + t_1); else tmp = Float64(Float64(Float64(Float64(z / t) * y_m) * z) / Float64(t * y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z, t) t_1 = (z * z) / (t * t); tmp = 0.0; if (t_1 <= 5e-185) tmp = (((x / y_m) * x) * t) / (t * y_m); elseif (t_1 <= 1e+252) tmp = ((x * x) / (y_m * y_m)) + t_1; else tmp = (((z / t) * y_m) * z) / (t * y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-185], N[(N[(N[(N[(x / y$95$m), $MachinePrecision] * x), $MachinePrecision] * t), $MachinePrecision] / N[(t * y$95$m), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+252], N[(N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(N[(z / t), $MachinePrecision] * y$95$m), $MachinePrecision] * z), $MachinePrecision] / N[(t * y$95$m), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-185}:\\
\;\;\;\;\frac{\left(\frac{x}{y\_m} \cdot x\right) \cdot t}{t \cdot y\_m}\\
\mathbf{elif}\;t\_1 \leq 10^{+252}:\\
\;\;\;\;\frac{x \cdot x}{y\_m \cdot y\_m} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{z}{t} \cdot y\_m\right) \cdot z}{t \cdot y\_m}\\
\end{array}
\end{array}
if (/.f64 (*.f64 z z) (*.f64 t t)) < 5.0000000000000003e-185Initial program 70.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6496.2
Applied rewrites96.2%
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-addN/A
lift-/.f64N/A
associate-*l/N/A
pow2N/A
lower-/.f64N/A
Applied rewrites78.1%
Taylor expanded in x around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f6476.0
Applied rewrites76.0%
if 5.0000000000000003e-185 < (/.f64 (*.f64 z z) (*.f64 t t)) < 1.0000000000000001e252Initial program 74.1%
if 1.0000000000000001e252 < (/.f64 (*.f64 z z) (*.f64 t t)) Initial program 51.7%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6499.0
Applied rewrites99.0%
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-addN/A
lift-/.f64N/A
associate-*l/N/A
pow2N/A
lower-/.f64N/A
Applied rewrites79.5%
Taylor expanded in x around 0
associate-/l*N/A
pow2N/A
associate-*l/N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6471.7
Applied rewrites71.7%
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
:precision binary64
(let* ((t_1 (/ (* z z) (* t t))))
(if (<= (+ (/ (* x x) (* y_m y_m)) t_1) INFINITY)
(+ (* x (/ x (* y_m y_m))) t_1)
(/ (* (* (/ z t) y_m) z) (* t y_m)))))y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if ((((x * x) / (y_m * y_m)) + t_1) <= ((double) INFINITY)) {
tmp = (x * (x / (y_m * y_m))) + t_1;
} else {
tmp = (((z / t) * y_m) * z) / (t * y_m);
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
double t_1 = (z * z) / (t * t);
double tmp;
if ((((x * x) / (y_m * y_m)) + t_1) <= Double.POSITIVE_INFINITY) {
tmp = (x * (x / (y_m * y_m))) + t_1;
} else {
tmp = (((z / t) * y_m) * z) / (t * y_m);
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z, t): t_1 = (z * z) / (t * t) tmp = 0 if (((x * x) / (y_m * y_m)) + t_1) <= math.inf: tmp = (x * (x / (y_m * y_m))) + t_1 else: tmp = (((z / t) * y_m) * z) / (t * y_m) return tmp
y_m = abs(y) function code(x, y_m, z, t) t_1 = Float64(Float64(z * z) / Float64(t * t)) tmp = 0.0 if (Float64(Float64(Float64(x * x) / Float64(y_m * y_m)) + t_1) <= Inf) tmp = Float64(Float64(x * Float64(x / Float64(y_m * y_m))) + t_1); else tmp = Float64(Float64(Float64(Float64(z / t) * y_m) * z) / Float64(t * y_m)); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z, t) t_1 = (z * z) / (t * t); tmp = 0.0; if ((((x * x) / (y_m * y_m)) + t_1) <= Inf) tmp = (x * (x / (y_m * y_m))) + t_1; else tmp = (((z / t) * y_m) * z) / (t * y_m); end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[N[(N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], Infinity], N[(N[(x * N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(N[(z / t), $MachinePrecision] * y$95$m), $MachinePrecision] * z), $MachinePrecision] / N[(t * y$95$m), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_1 := \frac{z \cdot z}{t \cdot t}\\
\mathbf{if}\;\frac{x \cdot x}{y\_m \cdot y\_m} + t\_1 \leq \infty:\\
\;\;\;\;x \cdot \frac{x}{y\_m \cdot y\_m} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(\frac{z}{t} \cdot y\_m\right) \cdot z}{t \cdot y\_m}\\
\end{array}
\end{array}
if (+.f64 (/.f64 (*.f64 x x) (*.f64 y y)) (/.f64 (*.f64 z z) (*.f64 t t))) < +inf.0Initial program 84.1%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
sqr-neg-revN/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
pow2N/A
lift-*.f6488.6
Applied rewrites88.6%
if +inf.0 < (+.f64 (/.f64 (*.f64 x x) (*.f64 y y)) (/.f64 (*.f64 z z) (*.f64 t t))) Initial program 0.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6493.7
Applied rewrites93.7%
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-addN/A
lift-/.f64N/A
associate-*l/N/A
pow2N/A
lower-/.f64N/A
Applied rewrites54.2%
Taylor expanded in x around 0
associate-/l*N/A
pow2N/A
associate-*l/N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6438.4
Applied rewrites38.4%
Final simplification75.3%
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
:precision binary64
(let* ((t_1 (/ (* x x) (* y_m y_m))))
(if (or (<= t_1 5e-124) (not (<= t_1 INFINITY)))
(/ (* (* (/ z t) y_m) z) (* t y_m))
t_1)))y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double t_1 = (x * x) / (y_m * y_m);
double tmp;
if ((t_1 <= 5e-124) || !(t_1 <= ((double) INFINITY))) {
tmp = (((z / t) * y_m) * z) / (t * y_m);
} else {
tmp = t_1;
}
return tmp;
}
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
double t_1 = (x * x) / (y_m * y_m);
double tmp;
if ((t_1 <= 5e-124) || !(t_1 <= Double.POSITIVE_INFINITY)) {
tmp = (((z / t) * y_m) * z) / (t * y_m);
} else {
tmp = t_1;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z, t): t_1 = (x * x) / (y_m * y_m) tmp = 0 if (t_1 <= 5e-124) or not (t_1 <= math.inf): tmp = (((z / t) * y_m) * z) / (t * y_m) else: tmp = t_1 return tmp
y_m = abs(y) function code(x, y_m, z, t) t_1 = Float64(Float64(x * x) / Float64(y_m * y_m)) tmp = 0.0 if ((t_1 <= 5e-124) || !(t_1 <= Inf)) tmp = Float64(Float64(Float64(Float64(z / t) * y_m) * z) / Float64(t * y_m)); else tmp = t_1; end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z, t) t_1 = (x * x) / (y_m * y_m); tmp = 0.0; if ((t_1 <= 5e-124) || ~((t_1 <= Inf))) tmp = (((z / t) * y_m) * z) / (t * y_m); else tmp = t_1; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, 5e-124], N[Not[LessEqual[t$95$1, Infinity]], $MachinePrecision]], N[(N[(N[(N[(z / t), $MachinePrecision] * y$95$m), $MachinePrecision] * z), $MachinePrecision] / N[(t * y$95$m), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{y\_m \cdot y\_m}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-124} \lor \neg \left(t\_1 \leq \infty\right):\\
\;\;\;\;\frac{\left(\frac{z}{t} \cdot y\_m\right) \cdot z}{t \cdot y\_m}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 5.0000000000000003e-124 or +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 45.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6496.6
Applied rewrites96.6%
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-addN/A
lift-/.f64N/A
associate-*l/N/A
pow2N/A
lower-/.f64N/A
Applied rewrites69.5%
Taylor expanded in x around 0
associate-/l*N/A
pow2N/A
associate-*l/N/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6464.3
Applied rewrites64.3%
if 5.0000000000000003e-124 < (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0Initial program 78.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6498.3
Applied rewrites98.3%
Taylor expanded in y around 0
Applied rewrites92.6%
Taylor expanded in x around inf
pow2N/A
lift-*.f6480.2
Applied rewrites80.2%
Final simplification72.2%
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
:precision binary64
(let* ((t_1 (/ (* x x) (* y_m y_m))))
(if (<= t_1 5e+228)
(+ t_1 (* (/ z t) (/ z t)))
(fma (/ (/ x y_m) y_m) x (* z (/ z (* t t)))))))y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double t_1 = (x * x) / (y_m * y_m);
double tmp;
if (t_1 <= 5e+228) {
tmp = t_1 + ((z / t) * (z / t));
} else {
tmp = fma(((x / y_m) / y_m), x, (z * (z / (t * t))));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z, t) t_1 = Float64(Float64(x * x) / Float64(y_m * y_m)) tmp = 0.0 if (t_1 <= 5e+228) tmp = Float64(t_1 + Float64(Float64(z / t) * Float64(z / t))); else tmp = fma(Float64(Float64(x / y_m) / y_m), x, Float64(z * Float64(z / Float64(t * t)))); end return tmp end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e+228], N[(t$95$1 + N[(N[(z / t), $MachinePrecision] * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[(z * N[(z / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_1 := \frac{x \cdot x}{y\_m \cdot y\_m}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{+228}:\\
\;\;\;\;t\_1 + \frac{z}{t} \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, z \cdot \frac{z}{t \cdot t}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < 5e228Initial program 66.6%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6496.1
Applied rewrites96.1%
if 5e228 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 56.6%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6495.1
Applied rewrites95.1%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
sqr-neg-revN/A
pow2N/A
associate-/l*N/A
lower-*.f64N/A
lower-neg.f64N/A
lower-/.f64N/A
lower-neg.f64N/A
pow2N/A
lift-*.f6492.1
Applied rewrites92.1%
Final simplification94.2%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (if (<= (/ (* x x) (* y_m y_m)) INFINITY) (fma (/ x (* y_m y_m)) x (/ (* (/ z t) z) t)) (+ (* (/ x y_m) (/ x y_m)) (/ (* z z) (* t t)))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double tmp;
if (((x * x) / (y_m * y_m)) <= ((double) INFINITY)) {
tmp = fma((x / (y_m * y_m)), x, (((z / t) * z) / t));
} else {
tmp = ((x / y_m) * (x / y_m)) + ((z * z) / (t * t));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z, t) tmp = 0.0 if (Float64(Float64(x * x) / Float64(y_m * y_m)) <= Inf) tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) * z) / t)); else tmp = Float64(Float64(Float64(x / y_m) * Float64(x / y_m)) + Float64(Float64(z * z) / Float64(t * t))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := If[LessEqual[N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] * N[(x / y$95$m), $MachinePrecision]), $MachinePrecision] + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot x}{y\_m \cdot y\_m} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x}{y\_m} \cdot \frac{x}{y\_m} + \frac{z \cdot z}{t \cdot t}\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0Initial program 72.2%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6498.9
Applied rewrites98.9%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6495.1
Applied rewrites95.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
lift-*.f6494.3
Applied rewrites94.3%
if +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 0.0%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
lower-*.f64N/A
lower-/.f64N/A
lower-/.f6481.4
Applied rewrites81.4%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (if (<= (/ (* x x) (* y_m y_m)) INFINITY) (fma (/ x (* y_m y_m)) x (/ (* (/ z t) z) t)) (fma (/ (/ x y_m) y_m) x (/ (* z z) (* t t)))))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double tmp;
if (((x * x) / (y_m * y_m)) <= ((double) INFINITY)) {
tmp = fma((x / (y_m * y_m)), x, (((z / t) * z) / t));
} else {
tmp = fma(((x / y_m) / y_m), x, ((z * z) / (t * t)));
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z, t) tmp = 0.0 if (Float64(Float64(x * x) / Float64(y_m * y_m)) <= Inf) tmp = fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) * z) / t)); else tmp = fma(Float64(Float64(x / y_m) / y_m), x, Float64(Float64(z * z) / Float64(t * t))); end return tmp end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := If[LessEqual[N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision], Infinity], N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[(N[(z * z), $MachinePrecision] / N[(t * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;\frac{x \cdot x}{y\_m \cdot y\_m} \leq \infty:\\
\;\;\;\;\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, \frac{z \cdot z}{t \cdot t}\right)\\
\end{array}
\end{array}
if (/.f64 (*.f64 x x) (*.f64 y y)) < +inf.0Initial program 72.2%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6498.9
Applied rewrites98.9%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6495.1
Applied rewrites95.1%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
lift-*.f6494.3
Applied rewrites94.3%
if +inf.0 < (/.f64 (*.f64 x x) (*.f64 y y)) Initial program 0.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6488.9
Applied rewrites88.9%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
lift-/.f64N/A
frac-timesN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f6473.3
Applied rewrites73.3%
y_m = (fabs.f64 y)
(FPCore (x y_m z t)
:precision binary64
(let* ((t_1 (/ (* (/ z t) z) t)))
(if (<= y_m 7.5e-250)
(+ (/ (* (/ x y_m) x) y_m) t_1)
(fma (/ (/ x y_m) y_m) x t_1))))y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double t_1 = ((z / t) * z) / t;
double tmp;
if (y_m <= 7.5e-250) {
tmp = (((x / y_m) * x) / y_m) + t_1;
} else {
tmp = fma(((x / y_m) / y_m), x, t_1);
}
return tmp;
}
y_m = abs(y) function code(x, y_m, z, t) t_1 = Float64(Float64(Float64(z / t) * z) / t) tmp = 0.0 if (y_m <= 7.5e-250) tmp = Float64(Float64(Float64(Float64(x / y_m) * x) / y_m) + t_1); else tmp = fma(Float64(Float64(x / y_m) / y_m), x, t_1); end return tmp end
y_m = N[Abs[y], $MachinePrecision]
code[x_, y$95$m_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]}, If[LessEqual[y$95$m, 7.5e-250], N[(N[(N[(N[(x / y$95$m), $MachinePrecision] * x), $MachinePrecision] / y$95$m), $MachinePrecision] + t$95$1), $MachinePrecision], N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
t_1 := \frac{\frac{z}{t} \cdot z}{t}\\
\mathbf{if}\;y\_m \leq 7.5 \cdot 10^{-250}:\\
\;\;\;\;\frac{\frac{x}{y\_m} \cdot x}{y\_m} + t\_1\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, t\_1\right)\\
\end{array}
\end{array}
if y < 7.50000000000000009e-250Initial program 63.7%
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
times-fracN/A
associate-*r/N/A
lower-/.f64N/A
lower-*.f64N/A
lower-/.f6475.1
Applied rewrites75.1%
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lower-*.f64N/A
lift-/.f6492.9
Applied rewrites92.9%
if 7.50000000000000009e-250 < y Initial program 60.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6496.2
Applied rewrites96.2%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (fma (/ (/ x y_m) y_m) x (/ (* (/ z t) z) t)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
return fma(((x / y_m) / y_m), x, (((z / t) * z) / t));
}
y_m = abs(y) function code(x, y_m, z, t) return fma(Float64(Float64(x / y_m) / y_m), x, Float64(Float64(Float64(z / t) * z) / t)) end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := N[(N[(N[(x / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\mathsf{fma}\left(\frac{\frac{x}{y\_m}}{y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)
\end{array}
Initial program 61.8%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6494.2
Applied rewrites94.2%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (fma (/ x (* y_m y_m)) x (/ (* (/ z t) z) t)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
return fma((x / (y_m * y_m)), x, (((z / t) * z) / t));
}
y_m = abs(y) function code(x, y_m, z, t) return fma(Float64(x / Float64(y_m * y_m)), x, Float64(Float64(Float64(z / t) * z) / t)) end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := N[(N[(x / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision] * x + N[(N[(N[(z / t), $MachinePrecision] * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\mathsf{fma}\left(\frac{x}{y\_m \cdot y\_m}, x, \frac{\frac{z}{t} \cdot z}{t}\right)
\end{array}
Initial program 61.8%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
lift-pow.f64N/A
pow2N/A
lift-/.f64N/A
associate-*l/N/A
lift-/.f64N/A
associate-*r/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lower-*.f6494.2
Applied rewrites94.2%
lift-/.f64N/A
lift-/.f64N/A
associate-/l/N/A
pow2N/A
lower-/.f64N/A
pow2N/A
lift-*.f6486.5
Applied rewrites86.5%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (if (<= x 3.35e-9) (/ (* (* (/ x y_m) x) t) (* t y_m)) (/ (/ (* x x) y_m) y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
double tmp;
if (x <= 3.35e-9) {
tmp = (((x / y_m) * x) * t) / (t * y_m);
} else {
tmp = ((x * x) / y_m) / y_m;
}
return tmp;
}
y_m = private
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_m, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= 3.35d-9) then
tmp = (((x / y_m) * x) * t) / (t * y_m)
else
tmp = ((x * x) / y_m) / y_m
end if
code = tmp
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
double tmp;
if (x <= 3.35e-9) {
tmp = (((x / y_m) * x) * t) / (t * y_m);
} else {
tmp = ((x * x) / y_m) / y_m;
}
return tmp;
}
y_m = math.fabs(y) def code(x, y_m, z, t): tmp = 0 if x <= 3.35e-9: tmp = (((x / y_m) * x) * t) / (t * y_m) else: tmp = ((x * x) / y_m) / y_m return tmp
y_m = abs(y) function code(x, y_m, z, t) tmp = 0.0 if (x <= 3.35e-9) tmp = Float64(Float64(Float64(Float64(x / y_m) * x) * t) / Float64(t * y_m)); else tmp = Float64(Float64(Float64(x * x) / y_m) / y_m); end return tmp end
y_m = abs(y); function tmp_2 = code(x, y_m, z, t) tmp = 0.0; if (x <= 3.35e-9) tmp = (((x / y_m) * x) * t) / (t * y_m); else tmp = ((x * x) / y_m) / y_m; end tmp_2 = tmp; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := If[LessEqual[x, 3.35e-9], N[(N[(N[(N[(x / y$95$m), $MachinePrecision] * x), $MachinePrecision] * t), $MachinePrecision] / N[(t * y$95$m), $MachinePrecision]), $MachinePrecision], N[(N[(N[(x * x), $MachinePrecision] / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision]]
\begin{array}{l}
y_m = \left|y\right|
\\
\begin{array}{l}
\mathbf{if}\;x \leq 3.35 \cdot 10^{-9}:\\
\;\;\;\;\frac{\left(\frac{x}{y\_m} \cdot x\right) \cdot t}{t \cdot y\_m}\\
\mathbf{else}:\\
\;\;\;\;\frac{\frac{x \cdot x}{y\_m}}{y\_m}\\
\end{array}
\end{array}
if x < 3.34999999999999981e-9Initial program 62.0%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6496.7
Applied rewrites96.7%
lift-fma.f64N/A
lift-/.f64N/A
lift-/.f64N/A
associate-*l/N/A
lift-pow.f64N/A
pow2N/A
lift-*.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-addN/A
lift-/.f64N/A
associate-*l/N/A
pow2N/A
lower-/.f64N/A
Applied rewrites76.5%
Taylor expanded in x around inf
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
pow2N/A
associate-*l/N/A
lift-/.f64N/A
lift-*.f6447.2
Applied rewrites47.2%
if 3.34999999999999981e-9 < x Initial program 61.3%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6499.3
Applied rewrites99.3%
Taylor expanded in y around 0
Applied rewrites69.3%
Taylor expanded in x around inf
pow2N/A
lift-*.f6463.3
Applied rewrites63.3%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6474.2
Applied rewrites74.2%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (/ (/ (* x x) y_m) y_m))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
return ((x * x) / y_m) / y_m;
}
y_m = private
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_m, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x * x) / y_m) / y_m
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
return ((x * x) / y_m) / y_m;
}
y_m = math.fabs(y) def code(x, y_m, z, t): return ((x * x) / y_m) / y_m
y_m = abs(y) function code(x, y_m, z, t) return Float64(Float64(Float64(x * x) / y_m) / y_m) end
y_m = abs(y); function tmp = code(x, y_m, z, t) tmp = ((x * x) / y_m) / y_m; end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := N[(N[(N[(x * x), $MachinePrecision] / y$95$m), $MachinePrecision] / y$95$m), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\frac{\frac{x \cdot x}{y\_m}}{y\_m}
\end{array}
Initial program 61.8%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
Taylor expanded in y around 0
Applied rewrites69.6%
Taylor expanded in x around inf
pow2N/A
lift-*.f6449.9
Applied rewrites49.9%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6454.1
Applied rewrites54.1%
y_m = (fabs.f64 y) (FPCore (x y_m z t) :precision binary64 (/ (* x x) (* y_m y_m)))
y_m = fabs(y);
double code(double x, double y_m, double z, double t) {
return (x * x) / (y_m * y_m);
}
y_m = private
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_m, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y_m
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x * x) / (y_m * y_m)
end function
y_m = Math.abs(y);
public static double code(double x, double y_m, double z, double t) {
return (x * x) / (y_m * y_m);
}
y_m = math.fabs(y) def code(x, y_m, z, t): return (x * x) / (y_m * y_m)
y_m = abs(y) function code(x, y_m, z, t) return Float64(Float64(x * x) / Float64(y_m * y_m)) end
y_m = abs(y); function tmp = code(x, y_m, z, t) tmp = (x * x) / (y_m * y_m); end
y_m = N[Abs[y], $MachinePrecision] code[x_, y$95$m_, z_, t_] := N[(N[(x * x), $MachinePrecision] / N[(y$95$m * y$95$m), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
y_m = \left|y\right|
\\
\frac{x \cdot x}{y\_m \cdot y\_m}
\end{array}
Initial program 61.8%
lift-+.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
lift-/.f64N/A
pow2N/A
associate-/l*N/A
*-commutativeN/A
pow2N/A
pow2N/A
lower-fma.f64N/A
pow2N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f64N/A
pow2N/A
pow2N/A
times-fracN/A
pow2N/A
lower-pow.f64N/A
lower-/.f6497.5
Applied rewrites97.5%
Taylor expanded in y around 0
Applied rewrites69.6%
Taylor expanded in x around inf
pow2N/A
lift-*.f6449.9
Applied rewrites49.9%
(FPCore (x y z t) :precision binary64 (+ (pow (/ x y) 2.0) (pow (/ z t) 2.0)))
double code(double x, double y, double z, double t) {
return pow((x / y), 2.0) + pow((z / t), 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, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = ((x / y) ** 2.0d0) + ((z / t) ** 2.0d0)
end function
public static double code(double x, double y, double z, double t) {
return Math.pow((x / y), 2.0) + Math.pow((z / t), 2.0);
}
def code(x, y, z, t): return math.pow((x / y), 2.0) + math.pow((z / t), 2.0)
function code(x, y, z, t) return Float64((Float64(x / y) ^ 2.0) + (Float64(z / t) ^ 2.0)) end
function tmp = code(x, y, z, t) tmp = ((x / y) ^ 2.0) + ((z / t) ^ 2.0); end
code[x_, y_, z_, t_] := N[(N[Power[N[(x / y), $MachinePrecision], 2.0], $MachinePrecision] + N[Power[N[(z / t), $MachinePrecision], 2.0], $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
{\left(\frac{x}{y}\right)}^{2} + {\left(\frac{z}{t}\right)}^{2}
\end{array}
herbie shell --seed 2025080
(FPCore (x y z t)
:name "Graphics.Rasterific.Svg.PathConverter:arcToSegments from rasterific-svg-0.2.3.1"
:precision binary64
:alt
(! :herbie-platform default (+ (pow (/ x y) 2) (pow (/ z t) 2)))
(+ (/ (* x x) (* y y)) (/ (* z z) (* t t))))