
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ x (* (- y z) (- t x))))
double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - 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 = x + ((y - z) * (t - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y - z) * (t - x));
}
def code(x, y, z, t): return x + ((y - z) * (t - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y - z) * Float64(t - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y - z) * (t - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(y - z\right) \cdot \left(t - x\right)
\end{array}
(FPCore (x y z t) :precision binary64 (fma (- y z) (- t x) x))
double code(double x, double y, double z, double t) {
return fma((y - z), (t - x), x);
}
function code(x, y, z, t) return fma(Float64(y - z), Float64(t - x), x) end
code[x_, y_, z_, t_] := N[(N[(y - z), $MachinePrecision] * N[(t - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y - z, t - x, x\right)
\end{array}
Initial program 100.0%
lift-+.f64N/A
lift-*.f64N/A
lift--.f64N/A
lift--.f64N/A
+-commutativeN/A
lower-fma.f64N/A
lift--.f64N/A
lift--.f64100.0
Applied rewrites100.0%
(FPCore (x y z t) :precision binary64 (if (<= z -165000.0) (* (- x t) z) (if (<= z 5e-14) (fma (- t x) y x) (- x (* (- t x) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -165000.0) {
tmp = (x - t) * z;
} else if (z <= 5e-14) {
tmp = fma((t - x), y, x);
} else {
tmp = x - ((t - x) * z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= -165000.0) tmp = Float64(Float64(x - t) * z); elseif (z <= 5e-14) tmp = fma(Float64(t - x), y, x); else tmp = Float64(x - Float64(Float64(t - x) * z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, -165000.0], N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision], If[LessEqual[z, 5e-14], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], N[(x - N[(N[(t - x), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -165000:\\
\;\;\;\;\left(x - t\right) \cdot z\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \left(t - x\right) \cdot z\\
\end{array}
\end{array}
if z < -165000Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
lower--.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f6496.4
Applied rewrites96.4%
Taylor expanded in z around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f6445.0
Applied rewrites45.0%
if -165000 < z < 5.0000000000000002e-14Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6460.2
Applied rewrites60.2%
if 5.0000000000000002e-14 < z Initial program 100.0%
Taylor expanded in y around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6460.5
Applied rewrites60.5%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- x t) z))) (if (<= z -165000.0) t_1 (if (<= z 5.2e-14) (fma (- t x) y x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x - t) * z;
double tmp;
if (z <= -165000.0) {
tmp = t_1;
} else if (z <= 5.2e-14) {
tmp = fma((t - x), y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - t) * z) tmp = 0.0 if (z <= -165000.0) tmp = t_1; elseif (z <= 5.2e-14) tmp = fma(Float64(t - x), y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -165000.0], t$95$1, If[LessEqual[z, 5.2e-14], N[(N[(t - x), $MachinePrecision] * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - t\right) \cdot z\\
\mathbf{if}\;z \leq -165000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.2 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(t - x, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -165000 or 5.19999999999999993e-14 < z Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
lower--.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f6496.4
Applied rewrites96.4%
Taylor expanded in z around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f6445.0
Applied rewrites45.0%
if -165000 < z < 5.19999999999999993e-14Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6460.2
Applied rewrites60.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x t) z)))
(if (<= z -102000.0)
t_1
(if (<= z -1.75e-164)
(fma t y x)
(if (<= z 5.7e-229)
(- x (* x y))
(if (<= z 5e-14) (* (- t x) y) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = (x - t) * z;
double tmp;
if (z <= -102000.0) {
tmp = t_1;
} else if (z <= -1.75e-164) {
tmp = fma(t, y, x);
} else if (z <= 5.7e-229) {
tmp = x - (x * y);
} else if (z <= 5e-14) {
tmp = (t - x) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - t) * z) tmp = 0.0 if (z <= -102000.0) tmp = t_1; elseif (z <= -1.75e-164) tmp = fma(t, y, x); elseif (z <= 5.7e-229) tmp = Float64(x - Float64(x * y)); elseif (z <= 5e-14) tmp = Float64(Float64(t - x) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -102000.0], t$95$1, If[LessEqual[z, -1.75e-164], N[(t * y + x), $MachinePrecision], If[LessEqual[z, 5.7e-229], N[(x - N[(x * y), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5e-14], N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - t\right) \cdot z\\
\mathbf{if}\;z \leq -102000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq -1.75 \cdot 10^{-164}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
\mathbf{elif}\;z \leq 5.7 \cdot 10^{-229}:\\
\;\;\;\;x - x \cdot y\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-14}:\\
\;\;\;\;\left(t - x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -102000 or 5.0000000000000002e-14 < z Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
lower--.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f6496.4
Applied rewrites96.4%
Taylor expanded in z around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f6445.0
Applied rewrites45.0%
if -102000 < z < -1.75e-164Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6460.2
Applied rewrites60.2%
Taylor expanded in x around 0
Applied rewrites41.3%
if -1.75e-164 < z < 5.70000000000000023e-229Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
Taylor expanded in y around inf
lower-*.f6438.3
Applied rewrites38.3%
if 5.70000000000000023e-229 < z < 5.0000000000000002e-14Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x t) z)))
(if (<= z -102000.0)
t_1
(if (<= z 1.6e-181) (fma t y x) (if (<= z 5e-14) (* (- t x) y) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x - t) * z;
double tmp;
if (z <= -102000.0) {
tmp = t_1;
} else if (z <= 1.6e-181) {
tmp = fma(t, y, x);
} else if (z <= 5e-14) {
tmp = (t - x) * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - t) * z) tmp = 0.0 if (z <= -102000.0) tmp = t_1; elseif (z <= 1.6e-181) tmp = fma(t, y, x); elseif (z <= 5e-14) tmp = Float64(Float64(t - x) * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -102000.0], t$95$1, If[LessEqual[z, 1.6e-181], N[(t * y + x), $MachinePrecision], If[LessEqual[z, 5e-14], N[(N[(t - x), $MachinePrecision] * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - t\right) \cdot z\\
\mathbf{if}\;z \leq -102000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{-181}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
\mathbf{elif}\;z \leq 5 \cdot 10^{-14}:\\
\;\;\;\;\left(t - x\right) \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -102000 or 5.0000000000000002e-14 < z Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
lower--.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f6496.4
Applied rewrites96.4%
Taylor expanded in z around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f6445.0
Applied rewrites45.0%
if -102000 < z < 1.6000000000000001e-181Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6460.2
Applied rewrites60.2%
Taylor expanded in x around 0
Applied rewrites41.3%
if 1.6000000000000001e-181 < z < 5.0000000000000002e-14Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (- x t) z))) (if (<= z -102000.0) t_1 (if (<= z 4.9e-14) (fma t y x) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (x - t) * z;
double tmp;
if (z <= -102000.0) {
tmp = t_1;
} else if (z <= 4.9e-14) {
tmp = fma(t, y, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(x - t) * z) tmp = 0.0 if (z <= -102000.0) tmp = t_1; elseif (z <= 4.9e-14) tmp = fma(t, y, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * z), $MachinePrecision]}, If[LessEqual[z, -102000.0], t$95$1, If[LessEqual[z, 4.9e-14], N[(t * y + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(x - t\right) \cdot z\\
\mathbf{if}\;z \leq -102000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 4.9 \cdot 10^{-14}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -102000 or 4.89999999999999995e-14 < z Initial program 100.0%
Taylor expanded in y around 0
associate-+r+N/A
*-commutativeN/A
fp-cancel-sign-sub-invN/A
mul-1-negN/A
lower--.f64N/A
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lower--.f6496.4
Applied rewrites96.4%
Taylor expanded in z around inf
sub-negate-revN/A
mul-1-negN/A
*-commutativeN/A
lower-*.f64N/A
mul-1-negN/A
sub-negate-revN/A
lift--.f6445.0
Applied rewrites45.0%
if -102000 < z < 4.89999999999999995e-14Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6460.2
Applied rewrites60.2%
Taylor expanded in x around 0
Applied rewrites41.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- z) t)))
(if (<= z -7e+140)
(* x z)
(if (<= z -140000.0)
t_1
(if (<= z 6.3e+28)
(fma t y x)
(if (<= z 3.8e+142) t_1 (if (<= z 1.25e+182) (* x z) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = -z * t;
double tmp;
if (z <= -7e+140) {
tmp = x * z;
} else if (z <= -140000.0) {
tmp = t_1;
} else if (z <= 6.3e+28) {
tmp = fma(t, y, x);
} else if (z <= 3.8e+142) {
tmp = t_1;
} else if (z <= 1.25e+182) {
tmp = x * z;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(-z) * t) tmp = 0.0 if (z <= -7e+140) tmp = Float64(x * z); elseif (z <= -140000.0) tmp = t_1; elseif (z <= 6.3e+28) tmp = fma(t, y, x); elseif (z <= 3.8e+142) tmp = t_1; elseif (z <= 1.25e+182) tmp = Float64(x * z); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-z) * t), $MachinePrecision]}, If[LessEqual[z, -7e+140], N[(x * z), $MachinePrecision], If[LessEqual[z, -140000.0], t$95$1, If[LessEqual[z, 6.3e+28], N[(t * y + x), $MachinePrecision], If[LessEqual[z, 3.8e+142], t$95$1, If[LessEqual[z, 1.25e+182], N[(x * z), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-z\right) \cdot t\\
\mathbf{if}\;z \leq -7 \cdot 10^{+140}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq -140000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 6.3 \cdot 10^{+28}:\\
\;\;\;\;\mathsf{fma}\left(t, y, x\right)\\
\mathbf{elif}\;z \leq 3.8 \cdot 10^{+142}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+182}:\\
\;\;\;\;x \cdot z\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -6.99999999999999978e140 or 3.7999999999999999e142 < z < 1.24999999999999993e182Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
Taylor expanded in z around inf
lower-*.f6422.3
Applied rewrites22.3%
if -6.99999999999999978e140 < z < -1.4e5 or 6.3000000000000001e28 < z < 3.7999999999999999e142 or 1.24999999999999993e182 < z Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6448.7
Applied rewrites48.7%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6426.8
Applied rewrites26.8%
if -1.4e5 < z < 6.3000000000000001e28Initial program 100.0%
Taylor expanded in z around 0
+-commutativeN/A
*-commutativeN/A
lower-fma.f64N/A
lift--.f6460.2
Applied rewrites60.2%
Taylor expanded in x around 0
Applied rewrites41.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x) y)))
(if (<= y -3700000000.0)
t_1
(if (<= y 6.2e-150)
(fma x z x)
(if (<= y 2.05e-98)
(* (- z) t)
(if (<= y 470000000000.0)
(fma x z x)
(if (<= y 5.2e+245) (* t y) t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = -x * y;
double tmp;
if (y <= -3700000000.0) {
tmp = t_1;
} else if (y <= 6.2e-150) {
tmp = fma(x, z, x);
} else if (y <= 2.05e-98) {
tmp = -z * t;
} else if (y <= 470000000000.0) {
tmp = fma(x, z, x);
} else if (y <= 5.2e+245) {
tmp = t * y;
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(Float64(-x) * y) tmp = 0.0 if (y <= -3700000000.0) tmp = t_1; elseif (y <= 6.2e-150) tmp = fma(x, z, x); elseif (y <= 2.05e-98) tmp = Float64(Float64(-z) * t); elseif (y <= 470000000000.0) tmp = fma(x, z, x); elseif (y <= 5.2e+245) tmp = Float64(t * y); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) * y), $MachinePrecision]}, If[LessEqual[y, -3700000000.0], t$95$1, If[LessEqual[y, 6.2e-150], N[(x * z + x), $MachinePrecision], If[LessEqual[y, 2.05e-98], N[((-z) * t), $MachinePrecision], If[LessEqual[y, 470000000000.0], N[(x * z + x), $MachinePrecision], If[LessEqual[y, 5.2e+245], N[(t * y), $MachinePrecision], t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-x\right) \cdot y\\
\mathbf{if}\;y \leq -3700000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 6.2 \cdot 10^{-150}:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{elif}\;y \leq 2.05 \cdot 10^{-98}:\\
\;\;\;\;\left(-z\right) \cdot t\\
\mathbf{elif}\;y \leq 470000000000:\\
\;\;\;\;\mathsf{fma}\left(x, z, x\right)\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+245}:\\
\;\;\;\;t \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.7e9 or 5.20000000000000008e245 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6422.8
Applied rewrites22.8%
if -3.7e9 < y < 6.19999999999999996e-150 or 2.0499999999999999e-98 < y < 4.7e11Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
Taylor expanded in y around 0
mul-1-negN/A
add-flipN/A
+-commutativeN/A
lower-fma.f6437.7
Applied rewrites37.7%
if 6.19999999999999996e-150 < y < 2.0499999999999999e-98Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6448.7
Applied rewrites48.7%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6426.8
Applied rewrites26.8%
if 4.7e11 < y < 5.20000000000000008e245Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
Taylor expanded in x around 0
Applied rewrites26.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x) y)))
(if (<= y -3700000000.0)
t_1
(if (<= y -2.7e-44)
(* x z)
(if (<= y 8.2e-38) (* (- z) t) (if (<= y 5.2e+245) (* t y) t_1))))))
double code(double x, double y, double z, double t) {
double t_1 = -x * y;
double tmp;
if (y <= -3700000000.0) {
tmp = t_1;
} else if (y <= -2.7e-44) {
tmp = x * z;
} else if (y <= 8.2e-38) {
tmp = -z * t;
} else if (y <= 5.2e+245) {
tmp = t * y;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = -x * y
if (y <= (-3700000000.0d0)) then
tmp = t_1
else if (y <= (-2.7d-44)) then
tmp = x * z
else if (y <= 8.2d-38) then
tmp = -z * t
else if (y <= 5.2d+245) then
tmp = t * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -x * y;
double tmp;
if (y <= -3700000000.0) {
tmp = t_1;
} else if (y <= -2.7e-44) {
tmp = x * z;
} else if (y <= 8.2e-38) {
tmp = -z * t;
} else if (y <= 5.2e+245) {
tmp = t * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -x * y tmp = 0 if y <= -3700000000.0: tmp = t_1 elif y <= -2.7e-44: tmp = x * z elif y <= 8.2e-38: tmp = -z * t elif y <= 5.2e+245: tmp = t * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-x) * y) tmp = 0.0 if (y <= -3700000000.0) tmp = t_1; elseif (y <= -2.7e-44) tmp = Float64(x * z); elseif (y <= 8.2e-38) tmp = Float64(Float64(-z) * t); elseif (y <= 5.2e+245) tmp = Float64(t * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -x * y; tmp = 0.0; if (y <= -3700000000.0) tmp = t_1; elseif (y <= -2.7e-44) tmp = x * z; elseif (y <= 8.2e-38) tmp = -z * t; elseif (y <= 5.2e+245) tmp = t * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) * y), $MachinePrecision]}, If[LessEqual[y, -3700000000.0], t$95$1, If[LessEqual[y, -2.7e-44], N[(x * z), $MachinePrecision], If[LessEqual[y, 8.2e-38], N[((-z) * t), $MachinePrecision], If[LessEqual[y, 5.2e+245], N[(t * y), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-x\right) \cdot y\\
\mathbf{if}\;y \leq -3700000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq -2.7 \cdot 10^{-44}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{-38}:\\
\;\;\;\;\left(-z\right) \cdot t\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+245}:\\
\;\;\;\;t \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.7e9 or 5.20000000000000008e245 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6422.8
Applied rewrites22.8%
if -3.7e9 < y < -2.6999999999999999e-44Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
Taylor expanded in z around inf
lower-*.f6422.3
Applied rewrites22.3%
if -2.6999999999999999e-44 < y < 8.1999999999999996e-38Initial program 100.0%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f64N/A
lift--.f6448.7
Applied rewrites48.7%
Taylor expanded in y around 0
mul-1-negN/A
lower-neg.f6426.8
Applied rewrites26.8%
if 8.1999999999999996e-38 < y < 5.20000000000000008e245Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
Taylor expanded in x around 0
Applied rewrites26.0%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* (- x) y)))
(if (<= y -3700000000.0)
t_1
(if (<= y 550000000000.0) (* x z) (if (<= y 5.2e+245) (* t y) t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = -x * y;
double tmp;
if (y <= -3700000000.0) {
tmp = t_1;
} else if (y <= 550000000000.0) {
tmp = x * z;
} else if (y <= 5.2e+245) {
tmp = t * y;
} else {
tmp = t_1;
}
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) :: t_1
real(8) :: tmp
t_1 = -x * y
if (y <= (-3700000000.0d0)) then
tmp = t_1
else if (y <= 550000000000.0d0) then
tmp = x * z
else if (y <= 5.2d+245) then
tmp = t * y
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -x * y;
double tmp;
if (y <= -3700000000.0) {
tmp = t_1;
} else if (y <= 550000000000.0) {
tmp = x * z;
} else if (y <= 5.2e+245) {
tmp = t * y;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -x * y tmp = 0 if y <= -3700000000.0: tmp = t_1 elif y <= 550000000000.0: tmp = x * z elif y <= 5.2e+245: tmp = t * y else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-x) * y) tmp = 0.0 if (y <= -3700000000.0) tmp = t_1; elseif (y <= 550000000000.0) tmp = Float64(x * z); elseif (y <= 5.2e+245) tmp = Float64(t * y); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -x * y; tmp = 0.0; if (y <= -3700000000.0) tmp = t_1; elseif (y <= 550000000000.0) tmp = x * z; elseif (y <= 5.2e+245) tmp = t * y; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[((-x) * y), $MachinePrecision]}, If[LessEqual[y, -3700000000.0], t$95$1, If[LessEqual[y, 550000000000.0], N[(x * z), $MachinePrecision], If[LessEqual[y, 5.2e+245], N[(t * y), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \left(-x\right) \cdot y\\
\mathbf{if}\;y \leq -3700000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 550000000000:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;y \leq 5.2 \cdot 10^{+245}:\\
\;\;\;\;t \cdot y\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -3.7e9 or 5.20000000000000008e245 < y Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
Taylor expanded in x around inf
mul-1-negN/A
lower-neg.f6422.8
Applied rewrites22.8%
if -3.7e9 < y < 5.5e11Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
Taylor expanded in z around inf
lower-*.f6422.3
Applied rewrites22.3%
if 5.5e11 < y < 5.20000000000000008e245Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
Taylor expanded in x around 0
Applied rewrites26.0%
(FPCore (x y z t) :precision binary64 (if (<= z -2.1e+140) (* x z) (if (<= z 9.5e+18) (* t y) (* x z))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e+140) {
tmp = x * z;
} else if (z <= 9.5e+18) {
tmp = t * y;
} else {
tmp = x * z;
}
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 (z <= (-2.1d+140)) then
tmp = x * z
else if (z <= 9.5d+18) then
tmp = t * y
else
tmp = x * z
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.1e+140) {
tmp = x * z;
} else if (z <= 9.5e+18) {
tmp = t * y;
} else {
tmp = x * z;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.1e+140: tmp = x * z elif z <= 9.5e+18: tmp = t * y else: tmp = x * z return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.1e+140) tmp = Float64(x * z); elseif (z <= 9.5e+18) tmp = Float64(t * y); else tmp = Float64(x * z); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.1e+140) tmp = x * z; elseif (z <= 9.5e+18) tmp = t * y; else tmp = x * z; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.1e+140], N[(x * z), $MachinePrecision], If[LessEqual[z, 9.5e+18], N[(t * y), $MachinePrecision], N[(x * z), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{+140}:\\
\;\;\;\;x \cdot z\\
\mathbf{elif}\;z \leq 9.5 \cdot 10^{+18}:\\
\;\;\;\;t \cdot y\\
\mathbf{else}:\\
\;\;\;\;x \cdot z\\
\end{array}
\end{array}
if z < -2.1000000000000002e140 or 9.5e18 < z Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
Taylor expanded in z around inf
lower-*.f6422.3
Applied rewrites22.3%
if -2.1000000000000002e140 < z < 9.5e18Initial program 100.0%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lift--.f6444.6
Applied rewrites44.6%
Taylor expanded in x around 0
Applied rewrites26.0%
(FPCore (x y z t) :precision binary64 (* x z))
double code(double x, double y, double z, double t) {
return x * z;
}
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 * z
end function
public static double code(double x, double y, double z, double t) {
return x * z;
}
def code(x, y, z, t): return x * z
function code(x, y, z, t) return Float64(x * z) end
function tmp = code(x, y, z, t) tmp = x * z; end
code[x_, y_, z_, t_] := N[(x * z), $MachinePrecision]
\begin{array}{l}
\\
x \cdot z
\end{array}
Initial program 100.0%
Taylor expanded in t around 0
mul-1-negN/A
sub-flip-reverseN/A
lower--.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f6456.3
Applied rewrites56.3%
Taylor expanded in z around inf
lower-*.f6422.3
Applied rewrites22.3%
herbie shell --seed 2025134
(FPCore (x y z t)
:name "Data.Metrics.Snapshot:quantile from metrics-0.3.0.2"
:precision binary64
(+ x (* (- y z) (- t x))))