
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Herbie found 13 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
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) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 97.9%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (fma (/ (- t) (- z a)) y x)))
(if (<= t_1 -20000000000000.0)
t_2
(if (<= t_1 2e-5)
(fma (/ (- z t) (- a)) y x)
(if (<= t_1 1.5) (fma y (/ (- z t) z) x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = fma((-t / (z - a)), y, x);
double tmp;
if (t_1 <= -20000000000000.0) {
tmp = t_2;
} else if (t_1 <= 2e-5) {
tmp = fma(((z - t) / -a), y, x);
} else if (t_1 <= 1.5) {
tmp = fma(y, ((z - t) / z), x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = fma(Float64(Float64(-t) / Float64(z - a)), y, x) tmp = 0.0 if (t_1 <= -20000000000000.0) tmp = t_2; elseif (t_1 <= 2e-5) tmp = fma(Float64(Float64(z - t) / Float64(-a)), y, x); elseif (t_1 <= 1.5) tmp = fma(y, Float64(Float64(z - t) / z), x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-t) / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000000000.0], t$95$2, If[LessEqual[t$95$1, 2e-5], N[(N[(N[(z - t), $MachinePrecision] / (-a)), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.5], N[(y * N[(N[(z - t), $MachinePrecision] / z), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \mathsf{fma}\left(\frac{-t}{z - a}, y, x\right)\\
\mathbf{if}\;t\_1 \leq -20000000000000:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{-5}:\\
\;\;\;\;\mathsf{fma}\left(\frac{z - t}{-a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1.5:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z - t}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e13 or 1.5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.9%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
Applied rewrites76.7%
if -2e13 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.00000000000000016e-5Initial program 97.9%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6460.9
Applied rewrites60.9%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6460.9
Applied rewrites60.9%
if 2.00000000000000016e-5 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.5Initial program 97.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6466.4
Applied rewrites66.4%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (fma (/ (- t) (- z a)) y x))) (if (<= t_1 -1e-160) t_2 (if (<= t_1 1.5) (fma y (/ z (- z a)) x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = fma((-t / (z - a)), y, x);
double tmp;
if (t_1 <= -1e-160) {
tmp = t_2;
} else if (t_1 <= 1.5) {
tmp = fma(y, (z / (z - a)), x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = fma(Float64(Float64(-t) / Float64(z - a)), y, x) tmp = 0.0 if (t_1 <= -1e-160) tmp = t_2; elseif (t_1 <= 1.5) tmp = fma(y, Float64(z / Float64(z - a)), x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[((-t) / N[(z - a), $MachinePrecision]), $MachinePrecision] * y + x), $MachinePrecision]}, If[LessEqual[t$95$1, -1e-160], t$95$2, If[LessEqual[t$95$1, 1.5], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \mathsf{fma}\left(\frac{-t}{z - a}, y, x\right)\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{-160}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1.5:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -9.9999999999999999e-161 or 1.5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.9%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6476.7
Applied rewrites76.7%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6476.7
Applied rewrites76.7%
if -9.9999999999999999e-161 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.5Initial program 97.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.6
Applied rewrites71.6%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (* y (/ (- z t) (- z a))))) (if (<= t_1 -5e+51) t_1 (if (<= t_1 1e+119) (fma y (/ z (- z a)) x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if (t_1 <= -5e+51) {
tmp = t_1;
} else if (t_1 <= 1e+119) {
tmp = fma(y, (z / (z - a)), x);
} else {
tmp = t_1;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a))) tmp = 0.0 if (t_1 <= -5e+51) tmp = t_1; elseif (t_1 <= 1e+119) tmp = fma(y, Float64(z / Float64(z - a)), x); else tmp = t_1; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+51], t$95$1, If[LessEqual[t$95$1, 1e+119], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+51}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_1 \leq 10^{+119}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < -5e51 or 9.99999999999999944e118 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 97.9%
Taylor expanded in t around inf
*-commutativeN/A
lower-*.f64N/A
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f64N/A
lift--.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lift--.f6485.9
Applied rewrites85.9%
Taylor expanded in y around inf
sub-divN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lift--.f6448.7
Applied rewrites48.7%
if -5e51 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 9.99999999999999944e118Initial program 97.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.6
Applied rewrites71.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (- t) (/ y (- z a)))))
(if (<= t_1 -5e+138)
t_2
(if (<= t_1 -20000000000000.0)
(fma y (/ (- t) z) x)
(if (<= t_1 5e-27)
(fma (/ t a) y x)
(if (<= t_1 2e+71) (+ y x) t_2))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = -t * (y / (z - a));
double tmp;
if (t_1 <= -5e+138) {
tmp = t_2;
} else if (t_1 <= -20000000000000.0) {
tmp = fma(y, (-t / z), x);
} else if (t_1 <= 5e-27) {
tmp = fma((t / a), y, x);
} else if (t_1 <= 2e+71) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(-t) * Float64(y / Float64(z - a))) tmp = 0.0 if (t_1 <= -5e+138) tmp = t_2; elseif (t_1 <= -20000000000000.0) tmp = fma(y, Float64(Float64(-t) / z), x); elseif (t_1 <= 5e-27) tmp = fma(Float64(t / a), y, x); elseif (t_1 <= 2e+71) tmp = Float64(y + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+138], t$95$2, If[LessEqual[t$95$1, -20000000000000.0], N[(y * N[((-t) / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-27], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+71], N[(y + x), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \left(-t\right) \cdot \frac{y}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -20000000000000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-t}{z}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+71}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5.00000000000000016e138 or 2.0000000000000001e71 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.9%
Taylor expanded in t around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6426.3
Applied rewrites26.3%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.4
Applied rewrites28.4%
if -5.00000000000000016e138 < (/.f64 (-.f64 z t) (-.f64 z a)) < -2e13Initial program 97.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6466.4
Applied rewrites66.4%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6452.3
Applied rewrites52.3%
if -2e13 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000002e-27Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6462.0
Applied rewrites62.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.0
Applied rewrites62.0%
if 5.0000000000000002e-27 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e71Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))) (t_2 (* (- t) (/ y (- z a)))))
(if (<= t_1 -5e+138)
t_2
(if (<= t_1 -100000000.0)
(fma y (/ (- t) z) x)
(if (<= t_1 2e+71) (fma y (/ z (- z a)) x) t_2)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = -t * (y / (z - a));
double tmp;
if (t_1 <= -5e+138) {
tmp = t_2;
} else if (t_1 <= -100000000.0) {
tmp = fma(y, (-t / z), x);
} else if (t_1 <= 2e+71) {
tmp = fma(y, (z / (z - a)), x);
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = Float64(Float64(-t) * Float64(y / Float64(z - a))) tmp = 0.0 if (t_1 <= -5e+138) tmp = t_2; elseif (t_1 <= -100000000.0) tmp = fma(y, Float64(Float64(-t) / z), x); elseif (t_1 <= 2e+71) tmp = fma(y, Float64(z / Float64(z - a)), x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[((-t) * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -5e+138], t$95$2, If[LessEqual[t$95$1, -100000000.0], N[(y * N[((-t) / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 2e+71], N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], t$95$2]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \left(-t\right) \cdot \frac{y}{z - a}\\
\mathbf{if}\;t\_1 \leq -5 \cdot 10^{+138}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq -100000000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-t}{z}, x\right)\\
\mathbf{elif}\;t\_1 \leq 2 \cdot 10^{+71}:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{z}{z - a}, x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -5.00000000000000016e138 or 2.0000000000000001e71 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.9%
Taylor expanded in t around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6426.3
Applied rewrites26.3%
lift--.f64N/A
lift-/.f64N/A
lift-*.f64N/A
associate-/l*N/A
lower-*.f64N/A
lower-/.f64N/A
lift--.f6428.4
Applied rewrites28.4%
if -5.00000000000000016e138 < (/.f64 (-.f64 z t) (-.f64 z a)) < -1e8Initial program 97.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6466.4
Applied rewrites66.4%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6452.3
Applied rewrites52.3%
if -1e8 < (/.f64 (-.f64 z t) (-.f64 z a)) < 2.0000000000000001e71Initial program 97.9%
Taylor expanded in t around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6471.6
Applied rewrites71.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 -20000000000000.0)
(fma y (/ (- t) z) x)
(if (<= t_1 5e-27)
(fma (/ t a) y x)
(if (<= t_1 1.5) (+ y x) (fma t (/ y a) x))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= -20000000000000.0) {
tmp = fma(y, (-t / z), x);
} else if (t_1 <= 5e-27) {
tmp = fma((t / a), y, x);
} else if (t_1 <= 1.5) {
tmp = y + x;
} else {
tmp = fma(t, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= -20000000000000.0) tmp = fma(y, Float64(Float64(-t) / z), x); elseif (t_1 <= 5e-27) tmp = fma(Float64(t / a), y, x); elseif (t_1 <= 1.5) tmp = Float64(y + x); else tmp = fma(t, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, -20000000000000.0], N[(y * N[((-t) / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e-27], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.5], N[(y + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -20000000000000:\\
\;\;\;\;\mathsf{fma}\left(y, \frac{-t}{z}, x\right)\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1.5:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < -2e13Initial program 97.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6466.4
Applied rewrites66.4%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f6452.3
Applied rewrites52.3%
if -2e13 < (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000002e-27Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6462.0
Applied rewrites62.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.0
Applied rewrites62.0%
if 5.0000000000000002e-27 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.5Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
if 1.5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6462.5
Applied rewrites62.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (- z t) (- z a))))
(if (<= t_1 5e-27)
(fma (/ t a) y x)
(if (<= t_1 1.5) (+ y x) (fma t (/ y a) x)))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 5e-27) {
tmp = fma((t / a), y, x);
} else if (t_1 <= 1.5) {
tmp = y + x;
} else {
tmp = fma(t, (y / a), x);
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 5e-27) tmp = fma(Float64(t / a), y, x); elseif (t_1 <= 1.5) tmp = Float64(y + x); else tmp = fma(t, Float64(y / a), x); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-27], N[(N[(t / a), $MachinePrecision] * y + x), $MachinePrecision], If[LessEqual[t$95$1, 1.5], N[(y + x), $MachinePrecision], N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-27}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{a}, y, x\right)\\
\mathbf{elif}\;t\_1 \leq 1.5:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000002e-27Initial program 97.9%
Taylor expanded in z around 0
lower-/.f6462.0
Applied rewrites62.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6462.0
Applied rewrites62.0%
if 5.0000000000000002e-27 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.5Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
if 1.5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6462.5
Applied rewrites62.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a))) (t_2 (fma t (/ y a) x))) (if (<= t_1 5e-27) t_2 (if (<= t_1 1.5) (+ y x) t_2))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double t_2 = fma(t, (y / a), x);
double tmp;
if (t_1 <= 5e-27) {
tmp = t_2;
} else if (t_1 <= 1.5) {
tmp = y + x;
} else {
tmp = t_2;
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) t_2 = fma(t, Float64(y / a), x) tmp = 0.0 if (t_1 <= 5e-27) tmp = t_2; elseif (t_1 <= 1.5) tmp = Float64(y + x); else tmp = t_2; end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(t * N[(y / a), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[t$95$1, 5e-27], t$95$2, If[LessEqual[t$95$1, 1.5], N[(y + x), $MachinePrecision], t$95$2]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
t_2 := \mathsf{fma}\left(t, \frac{y}{a}, x\right)\\
\mathbf{if}\;t\_1 \leq 5 \cdot 10^{-27}:\\
\;\;\;\;t\_2\\
\mathbf{elif}\;t\_1 \leq 1.5:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_2\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 5.0000000000000002e-27 or 1.5 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 97.9%
Taylor expanded in z around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f6462.5
Applied rewrites62.5%
if 5.0000000000000002e-27 < (/.f64 (-.f64 z t) (-.f64 z a)) < 1.5Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (* y (/ (- z t) (- z a)))))
(if (<= t_1 (- INFINITY))
(/ (* y t) a)
(if (<= t_1 5e+292) (+ y x) (- (/ (* t y) z))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y * t) / a;
} else if (t_1 <= 5e+292) {
tmp = y + x;
} else {
tmp = -((t * y) / z);
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = y * ((z - t) / (z - a));
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y * t) / a;
} else if (t_1 <= 5e+292) {
tmp = y + x;
} else {
tmp = -((t * y) / z);
}
return tmp;
}
def code(x, y, z, t, a): t_1 = y * ((z - t) / (z - a)) tmp = 0 if t_1 <= -math.inf: tmp = (y * t) / a elif t_1 <= 5e+292: tmp = y + x else: tmp = -((t * y) / z) return tmp
function code(x, y, z, t, a) t_1 = Float64(y * Float64(Float64(z - t) / Float64(z - a))) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y * t) / a); elseif (t_1 <= 5e+292) tmp = Float64(y + x); else tmp = Float64(-Float64(Float64(t * y) / z)); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = y * ((z - t) / (z - a)); tmp = 0.0; if (t_1 <= -Inf) tmp = (y * t) / a; elseif (t_1 <= 5e+292) tmp = y + x; else tmp = -((t * y) / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision], If[LessEqual[t$95$1, 5e+292], N[(y + x), $MachinePrecision], (-N[(N[(t * y), $MachinePrecision] / z), $MachinePrecision])]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y \cdot t}{a}\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+292}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;-\frac{t \cdot y}{z}\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < -inf.0Initial program 97.9%
Taylor expanded in t around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6426.3
Applied rewrites26.3%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6418.7
Applied rewrites18.7%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 4.9999999999999996e292Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
if 4.9999999999999996e292 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 97.9%
Taylor expanded in a around 0
+-commutativeN/A
associate-/l*N/A
lower-fma.f64N/A
lower-/.f64N/A
lift--.f6466.4
Applied rewrites66.4%
Taylor expanded in z around 0
mul-1-negN/A
lower-neg.f64N/A
lower-/.f64N/A
lower-*.f6414.5
Applied rewrites14.5%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (* y t) a)) (t_2 (* y (/ (- z t) (- z a))))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 5e+293) (+ y x) t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / a;
double t_2 = y * ((z - t) / (z - a));
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 5e+293) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * t) / a;
double t_2 = y * ((z - t) / (z - a));
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 5e+293) {
tmp = y + x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * t) / a t_2 = y * ((z - t) / (z - a)) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 5e+293: tmp = y + x else: tmp = t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * t) / a) t_2 = Float64(y * Float64(Float64(z - t) / Float64(z - a))) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 5e+293) tmp = Float64(y + x); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * t) / a; t_2 = y * ((z - t) / (z - a)); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 5e+293) tmp = y + x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]}, Block[{t$95$2 = N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 5e+293], N[(y + x), $MachinePrecision], t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot t}{a}\\
t_2 := y \cdot \frac{z - t}{z - a}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+293}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < -inf.0 or 5.00000000000000033e293 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) Initial program 97.9%
Taylor expanded in t around inf
associate-*r/N/A
lower-/.f64N/A
associate-*r*N/A
lower-*.f64N/A
mul-1-negN/A
lower-neg.f64N/A
lift--.f6426.3
Applied rewrites26.3%
Taylor expanded in z around 0
lower-/.f64N/A
*-commutativeN/A
lower-*.f6418.7
Applied rewrites18.7%
if -inf.0 < (*.f64 y (/.f64 (-.f64 z t) (-.f64 z a))) < 5.00000000000000033e293Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
(FPCore (x y z t a) :precision binary64 y)
double code(double x, double y, double z, double t, double a) {
return y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t, 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 = y
end function
public static double code(double x, double y, double z, double t, double a) {
return y;
}
def code(x, y, z, t, a): return y
function code(x, y, z, t, a) return y end
function tmp = code(x, y, z, t, a) tmp = y; end
code[x_, y_, z_, t_, a_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 97.9%
Taylor expanded in z around inf
+-commutativeN/A
lower-+.f6460.5
Applied rewrites60.5%
Taylor expanded in x around 0
Applied rewrites18.2%
herbie shell --seed 2025142
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
(+ x (* y (/ (- z t) (- z a)))))