
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
(FPCore (x y z t) :precision binary64 (if (<= z -5e+123) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))) (- x (/ (- y (/ t y)) (* 3.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+123) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5d+123)) then
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
else
tmp = x - ((y - (t / y)) / (3.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+123) {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5e+123: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) else: tmp = x - ((y - (t / y)) / (3.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5e+123) tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5e+123) tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); else tmp = x - ((y - (t / y)) / (3.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e+123], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+123}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\end{array}
if z < -4.9999999999999997e123Initial program 95.7%
if -4.9999999999999997e123 < z Initial program 95.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
(FPCore (x y z t) :precision binary64 (if (<= z -5e+123) (+ (- x (* (/ 0.3333333333333333 z) y)) (/ t (* (* z 3.0) y))) (- x (/ (- y (/ t y)) (* 3.0 z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+123) {
tmp = (x - ((0.3333333333333333 / z) * y)) + (t / ((z * 3.0) * y));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= (-5d+123)) then
tmp = (x - ((0.3333333333333333d0 / z) * y)) + (t / ((z * 3.0d0) * y))
else
tmp = x - ((y - (t / y)) / (3.0d0 * z))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5e+123) {
tmp = (x - ((0.3333333333333333 / z) * y)) + (t / ((z * 3.0) * y));
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5e+123: tmp = (x - ((0.3333333333333333 / z) * y)) + (t / ((z * 3.0) * y)) else: tmp = x - ((y - (t / y)) / (3.0 * z)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5e+123) tmp = Float64(Float64(x - Float64(Float64(0.3333333333333333 / z) * y)) + Float64(t / Float64(Float64(z * 3.0) * y))); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5e+123) tmp = (x - ((0.3333333333333333 / z) * y)) + (t / ((z * 3.0) * y)); else tmp = x - ((y - (t / y)) / (3.0 * z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5e+123], N[(N[(x - N[(N[(0.3333333333333333 / z), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq -5 \cdot 10^{+123}:\\
\;\;\;\;\left(x - \frac{0.3333333333333333}{z} \cdot y\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\end{array}
if z < -4.9999999999999997e123Initial program 95.7%
lift-/.f64N/A
mult-flipN/A
*-commutativeN/A
lower-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
metadata-eval95.7%
Applied rewrites95.7%
if -4.9999999999999997e123 < z Initial program 95.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
(FPCore (x y z t) :precision binary64 (- x (/ (- y (/ t y)) (* 3.0 z))))
double code(double x, double y, double z, double t) {
return x - ((y - (t / y)) / (3.0 * z));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = x - ((y - (t / y)) / (3.0d0 * z))
end function
public static double code(double x, double y, double z, double t) {
return x - ((y - (t / y)) / (3.0 * z));
}
def code(x, y, z, t): return x - ((y - (t / y)) / (3.0 * z))
function code(x, y, z, t) return Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))) end
function tmp = code(x, y, z, t) tmp = x - ((y - (t / y)) / (3.0 * z)); end
code[x_, y_, z_, t_] := N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \frac{y - \frac{t}{y}}{3 \cdot z}
Initial program 95.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ y (* -3.0 z)) x)))
(if (<= y -5e+126)
t_1
(if (<= y 8e+105) (- x (/ (- (* y y) t) (* (* z y) 3.0))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -5e+126) {
tmp = t_1;
} else if (y <= 8e+105) {
tmp = x - (((y * y) - t) / ((z * y) * 3.0));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y / ((-3.0d0) * z)) + x
if (y <= (-5d+126)) then
tmp = t_1
else if (y <= 8d+105) then
tmp = x - (((y * y) - t) / ((z * y) * 3.0d0))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -5e+126) {
tmp = t_1;
} else if (y <= 8e+105) {
tmp = x - (((y * y) - t) / ((z * y) * 3.0));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / (-3.0 * z)) + x tmp = 0 if y <= -5e+126: tmp = t_1 elif y <= 8e+105: tmp = x - (((y * y) - t) / ((z * y) * 3.0)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / Float64(-3.0 * z)) + x) tmp = 0.0 if (y <= -5e+126) tmp = t_1; elseif (y <= 8e+105) tmp = Float64(x - Float64(Float64(Float64(y * y) - t) / Float64(Float64(z * y) * 3.0))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / (-3.0 * z)) + x; tmp = 0.0; if (y <= -5e+126) tmp = t_1; elseif (y <= 8e+105) tmp = x - (((y * y) - t) / ((z * y) * 3.0)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / N[(-3.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -5e+126], t$95$1, If[LessEqual[y, 8e+105], N[(x - N[(N[(N[(y * y), $MachinePrecision] - t), $MachinePrecision] / N[(N[(z * y), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y}{-3 \cdot z} + x\\
\mathbf{if}\;y \leq -5 \cdot 10^{+126}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 8 \cdot 10^{+105}:\\
\;\;\;\;x - \frac{y \cdot y - t}{\left(z \cdot y\right) \cdot 3}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -4.9999999999999998e126 or 7.9999999999999995e105 < y Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
*-commutativeN/A
mult-flipN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
sub-to-fractionN/A
Applied rewrites64.4%
if -4.9999999999999998e126 < y < 7.9999999999999995e105Initial program 95.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
lift-/.f64N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
associate-/l/N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
lift-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f6480.1%
lift-*.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
associate-*r*N/A
lift-*.f64N/A
lower-*.f6480.1%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6480.1%
Applied rewrites80.1%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ y (* -3.0 z)) x)))
(if (<= y -3.6e-41)
t_1
(if (<= y 2.25e-14)
(- x (* -0.3333333333333333 (/ t (* y z))))
t_1))))double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -3.6e-41) {
tmp = t_1;
} else if (y <= 2.25e-14) {
tmp = x - (-0.3333333333333333 * (t / (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y / ((-3.0d0) * z)) + x
if (y <= (-3.6d-41)) then
tmp = t_1
else if (y <= 2.25d-14) then
tmp = x - ((-0.3333333333333333d0) * (t / (y * z)))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -3.6e-41) {
tmp = t_1;
} else if (y <= 2.25e-14) {
tmp = x - (-0.3333333333333333 * (t / (y * z)));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / (-3.0 * z)) + x tmp = 0 if y <= -3.6e-41: tmp = t_1 elif y <= 2.25e-14: tmp = x - (-0.3333333333333333 * (t / (y * z))) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / Float64(-3.0 * z)) + x) tmp = 0.0 if (y <= -3.6e-41) tmp = t_1; elseif (y <= 2.25e-14) tmp = Float64(x - Float64(-0.3333333333333333 * Float64(t / Float64(y * z)))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / (-3.0 * z)) + x; tmp = 0.0; if (y <= -3.6e-41) tmp = t_1; elseif (y <= 2.25e-14) tmp = x - (-0.3333333333333333 * (t / (y * z))); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / N[(-3.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -3.6e-41], t$95$1, If[LessEqual[y, 2.25e-14], N[(x - N[(-0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y}{-3 \cdot z} + x\\
\mathbf{if}\;y \leq -3.6 \cdot 10^{-41}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.25 \cdot 10^{-14}:\\
\;\;\;\;x - -0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -3.6000000000000001e-41 or 2.2499999999999999e-14 < y Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
*-commutativeN/A
mult-flipN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
sub-to-fractionN/A
Applied rewrites64.4%
if -3.6000000000000001e-41 < y < 2.2499999999999999e-14Initial program 95.7%
lift-+.f64N/A
lift--.f64N/A
associate-+l-N/A
lower--.f64N/A
lift-/.f64N/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
sub-divN/A
lower-/.f64N/A
lower--.f64N/A
lower-/.f6495.7%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6495.7%
Applied rewrites95.7%
Taylor expanded in y around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6462.3%
Applied rewrites62.3%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ y (* -3.0 z)) x)))
(if (<= y -9.5e-46)
t_1
(if (<= y 3.5e-35) (/ t (* (* 3.0 y) z)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -9.5e-46) {
tmp = t_1;
} else if (y <= 3.5e-35) {
tmp = t / ((3.0 * y) * z);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y / ((-3.0d0) * z)) + x
if (y <= (-9.5d-46)) then
tmp = t_1
else if (y <= 3.5d-35) then
tmp = t / ((3.0d0 * y) * z)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -9.5e-46) {
tmp = t_1;
} else if (y <= 3.5e-35) {
tmp = t / ((3.0 * y) * z);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / (-3.0 * z)) + x tmp = 0 if y <= -9.5e-46: tmp = t_1 elif y <= 3.5e-35: tmp = t / ((3.0 * y) * z) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / Float64(-3.0 * z)) + x) tmp = 0.0 if (y <= -9.5e-46) tmp = t_1; elseif (y <= 3.5e-35) tmp = Float64(t / Float64(Float64(3.0 * y) * z)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / (-3.0 * z)) + x; tmp = 0.0; if (y <= -9.5e-46) tmp = t_1; elseif (y <= 3.5e-35) tmp = t / ((3.0 * y) * z); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / N[(-3.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -9.5e-46], t$95$1, If[LessEqual[y, 3.5e-35], N[(t / N[(N[(3.0 * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y}{-3 \cdot z} + x\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{t}{\left(3 \cdot y\right) \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -9.4999999999999999e-46 or 3.5e-35 < y Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
*-commutativeN/A
mult-flipN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
sub-to-fractionN/A
Applied rewrites64.4%
if -9.4999999999999999e-46 < y < 3.5e-35Initial program 95.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6460.8%
Applied rewrites60.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.1%
Applied rewrites35.1%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
metadata-evalN/A
frac-timesN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
associate-*r/N/A
mult-flipN/A
lower-/.f64N/A
*-commutativeN/A
*-commutativeN/A
associate-*r*N/A
lower-*.f64N/A
*-commutativeN/A
lower-*.f6435.2%
Applied rewrites35.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ (/ y (* -3.0 z)) x)))
(if (<= y -9.5e-46)
t_1
(if (<= y 3.5e-35) (* 0.3333333333333333 (/ t (* y z))) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -9.5e-46) {
tmp = t_1;
} else if (y <= 3.5e-35) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (y / ((-3.0d0) * z)) + x
if (y <= (-9.5d-46)) then
tmp = t_1
else if (y <= 3.5d-35) then
tmp = 0.3333333333333333d0 * (t / (y * z))
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (y / (-3.0 * z)) + x;
double tmp;
if (y <= -9.5e-46) {
tmp = t_1;
} else if (y <= 3.5e-35) {
tmp = 0.3333333333333333 * (t / (y * z));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (y / (-3.0 * z)) + x tmp = 0 if y <= -9.5e-46: tmp = t_1 elif y <= 3.5e-35: tmp = 0.3333333333333333 * (t / (y * z)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(y / Float64(-3.0 * z)) + x) tmp = 0.0 if (y <= -9.5e-46) tmp = t_1; elseif (y <= 3.5e-35) tmp = Float64(0.3333333333333333 * Float64(t / Float64(y * z))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (y / (-3.0 * z)) + x; tmp = 0.0; if (y <= -9.5e-46) tmp = t_1; elseif (y <= 3.5e-35) tmp = 0.3333333333333333 * (t / (y * z)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(y / N[(-3.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]}, If[LessEqual[y, -9.5e-46], t$95$1, If[LessEqual[y, 3.5e-35], N[(0.3333333333333333 * N[(t / N[(y * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{y}{-3 \cdot z} + x\\
\mathbf{if}\;y \leq -9.5 \cdot 10^{-46}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-35}:\\
\;\;\;\;0.3333333333333333 \cdot \frac{t}{y \cdot z}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -9.4999999999999999e-46 or 3.5e-35 < y Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
*-commutativeN/A
mult-flipN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
sub-to-fractionN/A
Applied rewrites64.4%
if -9.4999999999999999e-46 < y < 3.5e-35Initial program 95.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6460.8%
Applied rewrites60.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6435.1%
Applied rewrites35.1%
(FPCore (x y z t) :precision binary64 (+ (/ y (* -3.0 z)) x))
double code(double x, double y, double z, double t) {
return (y / (-3.0 * z)) + x;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y / ((-3.0d0) * z)) + x
end function
public static double code(double x, double y, double z, double t) {
return (y / (-3.0 * z)) + x;
}
def code(x, y, z, t): return (y / (-3.0 * z)) + x
function code(x, y, z, t) return Float64(Float64(y / Float64(-3.0 * z)) + x) end
function tmp = code(x, y, z, t) tmp = (y / (-3.0 * z)) + x; end
code[x_, y_, z_, t_] := N[(N[(y / N[(-3.0 * z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\frac{y}{-3 \cdot z} + x
Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
lift-*.f64N/A
*-commutativeN/A
lift-/.f64N/A
mult-flipN/A
lift--.f64N/A
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
*-commutativeN/A
associate-*l*N/A
metadata-evalN/A
frac-timesN/A
metadata-evalN/A
*-commutativeN/A
mult-flipN/A
*-commutativeN/A
*-commutativeN/A
*-commutativeN/A
sub-to-fractionN/A
Applied rewrites64.4%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (* -0.3333333333333333 y) z)))
(if (<= y -2.3e+52)
t_1
(if (<= y 3.9e+112) (* 0.3333333333333333 (* 3.0 x)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = (-0.3333333333333333 * y) / z;
double tmp;
if (y <= -2.3e+52) {
tmp = t_1;
} else if (y <= 3.9e+112) {
tmp = 0.3333333333333333 * (3.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = ((-0.3333333333333333d0) * y) / z
if (y <= (-2.3d+52)) then
tmp = t_1
else if (y <= 3.9d+112) then
tmp = 0.3333333333333333d0 * (3.0d0 * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (-0.3333333333333333 * y) / z;
double tmp;
if (y <= -2.3e+52) {
tmp = t_1;
} else if (y <= 3.9e+112) {
tmp = 0.3333333333333333 * (3.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (-0.3333333333333333 * y) / z tmp = 0 if y <= -2.3e+52: tmp = t_1 elif y <= 3.9e+112: tmp = 0.3333333333333333 * (3.0 * x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(-0.3333333333333333 * y) / z) tmp = 0.0 if (y <= -2.3e+52) tmp = t_1; elseif (y <= 3.9e+112) tmp = Float64(0.3333333333333333 * Float64(3.0 * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (-0.3333333333333333 * y) / z; tmp = 0.0; if (y <= -2.3e+52) tmp = t_1; elseif (y <= 3.9e+112) tmp = 0.3333333333333333 * (3.0 * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(-0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]}, If[LessEqual[y, -2.3e+52], t$95$1, If[LessEqual[y, 3.9e+112], N[(0.3333333333333333 * N[(3.0 * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := \frac{-0.3333333333333333 \cdot y}{z}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+112}:\\
\;\;\;\;0.3333333333333333 \cdot \left(3 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.3e52 or 3.8999999999999997e112 < y Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
Taylor expanded in z around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-*.f6453.8%
Applied rewrites53.8%
Taylor expanded in x around 0
lower-*.f6436.6%
Applied rewrites36.6%
if -2.3e52 < y < 3.8999999999999997e112Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
Taylor expanded in x around inf
lower-*.f6429.6%
Applied rewrites29.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (* -0.3333333333333333 (/ y z))))
(if (<= y -2.3e+52)
t_1
(if (<= y 3.9e+112) (* 0.3333333333333333 (* 3.0 x)) t_1))))double code(double x, double y, double z, double t) {
double t_1 = -0.3333333333333333 * (y / z);
double tmp;
if (y <= -2.3e+52) {
tmp = t_1;
} else if (y <= 3.9e+112) {
tmp = 0.3333333333333333 * (3.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: tmp
t_1 = (-0.3333333333333333d0) * (y / z)
if (y <= (-2.3d+52)) then
tmp = t_1
else if (y <= 3.9d+112) then
tmp = 0.3333333333333333d0 * (3.0d0 * x)
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = -0.3333333333333333 * (y / z);
double tmp;
if (y <= -2.3e+52) {
tmp = t_1;
} else if (y <= 3.9e+112) {
tmp = 0.3333333333333333 * (3.0 * x);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = -0.3333333333333333 * (y / z) tmp = 0 if y <= -2.3e+52: tmp = t_1 elif y <= 3.9e+112: tmp = 0.3333333333333333 * (3.0 * x) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(-0.3333333333333333 * Float64(y / z)) tmp = 0.0 if (y <= -2.3e+52) tmp = t_1; elseif (y <= 3.9e+112) tmp = Float64(0.3333333333333333 * Float64(3.0 * x)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = -0.3333333333333333 * (y / z); tmp = 0.0; if (y <= -2.3e+52) tmp = t_1; elseif (y <= 3.9e+112) tmp = 0.3333333333333333 * (3.0 * x); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(-0.3333333333333333 * N[(y / z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2.3e+52], t$95$1, If[LessEqual[y, 3.9e+112], N[(0.3333333333333333 * N[(3.0 * x), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
t_1 := -0.3333333333333333 \cdot \frac{y}{z}\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{+52}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.9 \cdot 10^{+112}:\\
\;\;\;\;0.3333333333333333 \cdot \left(3 \cdot x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
if y < -2.3e52 or 3.8999999999999997e112 < y Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6436.5%
Applied rewrites36.5%
if -2.3e52 < y < 3.8999999999999997e112Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
Taylor expanded in x around inf
lower-*.f6429.6%
Applied rewrites29.6%
(FPCore (x y z t) :precision binary64 (if (<= z 5.5e-33) (/ (* x y) y) (* 0.3333333333333333 (* 3.0 x))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.5e-33) {
tmp = (x * y) / y;
} else {
tmp = 0.3333333333333333 * (3.0 * x);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (z <= 5.5d-33) then
tmp = (x * y) / y
else
tmp = 0.3333333333333333d0 * (3.0d0 * x)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 5.5e-33) {
tmp = (x * y) / y;
} else {
tmp = 0.3333333333333333 * (3.0 * x);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 5.5e-33: tmp = (x * y) / y else: tmp = 0.3333333333333333 * (3.0 * x) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 5.5e-33) tmp = Float64(Float64(x * y) / y); else tmp = Float64(0.3333333333333333 * Float64(3.0 * x)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 5.5e-33) tmp = (x * y) / y; else tmp = 0.3333333333333333 * (3.0 * x); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 5.5e-33], N[(N[(x * y), $MachinePrecision] / y), $MachinePrecision], N[(0.3333333333333333 * N[(3.0 * x), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\mathbf{if}\;z \leq 5.5 \cdot 10^{-33}:\\
\;\;\;\;\frac{x \cdot y}{y}\\
\mathbf{else}:\\
\;\;\;\;0.3333333333333333 \cdot \left(3 \cdot x\right)\\
\end{array}
if z < 5.5e-33Initial program 95.7%
Taylor expanded in y around 0
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower-*.f6460.8%
Applied rewrites60.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-/.f6438.4%
Applied rewrites38.4%
Taylor expanded in x around inf
lower-*.f6425.5%
Applied rewrites25.5%
if 5.5e-33 < z Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
Taylor expanded in x around inf
lower-*.f6429.6%
Applied rewrites29.6%
(FPCore (x y z t) :precision binary64 (* 0.3333333333333333 (* 3.0 x)))
double code(double x, double y, double z, double t) {
return 0.3333333333333333 * (3.0 * x);
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 0.3333333333333333d0 * (3.0d0 * x)
end function
public static double code(double x, double y, double z, double t) {
return 0.3333333333333333 * (3.0 * x);
}
def code(x, y, z, t): return 0.3333333333333333 * (3.0 * x)
function code(x, y, z, t) return Float64(0.3333333333333333 * Float64(3.0 * x)) end
function tmp = code(x, y, z, t) tmp = 0.3333333333333333 * (3.0 * x); end
code[x_, y_, z_, t_] := N[(0.3333333333333333 * N[(3.0 * x), $MachinePrecision]), $MachinePrecision]
0.3333333333333333 \cdot \left(3 \cdot x\right)
Initial program 95.7%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lift--.f64N/A
lift-/.f64N/A
sub-to-fractionN/A
div-add-revN/A
lower-/.f64N/A
lower-+.f64N/A
lower-/.f64N/A
lower--.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
lift-*.f64N/A
*-commutativeN/A
lower-*.f6485.3%
Applied rewrites85.3%
Taylor expanded in t around 0
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower-*.f6453.5%
Applied rewrites53.5%
Taylor expanded in x around inf
lower-*.f6429.6%
Applied rewrites29.6%
herbie shell --seed 2025258
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))