
(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]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 11 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]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}
\end{array}
(FPCore (x y z t)
:precision binary64
(if (<= y -5.4e-37)
(fma (/ (- (/ t y) y) z) 0.3333333333333333 x)
(if (<= y 1.35e-75)
(fma 0.3333333333333333 (/ (/ t z) y) x)
(- x (/ (- y (/ t y)) (* 3.0 z))))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -5.4e-37) {
tmp = fma((((t / y) - y) / z), 0.3333333333333333, x);
} else if (y <= 1.35e-75) {
tmp = fma(0.3333333333333333, ((t / z) / y), x);
} else {
tmp = x - ((y - (t / y)) / (3.0 * z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -5.4e-37) tmp = fma(Float64(Float64(Float64(t / y) - y) / z), 0.3333333333333333, x); elseif (y <= 1.35e-75) tmp = fma(0.3333333333333333, Float64(Float64(t / z) / y), x); else tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -5.4e-37], N[(N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], If[LessEqual[y, 1.35e-75], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-37}:\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{t}{y} - y}{z}, 0.3333333333333333, x\right)\\
\mathbf{elif}\;y \leq 1.35 \cdot 10^{-75}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{\frac{t}{z}}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\end{array}
\end{array}
if y < -5.40000000000000032e-37Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites99.8%
if -5.40000000000000032e-37 < y < 1.3499999999999999e-75Initial program 89.6%
Taylor expanded in y around 0
div-addN/A
associate-/l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
*-inversesN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-lft-identityN/A
associate-*r/N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6497.6
Applied rewrites97.6%
Applied rewrites97.7%
if 1.3499999999999999e-75 < y Initial program 99.8%
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-/.f6499.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.8
Applied rewrites99.8%
(FPCore (x y z t) :precision binary64 (if (<= z 1.5e-5) (- x (/ (- y (/ t y)) (* 3.0 z))) (+ (- x (/ (/ y 3.0) z)) (/ t (* (* z 3.0) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5e-5) {
tmp = x - ((y - (t / y)) / (3.0 * z));
} else {
tmp = (x - ((y / 3.0) / z)) + (t / ((z * 3.0) * y));
}
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 <= 1.5d-5) then
tmp = x - ((y - (t / y)) / (3.0d0 * z))
else
tmp = (x - ((y / 3.0d0) / z)) + (t / ((z * 3.0d0) * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1.5e-5) {
tmp = x - ((y - (t / y)) / (3.0 * z));
} else {
tmp = (x - ((y / 3.0) / z)) + (t / ((z * 3.0) * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 1.5e-5: tmp = x - ((y - (t / y)) / (3.0 * z)) else: tmp = (x - ((y / 3.0) / z)) + (t / ((z * 3.0) * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 1.5e-5) tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); else tmp = Float64(Float64(x - Float64(Float64(y / 3.0) / z)) + Float64(t / Float64(Float64(z * 3.0) * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 1.5e-5) tmp = x - ((y - (t / y)) / (3.0 * z)); else tmp = (x - ((y / 3.0) / z)) + (t / ((z * 3.0) * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 1.5e-5], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(N[(y / 3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 1.5 \cdot 10^{-5}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{\frac{y}{3}}{z}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\end{array}
\end{array}
if z < 1.50000000000000004e-5Initial program 93.3%
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-/.f6498.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.3
Applied rewrites98.3%
if 1.50000000000000004e-5 < z Initial program 99.7%
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
(FPCore (x y z t) :precision binary64 (if (<= z 3.3e-77) (- x (/ (- y (/ t y)) (* 3.0 z))) (+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.3e-77) {
tmp = x - ((y - (t / y)) / (3.0 * z));
} else {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
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 <= 3.3d-77) then
tmp = x - ((y - (t / y)) / (3.0d0 * z))
else
tmp = (x - (y / (z * 3.0d0))) + (t / ((z * 3.0d0) * y))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= 3.3e-77) {
tmp = x - ((y - (t / y)) / (3.0 * z));
} else {
tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= 3.3e-77: tmp = x - ((y - (t / y)) / (3.0 * z)) else: tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= 3.3e-77) tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); else tmp = Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(z * 3.0) * y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= 3.3e-77) tmp = x - ((y - (t / y)) / (3.0 * z)); else tmp = (x - (y / (z * 3.0))) + (t / ((z * 3.0) * y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, 3.3e-77], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(z * 3.0), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 3.3 \cdot 10^{-77}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(z \cdot 3\right) \cdot y}\\
\end{array}
\end{array}
if z < 3.29999999999999991e-77Initial program 92.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-/.f6498.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.2
Applied rewrites98.2%
if 3.29999999999999991e-77 < z Initial program 99.7%
(FPCore (x y z t) :precision binary64 (if (<= z 1e-56) (- x (/ (- y (/ t y)) (* 3.0 z))) (+ (fma -0.3333333333333333 (/ y z) x) (/ t (* (* 3.0 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= 1e-56) {
tmp = x - ((y - (t / y)) / (3.0 * z));
} else {
tmp = fma(-0.3333333333333333, (y / z), x) + (t / ((3.0 * y) * z));
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (z <= 1e-56) tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); else tmp = Float64(fma(-0.3333333333333333, Float64(y / z), x) + Float64(t / Float64(Float64(3.0 * y) * z))); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[z, 1e-56], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision] + N[(t / N[(N[(3.0 * y), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq 10^{-56}:\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right) + \frac{t}{\left(3 \cdot y\right) \cdot z}\\
\end{array}
\end{array}
if z < 1e-56Initial program 92.9%
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-/.f6498.2
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.2
Applied rewrites98.2%
if 1e-56 < z Initial program 99.7%
lift-*.f64N/A
lift-*.f64N/A
associate-*l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-*.f6499.6
Applied rewrites99.6%
Taylor expanded in x around 0
metadata-evalN/A
fp-cancel-sign-sub-invN/A
+-commutativeN/A
lower-fma.f64N/A
lower-/.f6499.7
Applied rewrites99.7%
(FPCore (x y z t) :precision binary64 (if (or (<= y -5.4e-37) (not (<= y 9.5e-69))) (fma (/ (- (/ t y) y) z) 0.3333333333333333 x) (fma 0.3333333333333333 (/ (/ t z) y) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -5.4e-37) || !(y <= 9.5e-69)) {
tmp = fma((((t / y) - y) / z), 0.3333333333333333, x);
} else {
tmp = fma(0.3333333333333333, ((t / z) / y), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((y <= -5.4e-37) || !(y <= 9.5e-69)) tmp = fma(Float64(Float64(Float64(t / y) - y) / z), 0.3333333333333333, x); else tmp = fma(0.3333333333333333, Float64(Float64(t / z) / y), x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -5.4e-37], N[Not[LessEqual[y, 9.5e-69]], $MachinePrecision]], N[(N[(N[(N[(t / y), $MachinePrecision] - y), $MachinePrecision] / z), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -5.4 \cdot 10^{-37} \lor \neg \left(y \leq 9.5 \cdot 10^{-69}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{\frac{t}{y} - y}{z}, 0.3333333333333333, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{\frac{t}{z}}{y}, x\right)\\
\end{array}
\end{array}
if y < -5.40000000000000032e-37 or 9.50000000000000094e-69 < y Initial program 99.8%
Taylor expanded in x around 0
Applied rewrites99.8%
if -5.40000000000000032e-37 < y < 9.50000000000000094e-69Initial program 89.7%
Taylor expanded in y around 0
div-addN/A
associate-/l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
*-inversesN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-lft-identityN/A
associate-*r/N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6497.7
Applied rewrites97.7%
Applied rewrites97.7%
Final simplification98.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.4e+43) (not (<= y 0.27))) (fma -0.3333333333333333 (/ y z) x) (fma 0.3333333333333333 (/ (/ t z) y) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4e+43) || !(y <= 0.27)) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else {
tmp = fma(0.3333333333333333, ((t / z) / y), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.4e+43) || !(y <= 0.27)) tmp = fma(-0.3333333333333333, Float64(y / z), x); else tmp = fma(0.3333333333333333, Float64(Float64(t / z) / y), x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.4e+43], N[Not[LessEqual[y, 0.27]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], N[(0.3333333333333333 * N[(N[(t / z), $MachinePrecision] / y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+43} \lor \neg \left(y \leq 0.27\right):\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(0.3333333333333333, \frac{\frac{t}{z}}{y}, x\right)\\
\end{array}
\end{array}
if y < -3.40000000000000012e43 or 0.27000000000000002 < y Initial program 99.8%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites95.4%
if -3.40000000000000012e43 < y < 0.27000000000000002Initial program 91.6%
Taylor expanded in y around 0
div-addN/A
associate-/l*N/A
associate-/r*N/A
*-commutativeN/A
associate-/l*N/A
fp-cancel-sign-sub-invN/A
distribute-lft-neg-inN/A
distribute-rgt-neg-inN/A
*-inversesN/A
metadata-evalN/A
*-commutativeN/A
metadata-evalN/A
fp-cancel-sign-sub-invN/A
*-lft-identityN/A
associate-*r/N/A
times-fracN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6494.0
Applied rewrites94.0%
Applied rewrites94.0%
Final simplification94.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.4e+43) (not (<= y 0.27))) (fma -0.3333333333333333 (/ y z) x) (fma (/ t (* z y)) 0.3333333333333333 x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.4e+43) || !(y <= 0.27)) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else {
tmp = fma((t / (z * y)), 0.3333333333333333, x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.4e+43) || !(y <= 0.27)) tmp = fma(-0.3333333333333333, Float64(y / z), x); else tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.4e+43], N[Not[LessEqual[y, 0.27]], $MachinePrecision]], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.4 \cdot 10^{+43} \lor \neg \left(y \leq 0.27\right):\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, x\right)\\
\end{array}
\end{array}
if y < -3.40000000000000012e43 or 0.27000000000000002 < y Initial program 99.8%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites95.4%
if -3.40000000000000012e43 < y < 0.27000000000000002Initial program 91.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6498.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.8
Applied rewrites98.8%
Taylor expanded in y around 0
fp-cancel-sign-sub-invN/A
*-commutativeN/A
fp-cancel-sub-sign-invN/A
div-add-revN/A
associate-*l/N/A
times-fracN/A
associate-/r*N/A
associate-*r/N/A
associate-*r/N/A
distribute-neg-fracN/A
distribute-neg-frac2N/A
associate-*r/N/A
distribute-neg-frac2N/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-frac-negN/A
remove-double-negN/A
associate-/l*N/A
*-inversesN/A
*-inversesN/A
associate-/l*N/A
remove-double-negN/A
Applied rewrites86.8%
Final simplification90.4%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.9e-55)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 2.9e-145)
(* (/ t (* z y)) 0.3333333333333333)
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e-55) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 2.9e-145) {
tmp = (t / (z * y)) * 0.3333333333333333;
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e-55) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 2.9e-145) tmp = Float64(Float64(t / Float64(z * y)) * 0.3333333333333333); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e-55], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.9e-145], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-145}:\\
\;\;\;\;\frac{t}{z \cdot y} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.8999999999999998e-55Initial program 99.8%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites88.3%
if -1.8999999999999998e-55 < y < 2.89999999999999984e-145Initial program 88.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.2
Applied rewrites64.2%
if 2.89999999999999984e-145 < y Initial program 98.7%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites80.0%
Applied rewrites80.0%
Applied rewrites80.0%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.9e-55)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 2.9e-145)
(* t (/ 0.3333333333333333 (* z y)))
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.9e-55) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 2.9e-145) {
tmp = t * (0.3333333333333333 / (z * y));
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.9e-55) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 2.9e-145) tmp = Float64(t * Float64(0.3333333333333333 / Float64(z * y))); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -1.9e-55], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.9e-145], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.9 \cdot 10^{-55}:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 2.9 \cdot 10^{-145}:\\
\;\;\;\;t \cdot \frac{0.3333333333333333}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.8999999999999998e-55Initial program 99.8%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites88.3%
if -1.8999999999999998e-55 < y < 2.89999999999999984e-145Initial program 88.0%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6464.2
Applied rewrites64.2%
Applied rewrites64.1%
if 2.89999999999999984e-145 < y Initial program 98.7%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites80.0%
Applied rewrites80.0%
Applied rewrites80.0%
(FPCore (x y z t) :precision binary64 (- x (/ (* 0.3333333333333333 y) z)))
double code(double x, double y, double z, double t) {
return x - ((0.3333333333333333 * y) / 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 - ((0.3333333333333333d0 * y) / z)
end function
public static double code(double x, double y, double z, double t) {
return x - ((0.3333333333333333 * y) / z);
}
def code(x, y, z, t): return x - ((0.3333333333333333 * y) / z)
function code(x, y, z, t) return Float64(x - Float64(Float64(0.3333333333333333 * y) / z)) end
function tmp = code(x, y, z, t) tmp = x - ((0.3333333333333333 * y) / z); end
code[x_, y_, z_, t_] := N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \frac{0.3333333333333333 \cdot y}{z}
\end{array}
Initial program 95.0%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites63.1%
Applied rewrites63.1%
Applied rewrites63.1%
(FPCore (x y z t) :precision binary64 (fma -0.3333333333333333 (/ y z) x))
double code(double x, double y, double z, double t) {
return fma(-0.3333333333333333, (y / z), x);
}
function code(x, y, z, t) return fma(-0.3333333333333333, Float64(y / z), x) end
code[x_, y_, z_, t_] := N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)
\end{array}
Initial program 95.0%
Taylor expanded in y around inf
*-commutativeN/A
fp-cancel-sub-sign-invN/A
remove-double-negN/A
mul-1-negN/A
distribute-lft-neg-inN/A
distribute-neg-inN/A
mul-1-negN/A
*-commutativeN/A
associate-*r*N/A
mul-1-negN/A
distribute-rgt-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
+-commutativeN/A
distribute-neg-inN/A
distribute-lft-neg-inN/A
*-commutativeN/A
distribute-lft-neg-outN/A
fp-cancel-sub-signN/A
Applied rewrites63.1%
(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(Float64(t / 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[(N[(t / N[(z * 3.0), $MachinePrecision]), $MachinePrecision] / y), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{\frac{t}{z \cdot 3}}{y}
\end{array}
herbie shell --seed 2024359
(FPCore (x y z t)
:name "Diagrams.Solve.Polynomial:cubForm from diagrams-solve-0.1, H"
:precision binary64
:alt
(! :herbie-platform default (+ (- x (/ y (* z 3))) (/ (/ t (* z 3)) y)))
(+ (- x (/ y (* z 3.0))) (/ t (* (* z 3.0) y))))