
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - 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, a)
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), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
Herbie found 21 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* (- y z) (/ (- t x) (- a z)))))
double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - 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, a)
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), intent (in) :: a
code = x + ((y - z) * ((t - x) / (a - z)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y - z) * ((t - x) / (a - z)));
}
def code(x, y, z, t, a): return x + ((y - z) * ((t - x) / (a - z)))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y - z) * ((t - x) / (a - z))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(y - z\right) \cdot \frac{t - x}{a - z}
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-302)
(fma (- x t) (* (/ -1.0 (- a z)) (- y z)) x)
(if (<= t_1 0.0)
(- (+ t (* -1.0 (/ (* y (- t x)) z))) (* -1.0 (/ (* a (- t x)) z)))
(- x (* (/ (- z y) (- z a)) (- x t)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-302) {
tmp = fma((x - t), ((-1.0 / (a - z)) * (y - z)), x);
} else if (t_1 <= 0.0) {
tmp = (t + (-1.0 * ((y * (t - x)) / z))) - (-1.0 * ((a * (t - x)) / z));
} else {
tmp = x - (((z - y) / (z - a)) * (x - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-302) tmp = fma(Float64(x - t), Float64(Float64(-1.0 / Float64(a - z)) * Float64(y - z)), x); elseif (t_1 <= 0.0) tmp = Float64(Float64(t + Float64(-1.0 * Float64(Float64(y * Float64(t - x)) / z))) - Float64(-1.0 * Float64(Float64(a * Float64(t - x)) / z))); else tmp = Float64(x - Float64(Float64(Float64(z - y) / Float64(z - a)) * Float64(x - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-302], N[(N[(x - t), $MachinePrecision] * N[(N[(-1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(N[(t + N[(-1.0 * N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(-1.0 * N[(N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{-1}{a - z} \cdot \left(y - z\right), x\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;\left(t + -1 \cdot \frac{y \cdot \left(t - x\right)}{z}\right) - -1 \cdot \frac{a \cdot \left(t - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z - y}{z - a} \cdot \left(x - t\right)\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999996e-303Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f6483.6
Applied rewrites83.6%
if -9.9999999999999996e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.9%
Taylor expanded in z around inf
lower--.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f64N/A
lower--.f6445.9
Applied rewrites45.9%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval83.6
Applied rewrites83.6%
Applied rewrites83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-302)
(fma (- x t) (* (/ -1.0 (- a z)) (- y z)) x)
(if (<= t_1 0.0)
(+ t (* -1.0 (/ (- (* y (- t x)) (* a (- t x))) z)))
(- x (* (/ (- z y) (- z a)) (- x t)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-302) {
tmp = fma((x - t), ((-1.0 / (a - z)) * (y - z)), x);
} else if (t_1 <= 0.0) {
tmp = t + (-1.0 * (((y * (t - x)) - (a * (t - x))) / z));
} else {
tmp = x - (((z - y) / (z - a)) * (x - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-302) tmp = fma(Float64(x - t), Float64(Float64(-1.0 / Float64(a - z)) * Float64(y - z)), x); elseif (t_1 <= 0.0) tmp = Float64(t + Float64(-1.0 * Float64(Float64(Float64(y * Float64(t - x)) - Float64(a * Float64(t - x))) / z))); else tmp = Float64(x - Float64(Float64(Float64(z - y) / Float64(z - a)) * Float64(x - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-302], N[(N[(x - t), $MachinePrecision] * N[(N[(-1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 0.0], N[(t + N[(-1.0 * N[(N[(N[(y * N[(t - x), $MachinePrecision]), $MachinePrecision] - N[(a * N[(t - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{-1}{a - z} \cdot \left(y - z\right), x\right)\\
\mathbf{elif}\;t\_1 \leq 0:\\
\;\;\;\;t + -1 \cdot \frac{y \cdot \left(t - x\right) - a \cdot \left(t - x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z - y}{z - a} \cdot \left(x - t\right)\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999996e-303Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f6483.6
Applied rewrites83.6%
if -9.9999999999999996e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 0.0Initial program 79.9%
Taylor expanded in z around -inf
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6446.5
Applied rewrites46.5%
if 0.0 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval83.6
Applied rewrites83.6%
Applied rewrites83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-302)
(fma (- x t) (* (/ -1.0 (- a z)) (- y z)) x)
(if (<= t_1 5e-177)
(* t (- (/ y (- a z)) (/ z (- a z))))
(- x (* (/ (- z y) (- z a)) (- x t)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-302) {
tmp = fma((x - t), ((-1.0 / (a - z)) * (y - z)), x);
} else if (t_1 <= 5e-177) {
tmp = t * ((y / (a - z)) - (z / (a - z)));
} else {
tmp = x - (((z - y) / (z - a)) * (x - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-302) tmp = fma(Float64(x - t), Float64(Float64(-1.0 / Float64(a - z)) * Float64(y - z)), x); elseif (t_1 <= 5e-177) tmp = Float64(t * Float64(Float64(y / Float64(a - z)) - Float64(z / Float64(a - z)))); else tmp = Float64(x - Float64(Float64(Float64(z - y) / Float64(z - a)) * Float64(x - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-302], N[(N[(x - t), $MachinePrecision] * N[(N[(-1.0 / N[(a - z), $MachinePrecision]), $MachinePrecision] * N[(y - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-177], N[(t * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{-1}{a - z} \cdot \left(y - z\right), x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-177}:\\
\;\;\;\;t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z - y}{z - a} \cdot \left(x - t\right)\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999996e-303Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
mult-flipN/A
associate-*l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lower-*.f64N/A
metadata-evalN/A
frac-2neg-revN/A
lower-/.f6483.6
Applied rewrites83.6%
if -9.9999999999999996e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e-177Initial program 79.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if 5e-177 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval83.6
Applied rewrites83.6%
Applied rewrites83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-302)
(fma (- x t) (/ (- z y) (- a z)) x)
(if (<= t_1 5e-177)
(* t (- (/ y (- a z)) (/ z (- a z))))
(- x (* (/ (- z y) (- z a)) (- x t)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-302) {
tmp = fma((x - t), ((z - y) / (a - z)), x);
} else if (t_1 <= 5e-177) {
tmp = t * ((y / (a - z)) - (z / (a - z)));
} else {
tmp = x - (((z - y) / (z - a)) * (x - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-302) tmp = fma(Float64(x - t), Float64(Float64(z - y) / Float64(a - z)), x); elseif (t_1 <= 5e-177) tmp = Float64(t * Float64(Float64(y / Float64(a - z)) - Float64(z / Float64(a - z)))); else tmp = Float64(x - Float64(Float64(Float64(z - y) / Float64(z - a)) * Float64(x - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-302], N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-177], N[(t * N[(N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision] - N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{z - y}{a - z}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-177}:\\
\;\;\;\;t \cdot \left(\frac{y}{a - z} - \frac{z}{a - z}\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z - y}{z - a} \cdot \left(x - t\right)\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999996e-303Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -9.9999999999999996e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e-177Initial program 79.9%
Taylor expanded in t around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower--.f6451.5
Applied rewrites51.5%
if 5e-177 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval83.6
Applied rewrites83.6%
Applied rewrites83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_1 -1e-302)
(fma (- x t) (/ (- z y) (- a z)) x)
(if (<= t_1 5e-177)
(/ (* t (- y z)) (- a z))
(- x (* (/ (- z y) (- z a)) (- x t)))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_1 <= -1e-302) {
tmp = fma((x - t), ((z - y) / (a - z)), x);
} else if (t_1 <= 5e-177) {
tmp = (t * (y - z)) / (a - z);
} else {
tmp = x - (((z - y) / (z - a)) * (x - t));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_1 <= -1e-302) tmp = fma(Float64(x - t), Float64(Float64(z - y) / Float64(a - z)), x); elseif (t_1 <= 5e-177) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); else tmp = Float64(x - Float64(Float64(Float64(z - y) / Float64(z - a)) * Float64(x - t))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-302], N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-177], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(N[(z - y), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(x - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
t_1 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{z - y}{a - z}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-177}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{z - y}{z - a} \cdot \left(x - t\right)\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999996e-303Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -9.9999999999999996e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e-177Initial program 79.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7
Applied rewrites39.7%
if 5e-177 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval83.6
Applied rewrites83.6%
Applied rewrites83.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x t) (/ (- z y) (- a z)) x))
(t_2 (+ x (* (- y z) (/ (- t x) (- a z))))))
(if (<= t_2 -1e-302)
t_1
(if (<= t_2 5e-177) (/ (* t (- y z)) (- a z)) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - t), ((z - y) / (a - z)), x);
double t_2 = x + ((y - z) * ((t - x) / (a - z)));
double tmp;
if (t_2 <= -1e-302) {
tmp = t_1;
} else if (t_2 <= 5e-177) {
tmp = (t * (y - z)) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - t), Float64(Float64(z - y) / Float64(a - z)), x) t_2 = Float64(x + Float64(Float64(y - z) * Float64(Float64(t - x) / Float64(a - z)))) tmp = 0.0 if (t_2 <= -1e-302) tmp = t_1; elseif (t_2 <= 5e-177) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * N[(N[(z - y), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y - z), $MachinePrecision] * N[(N[(t - x), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -1e-302], t$95$1, If[LessEqual[t$95$2, 5e-177], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - t, \frac{z - y}{a - z}, x\right)\\
t_2 := x + \left(y - z\right) \cdot \frac{t - x}{a - z}\\
\mathbf{if}\;t\_2 \leq -1 \cdot 10^{-302}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{-177}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < -9.9999999999999996e-303 or 5e-177 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
if -9.9999999999999996e-303 < (+.f64 x (*.f64 (-.f64 y z) (/.f64 (-.f64 t x) (-.f64 a z)))) < 5e-177Initial program 79.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x t) (/ y (- z a)) x)))
(if (<= y -5.4e+129)
t_1
(if (<= y 3.2e+78) (fma (/ (- y z) (- a z)) t x) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - t), (y / (z - a)), x);
double tmp;
if (y <= -5.4e+129) {
tmp = t_1;
} else if (y <= 3.2e+78) {
tmp = fma(((y - z) / (a - z)), t, x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - t), Float64(y / Float64(z - a)), x) tmp = 0.0 if (y <= -5.4e+129) tmp = t_1; elseif (y <= 3.2e+78) tmp = fma(Float64(Float64(y - z) / Float64(a - z)), t, x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -5.4e+129], t$95$1, If[LessEqual[y, 3.2e+78], N[(N[(N[(y - z), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision] * t + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - t, \frac{y}{z - a}, x\right)\\
\mathbf{if}\;y \leq -5.4 \cdot 10^{+129}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(\frac{y - z}{a - z}, t, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.4000000000000002e129 or 3.19999999999999994e78 < y Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6483.6
Applied rewrites83.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
if -5.4000000000000002e129 < y < 3.19999999999999994e78Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
associate-*r*N/A
mult-flip-revN/A
lower-fma.f64N/A
lower-/.f6467.2
Applied rewrites67.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x t) (/ y (- z a)) x)))
(if (<= y -5.2e-13)
t_1
(if (<= y 5.4e-207)
(fma (- x t) (/ z (- a z)) x)
(if (<= y 3.2e+78) (fma (/ t (- z a)) (- z y) x) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - t), (y / (z - a)), x);
double tmp;
if (y <= -5.2e-13) {
tmp = t_1;
} else if (y <= 5.4e-207) {
tmp = fma((x - t), (z / (a - z)), x);
} else if (y <= 3.2e+78) {
tmp = fma((t / (z - a)), (z - y), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - t), Float64(y / Float64(z - a)), x) tmp = 0.0 if (y <= -5.2e-13) tmp = t_1; elseif (y <= 5.4e-207) tmp = fma(Float64(x - t), Float64(z / Float64(a - z)), x); elseif (y <= 3.2e+78) tmp = fma(Float64(t / Float64(z - a)), Float64(z - y), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -5.2e-13], t$95$1, If[LessEqual[y, 5.4e-207], N[(N[(x - t), $MachinePrecision] * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 3.2e+78], N[(N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision] * N[(z - y), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - t, \frac{y}{z - a}, x\right)\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 5.4 \cdot 10^{-207}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{z}{a - z}, x\right)\\
\mathbf{elif}\;y \leq 3.2 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z - a}, z - y, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.2000000000000001e-13 or 3.19999999999999994e78 < y Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6483.6
Applied rewrites83.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
if -5.2000000000000001e-13 < y < 5.4e-207Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
Taylor expanded in y around 0
Applied rewrites46.4%
if 5.4e-207 < y < 3.19999999999999994e78Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-fma.f64N/A
lift-/.f64N/A
distribute-neg-frac2N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f6464.2
Applied rewrites64.2%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (- x t) (/ y (- z a)) x)))
(if (<= y -5.2e-13)
t_1
(if (<= y 1.76e+78) (fma (- x t) (/ z (- a z)) x) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma((x - t), (y / (z - a)), x);
double tmp;
if (y <= -5.2e-13) {
tmp = t_1;
} else if (y <= 1.76e+78) {
tmp = fma((x - t), (z / (a - z)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(x - t), Float64(y / Float64(z - a)), x) tmp = 0.0 if (y <= -5.2e-13) tmp = t_1; elseif (y <= 1.76e+78) tmp = fma(Float64(x - t), Float64(z / Float64(a - z)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(x - t), $MachinePrecision] * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -5.2e-13], t$95$1, If[LessEqual[y, 1.76e+78], N[(N[(x - t), $MachinePrecision] * N[(z / N[(a - z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(x - t, \frac{y}{z - a}, x\right)\\
\mathbf{if}\;y \leq -5.2 \cdot 10^{-13}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 1.76 \cdot 10^{+78}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{z}{a - z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -5.2000000000000001e-13 or 1.76e78 < y Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f6483.6
Applied rewrites83.6%
Taylor expanded in y around inf
lower-/.f64N/A
lower--.f6460.8
Applied rewrites60.8%
if -5.2000000000000001e-13 < y < 1.76e78Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
Taylor expanded in y around 0
Applied rewrites46.4%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) (- y z) x)))
(if (<= a -9.2e+61)
t_1
(if (<= a 3.5e-33) (fma (- x t) (/ (- y z) z) x) t_1))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), (y - z), x);
double tmp;
if (a <= -9.2e+61) {
tmp = t_1;
} else if (a <= 3.5e-33) {
tmp = fma((x - t), ((y - z) / z), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), Float64(y - z), x) tmp = 0.0 if (a <= -9.2e+61) tmp = t_1; elseif (a <= 3.5e-33) tmp = fma(Float64(x - t), Float64(Float64(y - z) / z), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -9.2e+61], t$95$1, If[LessEqual[a, 3.5e-33], N[(N[(x - t), $MachinePrecision] * N[(N[(y - z), $MachinePrecision] / z), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -9.2 \cdot 10^{+61}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 3.5 \cdot 10^{-33}:\\
\;\;\;\;\mathsf{fma}\left(x - t, \frac{y - z}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -9.1999999999999998e61 or 3.4999999999999999e-33 < a Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.0
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.0
Applied rewrites80.0%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
frac-2negN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lower--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower--.f6451.4
Applied rewrites51.4%
if -9.1999999999999998e61 < a < 3.4999999999999999e-33Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
frac-2negN/A
associate-*l/N/A
associate-/l*N/A
lower-fma.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
frac-2neg-revN/A
lower-/.f64N/A
lower--.f6483.7
Applied rewrites83.7%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
frac-2neg-revN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
metadata-evalN/A
lower-/.f64N/A
metadata-eval83.6
Applied rewrites83.6%
Taylor expanded in a around 0
lower-/.f64N/A
lower--.f6438.7
Applied rewrites38.7%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ (- t x) a) (- y z) x)))
(if (<= a -2.45e+60)
t_1
(if (<= a -6.8e-296)
(/ (* t (- y z)) (- a z))
(if (<= a 1.46e-68) (/ (* y (- x t)) (- z a)) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma(((t - x) / a), (y - z), x);
double tmp;
if (a <= -2.45e+60) {
tmp = t_1;
} else if (a <= -6.8e-296) {
tmp = (t * (y - z)) / (a - z);
} else if (a <= 1.46e-68) {
tmp = (y * (x - t)) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(Float64(t - x) / a), Float64(y - z), x) tmp = 0.0 if (a <= -2.45e+60) tmp = t_1; elseif (a <= -6.8e-296) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); elseif (a <= 1.46e-68) tmp = Float64(Float64(y * Float64(x - t)) / Float64(z - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(N[(t - x), $MachinePrecision] / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2.45e+60], t$95$1, If[LessEqual[a, -6.8e-296], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.46e-68], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t - x}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -2.45 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{elif}\;a \leq 1.46 \cdot 10^{-68}:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -2.4500000000000001e60 or 1.45999999999999998e-68 < a Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6480.0
lift-/.f64N/A
frac-2negN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6480.0
Applied rewrites80.0%
lift-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
sub-negate-revN/A
frac-2negN/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
frac-2negN/A
metadata-evalN/A
sub-negate-revN/A
lift--.f64N/A
lower-/.f64N/A
lower--.f6479.9
Applied rewrites79.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower--.f6451.4
Applied rewrites51.4%
if -2.4500000000000001e60 < a < -6.79999999999999993e-296Initial program 79.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7
Applied rewrites39.7%
if -6.79999999999999993e-296 < a < 1.45999999999999998e-68Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.1
Applied rewrites68.1%
Taylor expanded in y around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.5
Applied rewrites38.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (+ x (/ t (/ a (- y z))))))
(if (<= a -2e+60)
t_1
(if (<= a -6.8e-296)
(/ (* t (- y z)) (- a z))
(if (<= a 6.5e-67)
(/ (* y (- x t)) (- z a))
(if (<= a 3.2e+86) (+ x (* (- t x) (/ y a))) t_1))))))double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / (a / (y - z)));
double tmp;
if (a <= -2e+60) {
tmp = t_1;
} else if (a <= -6.8e-296) {
tmp = (t * (y - z)) / (a - z);
} else if (a <= 6.5e-67) {
tmp = (y * (x - t)) / (z - a);
} else if (a <= 3.2e+86) {
tmp = x + ((t - x) * (y / a));
} 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, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t / (a / (y - z)))
if (a <= (-2d+60)) then
tmp = t_1
else if (a <= (-6.8d-296)) then
tmp = (t * (y - z)) / (a - z)
else if (a <= 6.5d-67) then
tmp = (y * (x - t)) / (z - a)
else if (a <= 3.2d+86) then
tmp = x + ((t - x) * (y / a))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / (a / (y - z)));
double tmp;
if (a <= -2e+60) {
tmp = t_1;
} else if (a <= -6.8e-296) {
tmp = (t * (y - z)) / (a - z);
} else if (a <= 6.5e-67) {
tmp = (y * (x - t)) / (z - a);
} else if (a <= 3.2e+86) {
tmp = x + ((t - x) * (y / a));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t / (a / (y - z))) tmp = 0 if a <= -2e+60: tmp = t_1 elif a <= -6.8e-296: tmp = (t * (y - z)) / (a - z) elif a <= 6.5e-67: tmp = (y * (x - t)) / (z - a) elif a <= 3.2e+86: tmp = x + ((t - x) * (y / a)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t / Float64(a / Float64(y - z)))) tmp = 0.0 if (a <= -2e+60) tmp = t_1; elseif (a <= -6.8e-296) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); elseif (a <= 6.5e-67) tmp = Float64(Float64(y * Float64(x - t)) / Float64(z - a)); elseif (a <= 3.2e+86) tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t / (a / (y - z))); tmp = 0.0; if (a <= -2e+60) tmp = t_1; elseif (a <= -6.8e-296) tmp = (t * (y - z)) / (a - z); elseif (a <= 6.5e-67) tmp = (y * (x - t)) / (z - a); elseif (a <= 3.2e+86) tmp = x + ((t - x) * (y / a)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t / N[(a / N[(y - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[a, -2e+60], t$95$1, If[LessEqual[a, -6.8e-296], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e-67], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 3.2e+86], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]]]
\begin{array}{l}
t_1 := x + \frac{t}{\frac{a}{y - z}}\\
\mathbf{if}\;a \leq -2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z - a}\\
\mathbf{elif}\;a \leq 3.2 \cdot 10^{+86}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.9999999999999999e60 or 3.2e86 < a Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in z around 0
Applied rewrites45.2%
if -1.9999999999999999e60 < a < -6.79999999999999993e-296Initial program 79.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7
Applied rewrites39.7%
if -6.79999999999999993e-296 < a < 6.4999999999999997e-67Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.1
Applied rewrites68.1%
Taylor expanded in y around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.5
Applied rewrites38.5%
if 6.4999999999999997e-67 < a < 3.2e86Initial program 79.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.7
Applied rewrites43.7%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6448.0
Applied rewrites48.0%
(FPCore (x y z t a)
:precision binary64
(if (<= a -2e+60)
(fma (/ t a) (- y z) x)
(if (<= a -6.8e-296)
(/ (* t (- y z)) (- a z))
(if (<= a 6.5e-67) (/ (* y (- x t)) (- z a)) (+ x (* (- t x) (/ y a)))))))double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= -2e+60) {
tmp = fma((t / a), (y - z), x);
} else if (a <= -6.8e-296) {
tmp = (t * (y - z)) / (a - z);
} else if (a <= 6.5e-67) {
tmp = (y * (x - t)) / (z - a);
} else {
tmp = x + ((t - x) * (y / a));
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (a <= -2e+60) tmp = fma(Float64(t / a), Float64(y - z), x); elseif (a <= -6.8e-296) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); elseif (a <= 6.5e-67) tmp = Float64(Float64(y * Float64(x - t)) / Float64(z - a)); else tmp = Float64(x + Float64(Float64(t - x) * Float64(y / a))); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, -2e+60], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[a, -6.8e-296], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 6.5e-67], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(t - x), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\mathbf{if}\;a \leq -2 \cdot 10^{+60}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{elif}\;a \leq 6.5 \cdot 10^{-67}:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - x\right) \cdot \frac{y}{a}\\
\end{array}
if a < -1.9999999999999999e60Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in z around 0
Applied rewrites44.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6444.1
Applied rewrites44.1%
if -1.9999999999999999e60 < a < -6.79999999999999993e-296Initial program 79.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7
Applied rewrites39.7%
if -6.79999999999999993e-296 < a < 6.4999999999999997e-67Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.1
Applied rewrites68.1%
Taylor expanded in y around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.5
Applied rewrites38.5%
if 6.4999999999999997e-67 < a Initial program 79.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.7
Applied rewrites43.7%
lift-/.f64N/A
mult-flipN/A
lift-*.f64N/A
*-commutativeN/A
associate-*l*N/A
lower-*.f64N/A
mult-flip-revN/A
lower-/.f6448.0
Applied rewrites48.0%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (fma (/ t a) (- y z) x)))
(if (<= a -2e+60)
t_1
(if (<= a -6.8e-296)
(/ (* t (- y z)) (- a z))
(if (<= a 1.2e-16) (/ (* y (- x t)) (- z a)) t_1)))))double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -2e+60) {
tmp = t_1;
} else if (a <= -6.8e-296) {
tmp = (t * (y - z)) / (a - z);
} else if (a <= 1.2e-16) {
tmp = (y * (x - t)) / (z - a);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -2e+60) tmp = t_1; elseif (a <= -6.8e-296) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); elseif (a <= 1.2e-16) tmp = Float64(Float64(y * Float64(x - t)) / Float64(z - a)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2e+60], t$95$1, If[LessEqual[a, -6.8e-296], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], If[LessEqual[a, 1.2e-16], N[(N[(y * N[(x - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq -6.8 \cdot 10^{-296}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{elif}\;a \leq 1.2 \cdot 10^{-16}:\\
\;\;\;\;\frac{y \cdot \left(x - t\right)}{z - a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.9999999999999999e60 or 1.20000000000000002e-16 < a Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in z around 0
Applied rewrites44.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6444.1
Applied rewrites44.1%
if -1.9999999999999999e60 < a < -6.79999999999999993e-296Initial program 79.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7
Applied rewrites39.7%
if -6.79999999999999993e-296 < a < 1.20000000000000002e-16Initial program 79.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
lift-/.f64N/A
mult-flipN/A
associate-*r*N/A
*-commutativeN/A
lower-fma.f64N/A
frac-2negN/A
metadata-evalN/A
lower-/.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-outN/A
lower-*.f64N/A
lower--.f64N/A
lift--.f64N/A
sub-negate-revN/A
lower--.f6468.1
Applied rewrites68.1%
Taylor expanded in y around -inf
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6438.5
Applied rewrites38.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (fma (/ t a) (- y z) x))) (if (<= a -2e+60) t_1 (if (<= a 5.6e-90) (/ (* t (- y z)) (- a z)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = fma((t / a), (y - z), x);
double tmp;
if (a <= -2e+60) {
tmp = t_1;
} else if (a <= 5.6e-90) {
tmp = (t * (y - z)) / (a - z);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = fma(Float64(t / a), Float64(y - z), x) tmp = 0.0 if (a <= -2e+60) tmp = t_1; elseif (a <= 5.6e-90) tmp = Float64(Float64(t * Float64(y - z)) / Float64(a - z)); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[a, -2e+60], t$95$1, If[LessEqual[a, 5.6e-90], N[(N[(t * N[(y - z), $MachinePrecision]), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{if}\;a \leq -2 \cdot 10^{+60}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;a \leq 5.6 \cdot 10^{-90}:\\
\;\;\;\;\frac{t \cdot \left(y - z\right)}{a - z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if a < -1.9999999999999999e60 or 5.5999999999999998e-90 < a Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in z around 0
Applied rewrites44.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6444.1
Applied rewrites44.1%
if -1.9999999999999999e60 < a < 5.5999999999999998e-90Initial program 79.9%
Taylor expanded in x around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f64N/A
lower--.f6439.7
Applied rewrites39.7%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.55) (+ x (/ t 1.0)) (if (<= z 4.5e+129) (fma (/ t a) (- y z) x) (+ x (- t x)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55) {
tmp = x + (t / 1.0);
} else if (z <= 4.5e+129) {
tmp = fma((t / a), (y - z), x);
} else {
tmp = x + (t - x);
}
return tmp;
}
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55) tmp = Float64(x + Float64(t / 1.0)); elseif (z <= 4.5e+129) tmp = fma(Float64(t / a), Float64(y - z), x); else tmp = Float64(x + Float64(t - x)); end return tmp end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55], N[(x + N[(t / 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 4.5e+129], N[(N[(t / a), $MachinePrecision] * N[(y - z), $MachinePrecision] + x), $MachinePrecision], N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -1.55:\\
\;\;\;\;x + \frac{t}{1}\\
\mathbf{elif}\;z \leq 4.5 \cdot 10^{+129}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y - z, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + \left(t - x\right)\\
\end{array}
if z < -1.55000000000000004Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in z around inf
Applied rewrites33.3%
if -1.55000000000000004 < z < 4.5000000000000001e129Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
Taylor expanded in z around 0
Applied rewrites44.1%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6444.1
Applied rewrites44.1%
if 4.5000000000000001e129 < z Initial program 79.9%
Taylor expanded in z around inf
lower--.f6419.1
Applied rewrites19.1%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ t 1.0)))) (if (<= z -8.0) t_1 (if (<= z 1.25e+78) (+ x (/ t (/ a y))) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / 1.0);
double tmp;
if (z <= -8.0) {
tmp = t_1;
} else if (z <= 1.25e+78) {
tmp = x + (t / (a / 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, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t / 1.0d0)
if (z <= (-8.0d0)) then
tmp = t_1
else if (z <= 1.25d+78) then
tmp = x + (t / (a / y))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / 1.0);
double tmp;
if (z <= -8.0) {
tmp = t_1;
} else if (z <= 1.25e+78) {
tmp = x + (t / (a / y));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t / 1.0) tmp = 0 if z <= -8.0: tmp = t_1 elif z <= 1.25e+78: tmp = x + (t / (a / y)) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t / 1.0)) tmp = 0.0 if (z <= -8.0) tmp = t_1; elseif (z <= 1.25e+78) tmp = Float64(x + Float64(t / Float64(a / y))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t / 1.0); tmp = 0.0; if (z <= -8.0) tmp = t_1; elseif (z <= 1.25e+78) tmp = x + (t / (a / y)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t / 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.0], t$95$1, If[LessEqual[z, 1.25e+78], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{t}{1}\\
\mathbf{if}\;z \leq -8:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 1.25 \cdot 10^{+78}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -8 or 1.24999999999999996e78 < z Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in z around inf
Applied rewrites33.3%
if -8 < z < 1.24999999999999996e78Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in z around 0
lower-/.f6440.7
Applied rewrites40.7%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (+ x (/ t 1.0)))) (if (<= z -8.0) t_1 (if (<= z 2.05e+77) (+ x (/ (* t y) a)) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / 1.0);
double tmp;
if (z <= -8.0) {
tmp = t_1;
} else if (z <= 2.05e+77) {
tmp = x + ((t * y) / a);
} 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, a)
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), intent (in) :: a
real(8) :: t_1
real(8) :: tmp
t_1 = x + (t / 1.0d0)
if (z <= (-8.0d0)) then
tmp = t_1
else if (z <= 2.05d+77) then
tmp = x + ((t * y) / a)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = x + (t / 1.0);
double tmp;
if (z <= -8.0) {
tmp = t_1;
} else if (z <= 2.05e+77) {
tmp = x + ((t * y) / a);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = x + (t / 1.0) tmp = 0 if z <= -8.0: tmp = t_1 elif z <= 2.05e+77: tmp = x + ((t * y) / a) else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(x + Float64(t / 1.0)) tmp = 0.0 if (z <= -8.0) tmp = t_1; elseif (z <= 2.05e+77) tmp = Float64(x + Float64(Float64(t * y) / a)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = x + (t / 1.0); tmp = 0.0; if (z <= -8.0) tmp = t_1; elseif (z <= 2.05e+77) tmp = x + ((t * y) / a); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(x + N[(t / 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -8.0], t$95$1, If[LessEqual[z, 2.05e+77], N[(x + N[(N[(t * y), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := x + \frac{t}{1}\\
\mathbf{if}\;z \leq -8:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 2.05 \cdot 10^{+77}:\\
\;\;\;\;x + \frac{t \cdot y}{a}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if z < -8 or 2.05e77 < z Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in z around inf
Applied rewrites33.3%
if -8 < z < 2.05e77Initial program 79.9%
Taylor expanded in z around 0
lower-/.f64N/A
lower-*.f64N/A
lower--.f6443.7
Applied rewrites43.7%
Taylor expanded in x around 0
lower-*.f6438.0
Applied rewrites38.0%
(FPCore (x y z t a) :precision binary64 (+ x (/ t 1.0)))
double code(double x, double y, double z, double t, double a) {
return x + (t / 1.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, a)
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), intent (in) :: a
code = x + (t / 1.0d0)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t / 1.0);
}
def code(x, y, z, t, a): return x + (t / 1.0)
function code(x, y, z, t, a) return Float64(x + Float64(t / 1.0)) end
function tmp = code(x, y, z, t, a) tmp = x + (t / 1.0); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t / 1.0), $MachinePrecision]), $MachinePrecision]
x + \frac{t}{1}
Initial program 79.9%
Taylor expanded in x around 0
Applied rewrites64.2%
lift-*.f64N/A
lift-/.f64N/A
associate-*r/N/A
frac-2negN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
div-flipN/A
metadata-evalN/A
lower-unsound-/.f64N/A
metadata-evalN/A
lower-unsound-/.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
lower-*.f6455.8
Applied rewrites55.8%
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-neg-frac2N/A
lift-/.f64N/A
div-flip-revN/A
lower-/.f64N/A
lift-/.f64N/A
distribute-neg-fracN/A
lift--.f64N/A
sub-negate-revN/A
lower-/.f64N/A
lower--.f6467.2
Applied rewrites67.2%
Taylor expanded in z around inf
Applied rewrites33.3%
(FPCore (x y z t a) :precision binary64 (+ x (- t x)))
double code(double x, double y, double z, double t, double a) {
return x + (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, a)
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), intent (in) :: a
code = x + (t - x)
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (t - x);
}
def code(x, y, z, t, a): return x + (t - x)
function code(x, y, z, t, a) return Float64(x + Float64(t - x)) end
function tmp = code(x, y, z, t, a) tmp = x + (t - x); end
code[x_, y_, z_, t_, a_] := N[(x + N[(t - x), $MachinePrecision]), $MachinePrecision]
x + \left(t - x\right)
Initial program 79.9%
Taylor expanded in z around inf
lower--.f6419.1
Applied rewrites19.1%
(FPCore (x y z t a) :precision binary64 (+ (- x) x))
double code(double x, double y, double z, double t, double a) {
return -x + 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, a)
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), intent (in) :: a
code = -x + x
end function
public static double code(double x, double y, double z, double t, double a) {
return -x + x;
}
def code(x, y, z, t, a): return -x + x
function code(x, y, z, t, a) return Float64(Float64(-x) + x) end
function tmp = code(x, y, z, t, a) tmp = -x + x; end
code[x_, y_, z_, t_, a_] := N[((-x) + x), $MachinePrecision]
\left(-x\right) + x
Initial program 79.9%
Taylor expanded in z around inf
lower--.f6419.1
Applied rewrites19.1%
Taylor expanded in x around inf
lower-*.f642.8
Applied rewrites2.8%
lift-+.f64N/A
+-commutativeN/A
lower-+.f642.8
lift-*.f64N/A
mul-1-negN/A
lower-neg.f642.8
Applied rewrites2.8%
herbie shell --seed 2025172
(FPCore (x y z t a)
:name "Numeric.Signal:interpolate from hsignal-0.2.7.1"
:precision binary64
(+ x (* (- y z) (/ (- t x) (- a z)))))