
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6) (- (/ 2 3) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6), $MachinePrecision] * N[(N[(2 / 3), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
Herbie found 12 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (+ x (* (* (- y x) 6) (- (/ 2 3) z))))
double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + (((y - x) * 6.0d0) * ((2.0d0 / 3.0d0) - z))
end function
public static double code(double x, double y, double z) {
return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z));
}
def code(x, y, z): return x + (((y - x) * 6.0) * ((2.0 / 3.0) - z))
function code(x, y, z) return Float64(x + Float64(Float64(Float64(y - x) * 6.0) * Float64(Float64(2.0 / 3.0) - z))) end
function tmp = code(x, y, z) tmp = x + (((y - x) * 6.0) * ((2.0 / 3.0) - z)); end
code[x_, y_, z_] := N[(x + N[(N[(N[(y - x), $MachinePrecision] * 6), $MachinePrecision] * N[(N[(2 / 3), $MachinePrecision] - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(\left(y - x\right) \cdot 6\right) \cdot \left(\frac{2}{3} - z\right)
(FPCore (x y z) :precision binary64 (+ x (134-z0z1z2z3z4 (- z 2/3) y -6 x -6)))
x + \mathsf{134\_z0z1z2z3z4}\left(\left(z - \frac{2}{3}\right), y, -6, x, -6\right)
Initial program 99.5%
remove-double-negN/A
lift-*.f64N/A
*-commutativeN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower-134-z0z1z2z3z4N/A
lower--.f64N/A
lift-/.f64N/A
metadata-evalN/A
metadata-evalN/A
metadata-eval99.9%
Applied rewrites99.9%
(FPCore (x y z) :precision binary64 (- x (* (- -4 (* z -6)) (- y x))))
double code(double x, double y, double z) {
return x - ((-4.0 - (z * -6.0)) * (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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x - (((-4.0d0) - (z * (-6.0d0))) * (y - x))
end function
public static double code(double x, double y, double z) {
return x - ((-4.0 - (z * -6.0)) * (y - x));
}
def code(x, y, z): return x - ((-4.0 - (z * -6.0)) * (y - x))
function code(x, y, z) return Float64(x - Float64(Float64(-4.0 - Float64(z * -6.0)) * Float64(y - x))) end
function tmp = code(x, y, z) tmp = x - ((-4.0 - (z * -6.0)) * (y - x)); end
code[x_, y_, z_] := N[(x - N[(N[(-4 - N[(z * -6), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \left(-4 - z \cdot -6\right) \cdot \left(y - x\right)
Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
(FPCore (x y z) :precision binary64 (- x (* (* -6 (- 2/3 z)) (- y x))))
double code(double x, double y, double z) {
return x - ((-6.0 * (0.6666666666666666 - z)) * (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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x - (((-6.0d0) * (0.6666666666666666d0 - z)) * (y - x))
end function
public static double code(double x, double y, double z) {
return x - ((-6.0 * (0.6666666666666666 - z)) * (y - x));
}
def code(x, y, z): return x - ((-6.0 * (0.6666666666666666 - z)) * (y - x))
function code(x, y, z) return Float64(x - Float64(Float64(-6.0 * Float64(0.6666666666666666 - z)) * Float64(y - x))) end
function tmp = code(x, y, z) tmp = x - ((-6.0 * (0.6666666666666666 - z)) * (y - x)); end
code[x_, y_, z_] := N[(x - N[(N[(-6 * N[(2/3 - z), $MachinePrecision]), $MachinePrecision] * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x - \left(-6 \cdot \left(\frac{2}{3} - z\right)\right) \cdot \left(y - x\right)
Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
(FPCore (x y z) :precision binary64 (+ x (* (- z 2/3) (* -6 (- y x)))))
double code(double x, double y, double z) {
return x + ((z - 0.6666666666666666) * (-6.0 * (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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x + ((z - 0.6666666666666666d0) * ((-6.0d0) * (y - x)))
end function
public static double code(double x, double y, double z) {
return x + ((z - 0.6666666666666666) * (-6.0 * (y - x)));
}
def code(x, y, z): return x + ((z - 0.6666666666666666) * (-6.0 * (y - x)))
function code(x, y, z) return Float64(x + Float64(Float64(z - 0.6666666666666666) * Float64(-6.0 * Float64(y - x)))) end
function tmp = code(x, y, z) tmp = x + ((z - 0.6666666666666666) * (-6.0 * (y - x))); end
code[x_, y_, z_] := N[(x + N[(N[(z - 2/3), $MachinePrecision] * N[(-6 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
x + \left(z - \frac{2}{3}\right) \cdot \left(-6 \cdot \left(y - x\right)\right)
Initial program 99.5%
lift-*.f64N/A
*-commutativeN/A
lift--.f64N/A
sub-negate-revN/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lower-*.f64N/A
lower--.f64N/A
lift-/.f64N/A
metadata-evalN/A
lift-*.f64N/A
*-commutativeN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.5%
Applied rewrites99.5%
(FPCore (x y z) :precision binary64 (if (<= z -49000) (* z (* -6 (- y x))) (if (<= z 2500) (+ x (* 4 (- y x))) (* -6 (* z (- y x))))))
double code(double x, double y, double z) {
double tmp;
if (z <= -49000.0) {
tmp = z * (-6.0 * (y - x));
} else if (z <= 2500.0) {
tmp = x + (4.0 * (y - x));
} else {
tmp = -6.0 * (z * (y - 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (z <= (-49000.0d0)) then
tmp = z * ((-6.0d0) * (y - x))
else if (z <= 2500.0d0) then
tmp = x + (4.0d0 * (y - x))
else
tmp = (-6.0d0) * (z * (y - x))
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (z <= -49000.0) {
tmp = z * (-6.0 * (y - x));
} else if (z <= 2500.0) {
tmp = x + (4.0 * (y - x));
} else {
tmp = -6.0 * (z * (y - x));
}
return tmp;
}
def code(x, y, z): tmp = 0 if z <= -49000.0: tmp = z * (-6.0 * (y - x)) elif z <= 2500.0: tmp = x + (4.0 * (y - x)) else: tmp = -6.0 * (z * (y - x)) return tmp
function code(x, y, z) tmp = 0.0 if (z <= -49000.0) tmp = Float64(z * Float64(-6.0 * Float64(y - x))); elseif (z <= 2500.0) tmp = Float64(x + Float64(4.0 * Float64(y - x))); else tmp = Float64(-6.0 * Float64(z * Float64(y - x))); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (z <= -49000.0) tmp = z * (-6.0 * (y - x)); elseif (z <= 2500.0) tmp = x + (4.0 * (y - x)); else tmp = -6.0 * (z * (y - x)); end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[z, -49000], N[(z * N[(-6 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2500], N[(x + N[(4 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(-6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;z \leq -49000:\\
\;\;\;\;z \cdot \left(-6 \cdot \left(y - x\right)\right)\\
\mathbf{elif}\;z \leq 2500:\\
\;\;\;\;x + 4 \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;-6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\end{array}
if z < -49000Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f64N/A
lower-/.f64N/A
lower-+.f64N/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f6479.4%
Applied rewrites79.4%
Taylor expanded in z around inf
lower-*.f64N/A
lower--.f6450.9%
Applied rewrites50.9%
if -49000 < z < 2500Initial program 99.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
if 2500 < z Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6450.8%
Applied rewrites50.8%
(FPCore (x y z) :precision binary64 (let* ((t_0 (* -6 (* z (- y x))))) (if (<= z -49000) t_0 (if (<= z 2500) (+ x (* 4 (- y x))) t_0))))
double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 2500.0) {
tmp = x + (4.0 * (y - x));
} else {
tmp = t_0;
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (z * (y - x))
if (z <= (-49000.0d0)) then
tmp = t_0
else if (z <= 2500.0d0) then
tmp = x + (4.0d0 * (y - x))
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (z * (y - x));
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= 2500.0) {
tmp = x + (4.0 * (y - x));
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (z * (y - x)) tmp = 0 if z <= -49000.0: tmp = t_0 elif z <= 2500.0: tmp = x + (4.0 * (y - x)) else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(z * Float64(y - x))) tmp = 0.0 if (z <= -49000.0) tmp = t_0; elseif (z <= 2500.0) tmp = Float64(x + Float64(4.0 * Float64(y - x))); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (z * (y - x)); tmp = 0.0; if (z <= -49000.0) tmp = t_0; elseif (z <= 2500.0) tmp = x + (4.0 * (y - x)); else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6 * N[(z * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -49000], t$95$0, If[LessEqual[z, 2500], N[(x + N[(4 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := -6 \cdot \left(z \cdot \left(y - x\right)\right)\\
\mathbf{if}\;z \leq -49000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2500:\\
\;\;\;\;x + 4 \cdot \left(y - x\right)\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -49000 or 2500 < z Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f64N/A
lower--.f6450.8%
Applied rewrites50.8%
if -49000 < z < 2500Initial program 99.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6 (* y z))))
(if (<= z -180000)
t_0
(if (<= z 2500)
(+ x (* 4 (- y x)))
(if (<=
z
30999999999999999228784508307388029146735879496297007177000671435295252853437383210549345519853048083236519936)
t_0
(* 6 (* x z)))))))double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -180000.0) {
tmp = t_0;
} else if (z <= 2500.0) {
tmp = x + (4.0 * (y - x));
} else if (z <= 3.1e+109) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-180000.0d0)) then
tmp = t_0
else if (z <= 2500.0d0) then
tmp = x + (4.0d0 * (y - x))
else if (z <= 3.1d+109) then
tmp = t_0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -180000.0) {
tmp = t_0;
} else if (z <= 2500.0) {
tmp = x + (4.0 * (y - x));
} else if (z <= 3.1e+109) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -180000.0: tmp = t_0 elif z <= 2500.0: tmp = x + (4.0 * (y - x)) elif z <= 3.1e+109: tmp = t_0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -180000.0) tmp = t_0; elseif (z <= 2500.0) tmp = Float64(x + Float64(4.0 * Float64(y - x))); elseif (z <= 3.1e+109) tmp = t_0; else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -180000.0) tmp = t_0; elseif (z <= 2500.0) tmp = x + (4.0 * (y - x)); elseif (z <= 3.1e+109) tmp = t_0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -180000], t$95$0, If[LessEqual[z, 2500], N[(x + N[(4 * N[(y - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 30999999999999999228784508307388029146735879496297007177000671435295252853437383210549345519853048083236519936], t$95$0, N[(6 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -180000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq 2500:\\
\;\;\;\;x + 4 \cdot \left(y - x\right)\\
\mathbf{elif}\;z \leq 30999999999999999228784508307388029146735879496297007177000671435295252853437383210549345519853048083236519936:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
if z < -1.8e5 or 2500 < z < 3.0999999999999999e109Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.0%
Applied rewrites28.0%
if -1.8e5 < z < 2500Initial program 99.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
if 3.0999999999999999e109 < z Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.1%
Applied rewrites27.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* -6 (* y z))))
(if (<= z -180000)
t_0
(if (<=
z
-7106863825839427/740298315191606967520227188330889966610377319868419938630605715764070011466206019559325413145373572325939050053182159998975553533608824916574615132828322000124194610605645134711392062011527273571616649243219599128195212771328)
(* x -3)
(if (<=
z
6698545683108313/1488565707357402911845015158554633286356257506687627387456491927921949262056238946972039271861787782268441644249633132407878864135402815488)
(* y 4)
(if (<= z 2500)
(* x -3)
(if (<=
z
30999999999999999228784508307388029146735879496297007177000671435295252853437383210549345519853048083236519936)
t_0
(* 6 (* x z)))))))))double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -180000.0) {
tmp = t_0;
} else if (z <= -9.6e-210) {
tmp = x * -3.0;
} else if (z <= 4.5e-123) {
tmp = y * 4.0;
} else if (z <= 2500.0) {
tmp = x * -3.0;
} else if (z <= 3.1e+109) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = (-6.0d0) * (y * z)
if (z <= (-180000.0d0)) then
tmp = t_0
else if (z <= (-9.6d-210)) then
tmp = x * (-3.0d0)
else if (z <= 4.5d-123) then
tmp = y * 4.0d0
else if (z <= 2500.0d0) then
tmp = x * (-3.0d0)
else if (z <= 3.1d+109) then
tmp = t_0
else
tmp = 6.0d0 * (x * z)
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = -6.0 * (y * z);
double tmp;
if (z <= -180000.0) {
tmp = t_0;
} else if (z <= -9.6e-210) {
tmp = x * -3.0;
} else if (z <= 4.5e-123) {
tmp = y * 4.0;
} else if (z <= 2500.0) {
tmp = x * -3.0;
} else if (z <= 3.1e+109) {
tmp = t_0;
} else {
tmp = 6.0 * (x * z);
}
return tmp;
}
def code(x, y, z): t_0 = -6.0 * (y * z) tmp = 0 if z <= -180000.0: tmp = t_0 elif z <= -9.6e-210: tmp = x * -3.0 elif z <= 4.5e-123: tmp = y * 4.0 elif z <= 2500.0: tmp = x * -3.0 elif z <= 3.1e+109: tmp = t_0 else: tmp = 6.0 * (x * z) return tmp
function code(x, y, z) t_0 = Float64(-6.0 * Float64(y * z)) tmp = 0.0 if (z <= -180000.0) tmp = t_0; elseif (z <= -9.6e-210) tmp = Float64(x * -3.0); elseif (z <= 4.5e-123) tmp = Float64(y * 4.0); elseif (z <= 2500.0) tmp = Float64(x * -3.0); elseif (z <= 3.1e+109) tmp = t_0; else tmp = Float64(6.0 * Float64(x * z)); end return tmp end
function tmp_2 = code(x, y, z) t_0 = -6.0 * (y * z); tmp = 0.0; if (z <= -180000.0) tmp = t_0; elseif (z <= -9.6e-210) tmp = x * -3.0; elseif (z <= 4.5e-123) tmp = y * 4.0; elseif (z <= 2500.0) tmp = x * -3.0; elseif (z <= 3.1e+109) tmp = t_0; else tmp = 6.0 * (x * z); end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(-6 * N[(y * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -180000], t$95$0, If[LessEqual[z, -7106863825839427/740298315191606967520227188330889966610377319868419938630605715764070011466206019559325413145373572325939050053182159998975553533608824916574615132828322000124194610605645134711392062011527273571616649243219599128195212771328], N[(x * -3), $MachinePrecision], If[LessEqual[z, 6698545683108313/1488565707357402911845015158554633286356257506687627387456491927921949262056238946972039271861787782268441644249633132407878864135402815488], N[(y * 4), $MachinePrecision], If[LessEqual[z, 2500], N[(x * -3), $MachinePrecision], If[LessEqual[z, 30999999999999999228784508307388029146735879496297007177000671435295252853437383210549345519853048083236519936], t$95$0, N[(6 * N[(x * z), $MachinePrecision]), $MachinePrecision]]]]]]]
\begin{array}{l}
t_0 := -6 \cdot \left(y \cdot z\right)\\
\mathbf{if}\;z \leq -180000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{-7106863825839427}{740298315191606967520227188330889966610377319868419938630605715764070011466206019559325413145373572325939050053182159998975553533608824916574615132828322000124194610605645134711392062011527273571616649243219599128195212771328}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq \frac{6698545683108313}{1488565707357402911845015158554633286356257506687627387456491927921949262056238946972039271861787782268441644249633132407878864135402815488}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq 2500:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq 30999999999999999228784508307388029146735879496297007177000671435295252853437383210549345519853048083236519936:\\
\;\;\;\;t\_0\\
\mathbf{else}:\\
\;\;\;\;6 \cdot \left(x \cdot z\right)\\
\end{array}
if z < -1.8e5 or 2500 < z < 3.0999999999999999e109Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6428.0%
Applied rewrites28.0%
if -1.8e5 < z < -9.6000000000000002e-210 or 4.4999999999999999e-123 < z < 2500Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around 0
Applied rewrites26.2%
if -9.6000000000000002e-210 < z < 4.4999999999999999e-123Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
Taylor expanded in z around 0
Applied rewrites26.1%
if 3.0999999999999999e109 < z Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.1%
Applied rewrites27.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (* 6 (* x z))))
(if (<= z -49000)
t_0
(if (<=
z
-7106863825839427/740298315191606967520227188330889966610377319868419938630605715764070011466206019559325413145373572325939050053182159998975553533608824916574615132828322000124194610605645134711392062011527273571616649243219599128195212771328)
(* x -3)
(if (<=
z
6698545683108313/1488565707357402911845015158554633286356257506687627387456491927921949262056238946972039271861787782268441644249633132407878864135402815488)
(* y 4)
(if (<= z 6422418416702717/9444732965739290427392)
(* x -3)
t_0))))))double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= -9.6e-210) {
tmp = x * -3.0;
} else if (z <= 4.5e-123) {
tmp = y * 4.0;
} else if (z <= 6.8e-7) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = 6.0d0 * (x * z)
if (z <= (-49000.0d0)) then
tmp = t_0
else if (z <= (-9.6d-210)) then
tmp = x * (-3.0d0)
else if (z <= 4.5d-123) then
tmp = y * 4.0d0
else if (z <= 6.8d-7) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = 6.0 * (x * z);
double tmp;
if (z <= -49000.0) {
tmp = t_0;
} else if (z <= -9.6e-210) {
tmp = x * -3.0;
} else if (z <= 4.5e-123) {
tmp = y * 4.0;
} else if (z <= 6.8e-7) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = 6.0 * (x * z) tmp = 0 if z <= -49000.0: tmp = t_0 elif z <= -9.6e-210: tmp = x * -3.0 elif z <= 4.5e-123: tmp = y * 4.0 elif z <= 6.8e-7: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(6.0 * Float64(x * z)) tmp = 0.0 if (z <= -49000.0) tmp = t_0; elseif (z <= -9.6e-210) tmp = Float64(x * -3.0); elseif (z <= 4.5e-123) tmp = Float64(y * 4.0); elseif (z <= 6.8e-7) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = 6.0 * (x * z); tmp = 0.0; if (z <= -49000.0) tmp = t_0; elseif (z <= -9.6e-210) tmp = x * -3.0; elseif (z <= 4.5e-123) tmp = y * 4.0; elseif (z <= 6.8e-7) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(6 * N[(x * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -49000], t$95$0, If[LessEqual[z, -7106863825839427/740298315191606967520227188330889966610377319868419938630605715764070011466206019559325413145373572325939050053182159998975553533608824916574615132828322000124194610605645134711392062011527273571616649243219599128195212771328], N[(x * -3), $MachinePrecision], If[LessEqual[z, 6698545683108313/1488565707357402911845015158554633286356257506687627387456491927921949262056238946972039271861787782268441644249633132407878864135402815488], N[(y * 4), $MachinePrecision], If[LessEqual[z, 6422418416702717/9444732965739290427392], N[(x * -3), $MachinePrecision], t$95$0]]]]]
\begin{array}{l}
t_0 := 6 \cdot \left(x \cdot z\right)\\
\mathbf{if}\;z \leq -49000:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;z \leq \frac{-7106863825839427}{740298315191606967520227188330889966610377319868419938630605715764070011466206019559325413145373572325939050053182159998975553533608824916574615132828322000124194610605645134711392062011527273571616649243219599128195212771328}:\\
\;\;\;\;x \cdot -3\\
\mathbf{elif}\;z \leq \frac{6698545683108313}{1488565707357402911845015158554633286356257506687627387456491927921949262056238946972039271861787782268441644249633132407878864135402815488}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;z \leq \frac{6422418416702717}{9444732965739290427392}:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if z < -49000 or 6.7999999999999995e-7 < z Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around inf
lower-*.f64N/A
lower-*.f6427.1%
Applied rewrites27.1%
if -49000 < z < -9.6000000000000002e-210 or 4.4999999999999999e-123 < z < 6.7999999999999995e-7Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around 0
Applied rewrites26.2%
if -9.6000000000000002e-210 < z < 4.4999999999999999e-123Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
Taylor expanded in z around 0
Applied rewrites26.1%
(FPCore (x y z)
:precision binary64
(let* ((t_0 (+ x (* 4 y))))
(if (<=
y
-7950811791502729/441711766194596082395824375185729628956870974218904739530401550323154944)
t_0
(if (<= y 5299999999999999786239590985776899293184)
(* x -3)
t_0))))double code(double x, double y, double z) {
double t_0 = x + (4.0 * y);
double tmp;
if (y <= -1.8e-56) {
tmp = t_0;
} else if (y <= 5.3e+39) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: t_0
real(8) :: tmp
t_0 = x + (4.0d0 * y)
if (y <= (-1.8d-56)) then
tmp = t_0
else if (y <= 5.3d+39) then
tmp = x * (-3.0d0)
else
tmp = t_0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double t_0 = x + (4.0 * y);
double tmp;
if (y <= -1.8e-56) {
tmp = t_0;
} else if (y <= 5.3e+39) {
tmp = x * -3.0;
} else {
tmp = t_0;
}
return tmp;
}
def code(x, y, z): t_0 = x + (4.0 * y) tmp = 0 if y <= -1.8e-56: tmp = t_0 elif y <= 5.3e+39: tmp = x * -3.0 else: tmp = t_0 return tmp
function code(x, y, z) t_0 = Float64(x + Float64(4.0 * y)) tmp = 0.0 if (y <= -1.8e-56) tmp = t_0; elseif (y <= 5.3e+39) tmp = Float64(x * -3.0); else tmp = t_0; end return tmp end
function tmp_2 = code(x, y, z) t_0 = x + (4.0 * y); tmp = 0.0; if (y <= -1.8e-56) tmp = t_0; elseif (y <= 5.3e+39) tmp = x * -3.0; else tmp = t_0; end tmp_2 = tmp; end
code[x_, y_, z_] := Block[{t$95$0 = N[(x + N[(4 * y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -7950811791502729/441711766194596082395824375185729628956870974218904739530401550323154944], t$95$0, If[LessEqual[y, 5299999999999999786239590985776899293184], N[(x * -3), $MachinePrecision], t$95$0]]]
\begin{array}{l}
t_0 := x + 4 \cdot y\\
\mathbf{if}\;y \leq \frac{-7950811791502729}{441711766194596082395824375185729628956870974218904739530401550323154944}:\\
\;\;\;\;t\_0\\
\mathbf{elif}\;y \leq 5299999999999999786239590985776899293184:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;t\_0\\
\end{array}
if y < -1.7999999999999999e-56 or 5.2999999999999998e39 < y Initial program 99.5%
Taylor expanded in z around 0
lower-*.f64N/A
lower--.f6450.5%
Applied rewrites50.5%
Taylor expanded in x around 0
Applied rewrites25.8%
if -1.7999999999999999e-56 < y < 5.2999999999999998e39Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around 0
Applied rewrites26.2%
(FPCore (x y z)
:precision binary64
(if (<=
y
-7950811791502729/441711766194596082395824375185729628956870974218904739530401550323154944)
(* y 4)
(if (<= y 22000000000000000638106117049042337792) (* x -3) (* y 4))))double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e-56) {
tmp = y * 4.0;
} else if (y <= 2.2e+37) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if (y <= (-1.8d-56)) then
tmp = y * 4.0d0
else if (y <= 2.2d+37) then
tmp = x * (-3.0d0)
else
tmp = y * 4.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if (y <= -1.8e-56) {
tmp = y * 4.0;
} else if (y <= 2.2e+37) {
tmp = x * -3.0;
} else {
tmp = y * 4.0;
}
return tmp;
}
def code(x, y, z): tmp = 0 if y <= -1.8e-56: tmp = y * 4.0 elif y <= 2.2e+37: tmp = x * -3.0 else: tmp = y * 4.0 return tmp
function code(x, y, z) tmp = 0.0 if (y <= -1.8e-56) tmp = Float64(y * 4.0); elseif (y <= 2.2e+37) tmp = Float64(x * -3.0); else tmp = Float64(y * 4.0); end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if (y <= -1.8e-56) tmp = y * 4.0; elseif (y <= 2.2e+37) tmp = x * -3.0; else tmp = y * 4.0; end tmp_2 = tmp; end
code[x_, y_, z_] := If[LessEqual[y, -7950811791502729/441711766194596082395824375185729628956870974218904739530401550323154944], N[(y * 4), $MachinePrecision], If[LessEqual[y, 22000000000000000638106117049042337792], N[(x * -3), $MachinePrecision], N[(y * 4), $MachinePrecision]]]
\begin{array}{l}
\mathbf{if}\;y \leq \frac{-7950811791502729}{441711766194596082395824375185729628956870974218904739530401550323154944}:\\
\;\;\;\;y \cdot 4\\
\mathbf{elif}\;y \leq 22000000000000000638106117049042337792:\\
\;\;\;\;x \cdot -3\\
\mathbf{else}:\\
\;\;\;\;y \cdot 4\\
\end{array}
if y < -1.7999999999999999e-56 or 2.2000000000000001e37 < y Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
lift-*.f64N/A
lift--.f64N/A
sub-flipN/A
distribute-rgt-inN/A
fp-cancel-sub-signN/A
lower--.f64N/A
metadata-evalN/A
lower-*.f6499.8%
Applied rewrites99.8%
Taylor expanded in x around 0
lower-*.f64N/A
lower-+.f64N/A
lower-*.f6451.9%
Applied rewrites51.9%
Taylor expanded in z around 0
Applied rewrites26.1%
if -1.7999999999999999e-56 < y < 2.2000000000000001e37Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around 0
Applied rewrites26.2%
(FPCore (x y z) :precision binary64 (* x -3))
double code(double x, double y, double z) {
return x * -3.0;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = x * (-3.0d0)
end function
public static double code(double x, double y, double z) {
return x * -3.0;
}
def code(x, y, z): return x * -3.0
function code(x, y, z) return Float64(x * -3.0) end
function tmp = code(x, y, z) tmp = x * -3.0; end
code[x_, y_, z_] := N[(x * -3), $MachinePrecision]
x \cdot -3
Initial program 99.5%
lift-+.f64N/A
lift-*.f64N/A
fp-cancel-sign-sub-invN/A
lower--.f64N/A
distribute-lft-neg-outN/A
distribute-rgt-neg-inN/A
lift--.f64N/A
sub-negate-revN/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
sub-negate-revN/A
lift--.f64N/A
distribute-rgt-neg-outN/A
distribute-lft-neg-inN/A
lower-*.f64N/A
metadata-eval99.8%
lift-/.f64N/A
metadata-eval99.8%
Applied rewrites99.8%
Taylor expanded in x around inf
metadata-evalN/A
lower-*.f64N/A
lower--.f64N/A
lower-*.f64N/A
lower--.f64N/A
metadata-eval51.3%
Applied rewrites51.3%
Taylor expanded in z around 0
Applied rewrites26.2%
herbie shell --seed 2025271 -o generate:evaluate
(FPCore (x y z)
:name "Data.Colour.RGBSpace.HSL:hsl from colour-2.3.3, D"
:precision binary64
(+ x (* (* (- y x) 6) (- (/ 2 3) z))))