
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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, 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 / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * 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, 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 / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= t 1.8e-44)
(fma
(* (/ t z) 0.3333333333333333)
(/ 1.0 y)
(fma -0.3333333333333333 (/ y z) x))
(+ (- x (/ (/ y z) 3.0)) (/ t (* (* z 3.0) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= 1.8e-44) {
tmp = fma(((t / z) * 0.3333333333333333), (1.0 / y), fma(-0.3333333333333333, (y / z), x));
} else {
tmp = (x - ((y / z) / 3.0)) + (t / ((z * 3.0) * y));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (t <= 1.8e-44) tmp = fma(Float64(Float64(t / z) * 0.3333333333333333), Float64(1.0 / y), fma(-0.3333333333333333, Float64(y / z), x)); else tmp = Float64(Float64(x - Float64(Float64(y / z) / 3.0)) + Float64(t / Float64(Float64(z * 3.0) * y))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[t, 1.8e-44], N[(N[(N[(t / z), $MachinePrecision] * 0.3333333333333333), $MachinePrecision] * N[(1.0 / y), $MachinePrecision] + N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(N[(y / z), $MachinePrecision] / 3.0), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq 1.8 \cdot 10^{-44}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z} \cdot 0.3333333333333333, \frac{1}{y}, \mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\right)\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{\frac{y}{z}}{3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\end{array}
\end{array}
if t < 1.7999999999999999e-44Initial program 95.5%
lift-+.f64N/A
lift--.f64N/A
lift-*.f64N/A
lift-/.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
lift-*.f64N/A
associate-/r*N/A
mult-flipN/A
mult-flipN/A
metadata-evalN/A
times-fracN/A
metadata-evalN/A
associate-*l*N/A
mult-flipN/A
*-commutativeN/A
lower-fma.f64N/A
Applied rewrites95.7%
if 1.7999999999999999e-44 < t Initial program 95.5%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6495.5
Applied rewrites95.5%
(FPCore (x y z t) :precision binary64 (if (<= y 3.6e-252) (- x (/ (* (- (/ t y) y) -0.3333333333333333) z)) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.6e-252) {
tmp = x - ((((t / y) - y) * -0.3333333333333333) / z);
} else {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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
real(8) :: tmp
if (y <= 3.6d-252) then
tmp = x - ((((t / y) - y) * (-0.3333333333333333d0)) / z)
else
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.6e-252) {
tmp = x - ((((t / y) - y) * -0.3333333333333333) / z);
} else {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 3.6e-252: tmp = x - ((((t / y) - y) * -0.3333333333333333) / z) else: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 3.6e-252) tmp = Float64(x - Float64(Float64(Float64(Float64(t / y) - y) * -0.3333333333333333) / z)); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 3.6e-252) tmp = x - ((((t / y) - y) * -0.3333333333333333) / z); else tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.6e-252], N[(x - N[(N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.6 \cdot 10^{-252}:\\
\;\;\;\;x - \frac{\left(\frac{t}{y} - y\right) \cdot -0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\end{array}
\end{array}
if y < 3.60000000000000023e-252Initial program 95.5%
Applied rewrites95.7%
if 3.60000000000000023e-252 < y Initial program 95.5%
(FPCore (x y z t) :precision binary64 (if (<= y 3.4e-187) (- x (/ (* (- (/ t y) y) -0.3333333333333333) z)) (fma (- (/ t (* y z)) (/ y z)) 0.3333333333333333 x)))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 3.4e-187) {
tmp = x - ((((t / y) - y) * -0.3333333333333333) / z);
} else {
tmp = fma(((t / (y * z)) - (y / z)), 0.3333333333333333, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= 3.4e-187) tmp = Float64(x - Float64(Float64(Float64(Float64(t / y) - y) * -0.3333333333333333) / z)); else tmp = fma(Float64(Float64(t / Float64(y * z)) - Float64(y / z)), 0.3333333333333333, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, 3.4e-187], N[(x - N[(N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] * -0.3333333333333333), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], N[(N[(N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision] - N[(y / z), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 3.4 \cdot 10^{-187}:\\
\;\;\;\;x - \frac{\left(\frac{t}{y} - y\right) \cdot -0.3333333333333333}{z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{y \cdot z} - \frac{y}{z}, 0.3333333333333333, x\right)\\
\end{array}
\end{array}
if y < 3.4000000000000001e-187Initial program 95.5%
Applied rewrites95.7%
if 3.4000000000000001e-187 < y Initial program 95.5%
Applied rewrites95.6%
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
div-subN/A
associate-/r*N/A
lower--.f64N/A
*-commutativeN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift-/.f6495.4
Applied rewrites95.4%
(FPCore (x y z t) :precision binary64 (fma (/ (- (/ t y) y) z) 0.3333333333333333 x))
double code(double x, double y, double z, double t) {
return fma((((t / y) - y) / z), 0.3333333333333333, x);
}
function code(x, y, z, t) return fma(Float64(Float64(Float64(t / y) - y) / z), 0.3333333333333333, x) end
code[x_, y_, z_, t_] := N[(N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{\frac{t}{y} - y}{z}, 0.3333333333333333, x\right)
\end{array}
Initial program 95.5%
Applied rewrites95.6%
(FPCore (x y z t)
:precision binary64
(if (<= y -4000000.0)
(- x (/ (* 0.3333333333333333 y) z))
(if (<= y 3.4e-187)
(fma (/ (/ t y) z) 0.3333333333333333 x)
(if (<= y 4.7e-39)
(fma (/ t (* z y)) 0.3333333333333333 x)
(fma (/ y z) -0.3333333333333333 x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4000000.0) {
tmp = x - ((0.3333333333333333 * y) / z);
} else if (y <= 3.4e-187) {
tmp = fma(((t / y) / z), 0.3333333333333333, x);
} else if (y <= 4.7e-39) {
tmp = fma((t / (z * y)), 0.3333333333333333, x);
} else {
tmp = fma((y / z), -0.3333333333333333, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -4000000.0) tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); elseif (y <= 3.4e-187) tmp = fma(Float64(Float64(t / y) / z), 0.3333333333333333, x); elseif (y <= 4.7e-39) tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, x); else tmp = fma(Float64(y / z), -0.3333333333333333, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -4000000.0], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 3.4e-187], N[(N[(N[(t / y), $MachinePrecision] / z), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], If[LessEqual[y, 4.7e-39], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4000000:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 3.4 \cdot 10^{-187}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{t}{y}}{z}, 0.3333333333333333, x\right)\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-39}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\\
\end{array}
\end{array}
if y < -4e6Initial program 95.5%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f6464.5
Applied rewrites64.5%
if -4e6 < y < 3.4000000000000001e-187Initial program 95.5%
Applied rewrites95.6%
Taylor expanded in y around 0
lift-/.f6462.3
Applied rewrites62.3%
if 3.4000000000000001e-187 < y < 4.7000000000000002e-39Initial program 95.5%
Applied rewrites95.6%
Taylor expanded in y around 0
lift-/.f6462.3
Applied rewrites62.3%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6462.9
Applied rewrites62.9%
if 4.7000000000000002e-39 < y Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -4000000.0)
(- x (/ (* 0.3333333333333333 y) z))
(if (<= y 4.7e-39)
(fma (/ t (* z y)) 0.3333333333333333 x)
(fma (/ y z) -0.3333333333333333 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4000000.0) {
tmp = x - ((0.3333333333333333 * y) / z);
} else if (y <= 4.7e-39) {
tmp = fma((t / (z * y)), 0.3333333333333333, x);
} else {
tmp = fma((y / z), -0.3333333333333333, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -4000000.0) tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); elseif (y <= 4.7e-39) tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, x); else tmp = fma(Float64(y / z), -0.3333333333333333, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -4000000.0], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 4.7e-39], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4000000:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 4.7 \cdot 10^{-39}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\\
\end{array}
\end{array}
if y < -4e6Initial program 95.5%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f6464.5
Applied rewrites64.5%
if -4e6 < y < 4.7000000000000002e-39Initial program 95.5%
Applied rewrites95.6%
Taylor expanded in y around 0
lift-/.f6462.3
Applied rewrites62.3%
Taylor expanded in y around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6462.9
Applied rewrites62.9%
if 4.7000000000000002e-39 < y Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -650.0)
(- x (/ (* 0.3333333333333333 y) z))
(if (<= y 1.8e-45)
(* (/ (/ t z) y) 0.3333333333333333)
(fma (/ y z) -0.3333333333333333 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -650.0) {
tmp = x - ((0.3333333333333333 * y) / z);
} else if (y <= 1.8e-45) {
tmp = ((t / z) / y) * 0.3333333333333333;
} else {
tmp = fma((y / z), -0.3333333333333333, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -650.0) tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); elseif (y <= 1.8e-45) tmp = Float64(Float64(Float64(t / z) / y) * 0.3333333333333333); else tmp = fma(Float64(y / z), -0.3333333333333333, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -650.0], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.8e-45], N[(N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -650:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 1.8 \cdot 10^{-45}:\\
\;\;\;\;\frac{\frac{t}{z}}{y} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\\
\end{array}
\end{array}
if y < -650Initial program 95.5%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f6464.5
Applied rewrites64.5%
if -650 < y < 1.8e-45Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
lift-/.f64N/A
associate-/r*N/A
lower-/.f64N/A
lift-/.f6437.9
Applied rewrites37.9%
if 1.8e-45 < y Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.2e-97)
(- x (/ (* 0.3333333333333333 y) z))
(if (<= y 1.15e-45)
(* (/ t (* z y)) 0.3333333333333333)
(fma (/ y z) -0.3333333333333333 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e-97) {
tmp = x - ((0.3333333333333333 * y) / z);
} else if (y <= 1.15e-45) {
tmp = (t / (z * y)) * 0.3333333333333333;
} else {
tmp = fma((y / z), -0.3333333333333333, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e-97) tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); elseif (y <= 1.15e-45) tmp = Float64(Float64(t / Float64(z * y)) * 0.3333333333333333); else tmp = fma(Float64(y / z), -0.3333333333333333, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e-97], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-45], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-97}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-45}:\\
\;\;\;\;\frac{t}{z \cdot y} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\\
\end{array}
\end{array}
if y < -4.2000000000000002e-97Initial program 95.5%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f6464.5
Applied rewrites64.5%
if -4.2000000000000002e-97 < y < 1.14999999999999996e-45Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
if 1.14999999999999996e-45 < y Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
(FPCore (x y z t)
:precision binary64
(if (<= y -4.2e-97)
(- x (/ (* 0.3333333333333333 y) z))
(if (<= y 1.15e-45)
(* (/ 0.3333333333333333 (* y z)) t)
(fma (/ y z) -0.3333333333333333 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -4.2e-97) {
tmp = x - ((0.3333333333333333 * y) / z);
} else if (y <= 1.15e-45) {
tmp = (0.3333333333333333 / (y * z)) * t;
} else {
tmp = fma((y / z), -0.3333333333333333, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -4.2e-97) tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); elseif (y <= 1.15e-45) tmp = Float64(Float64(0.3333333333333333 / Float64(y * z)) * t); else tmp = fma(Float64(y / z), -0.3333333333333333, x); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -4.2e-97], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 1.15e-45], N[(N[(0.3333333333333333 / N[(y * z), $MachinePrecision]), $MachinePrecision] * t), $MachinePrecision], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.2 \cdot 10^{-97}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\mathbf{elif}\;y \leq 1.15 \cdot 10^{-45}:\\
\;\;\;\;\frac{0.3333333333333333}{y \cdot z} \cdot t\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)\\
\end{array}
\end{array}
if y < -4.2000000000000002e-97Initial program 95.5%
Applied rewrites95.7%
Taylor expanded in y around inf
lower-*.f6464.5
Applied rewrites64.5%
if -4.2000000000000002e-97 < y < 1.14999999999999996e-45Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
*-commutativeN/A
associate-*r/N/A
*-commutativeN/A
associate-*l/N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
*-commutativeN/A
mult-flipN/A
lift-/.f64N/A
*-commutativeN/A
lower-*.f6434.4
Applied rewrites34.4%
if 1.14999999999999996e-45 < y Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
(FPCore (x y z t) :precision binary64 (fma (/ y z) -0.3333333333333333 x))
double code(double x, double y, double z, double t) {
return fma((y / z), -0.3333333333333333, x);
}
function code(x, y, z, t) return fma(Float64(y / z), -0.3333333333333333, x) end
code[x_, y_, z_, t_] := N[(N[(y / z), $MachinePrecision] * -0.3333333333333333 + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{z}, -0.3333333333333333, x\right)
\end{array}
Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
(FPCore (x y z t) :precision binary64 (if (<= x -2.6e+48) (* 1.0 x) (if (<= x 1.46e+116) (* (/ -0.3333333333333333 z) y) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e+48) {
tmp = 1.0 * x;
} else if (x <= 1.46e+116) {
tmp = (-0.3333333333333333 / z) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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
real(8) :: tmp
if (x <= (-2.6d+48)) then
tmp = 1.0d0 * x
else if (x <= 1.46d+116) then
tmp = ((-0.3333333333333333d0) / z) * y
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e+48) {
tmp = 1.0 * x;
} else if (x <= 1.46e+116) {
tmp = (-0.3333333333333333 / z) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.6e+48: tmp = 1.0 * x elif x <= 1.46e+116: tmp = (-0.3333333333333333 / z) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.6e+48) tmp = Float64(1.0 * x); elseif (x <= 1.46e+116) tmp = Float64(Float64(-0.3333333333333333 / z) * y); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.6e+48) tmp = 1.0 * x; elseif (x <= 1.46e+116) tmp = (-0.3333333333333333 / z) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.6e+48], N[(1.0 * x), $MachinePrecision], If[LessEqual[x, 1.46e+116], N[(N[(-0.3333333333333333 / z), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;x \leq 1.46 \cdot 10^{+116}:\\
\;\;\;\;\frac{-0.3333333333333333}{z} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if x < -2.59999999999999995e48 or 1.45999999999999994e116 < x Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6461.0
Applied rewrites61.0%
Taylor expanded in x around inf
Applied rewrites31.0%
if -2.59999999999999995e48 < x < 1.45999999999999994e116Initial program 95.5%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
mult-flip-revN/A
lower-/.f6460.7
Applied rewrites60.7%
Taylor expanded in x around 0
lower-/.f6435.6
Applied rewrites35.6%
(FPCore (x y z t) :precision binary64 (if (<= x -2.6e+48) (* 1.0 x) (if (<= x 1.46e+116) (* (/ y z) -0.3333333333333333) (* 1.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e+48) {
tmp = 1.0 * x;
} else if (x <= 1.46e+116) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = 1.0 * x;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, 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
real(8) :: tmp
if (x <= (-2.6d+48)) then
tmp = 1.0d0 * x
else if (x <= 1.46d+116) then
tmp = (y / z) * (-0.3333333333333333d0)
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -2.6e+48) {
tmp = 1.0 * x;
} else if (x <= 1.46e+116) {
tmp = (y / z) * -0.3333333333333333;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -2.6e+48: tmp = 1.0 * x elif x <= 1.46e+116: tmp = (y / z) * -0.3333333333333333 else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -2.6e+48) tmp = Float64(1.0 * x); elseif (x <= 1.46e+116) tmp = Float64(Float64(y / z) * -0.3333333333333333); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -2.6e+48) tmp = 1.0 * x; elseif (x <= 1.46e+116) tmp = (y / z) * -0.3333333333333333; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -2.6e+48], N[(1.0 * x), $MachinePrecision], If[LessEqual[x, 1.46e+116], N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -2.6 \cdot 10^{+48}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;x \leq 1.46 \cdot 10^{+116}:\\
\;\;\;\;\frac{y}{z} \cdot -0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if x < -2.59999999999999995e48 or 1.45999999999999994e116 < x Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6461.0
Applied rewrites61.0%
Taylor expanded in x around inf
Applied rewrites31.0%
if -2.59999999999999995e48 < x < 1.45999999999999994e116Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift-/.f6435.6
Applied rewrites35.6%
(FPCore (x y z t) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t) {
return 1.0 * x;
}
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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 95.5%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6434.6
Applied rewrites34.6%
Taylor expanded in t around 0
fp-cancel-sub-sign-invN/A
metadata-evalN/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift-/.f6464.5
Applied rewrites64.5%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6461.0
Applied rewrites61.0%
Taylor expanded in x around inf
Applied rewrites31.0%
herbie shell --seed 2025136
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))