
(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
(let* ((t_1 (- y (/ t y))))
(if (<= y -2e-144)
(- x (/ (/ t_1 3.0) z))
(if (<= y 8.6e-100)
(fma (/ t z) (/ 0.3333333333333333 y) x)
(- x (/ t_1 (* 3.0 z)))))))
double code(double x, double y, double z, double t) {
double t_1 = y - (t / y);
double tmp;
if (y <= -2e-144) {
tmp = x - ((t_1 / 3.0) / z);
} else if (y <= 8.6e-100) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = x - (t_1 / (3.0 * z));
}
return tmp;
}
function code(x, y, z, t) t_1 = Float64(y - Float64(t / y)) tmp = 0.0 if (y <= -2e-144) tmp = Float64(x - Float64(Float64(t_1 / 3.0) / z)); elseif (y <= 8.6e-100) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = Float64(x - Float64(t_1 / Float64(3.0 * z))); end return tmp end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -2e-144], N[(x - N[(N[(t$95$1 / 3.0), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 8.6e-100], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(t$95$1 / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := y - \frac{t}{y}\\
\mathbf{if}\;y \leq -2 \cdot 10^{-144}:\\
\;\;\;\;x - \frac{\frac{t\_1}{3}}{z}\\
\mathbf{elif}\;y \leq 8.6 \cdot 10^{-100}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{t\_1}{3 \cdot z}\\
\end{array}
\end{array}
if y < -1.9999999999999999e-144Initial program 98.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-/.f6498.8
lift-*.f64N/A
*-commutativeN/A
lower-*.f6498.8
Applied rewrites98.8%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6498.8
Applied rewrites98.8%
if -1.9999999999999999e-144 < y < 8.59999999999999997e-100Initial program 93.5%
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
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.5
Applied rewrites93.5%
Applied rewrites99.8%
if 8.59999999999999997e-100 < y Initial program 98.6%
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 (or (<= y -6.1e-145) (not (<= y 8.6e-100))) (- x (/ (- y (/ t y)) (* 3.0 z))) (fma (/ t z) (/ 0.3333333333333333 y) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -6.1e-145) || !(y <= 8.6e-100)) {
tmp = x - ((y - (t / y)) / (3.0 * z));
} else {
tmp = fma((t / z), (0.3333333333333333 / y), x);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if ((y <= -6.1e-145) || !(y <= 8.6e-100)) tmp = Float64(x - Float64(Float64(y - Float64(t / y)) / Float64(3.0 * z))); else tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); end return tmp end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -6.1e-145], N[Not[LessEqual[y, 8.6e-100]], $MachinePrecision]], N[(x - N[(N[(y - N[(t / y), $MachinePrecision]), $MachinePrecision] / N[(3.0 * z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.1 \cdot 10^{-145} \lor \neg \left(y \leq 8.6 \cdot 10^{-100}\right):\\
\;\;\;\;x - \frac{y - \frac{t}{y}}{3 \cdot z}\\
\mathbf{else}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\end{array}
\end{array}
if y < -6.1e-145 or 8.59999999999999997e-100 < y Initial program 98.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-/.f6499.3
lift-*.f64N/A
*-commutativeN/A
lower-*.f6499.3
Applied rewrites99.3%
if -6.1e-145 < y < 8.59999999999999997e-100Initial program 93.5%
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
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6493.5
Applied rewrites93.5%
Applied rewrites99.8%
Final simplification99.4%
(FPCore (x y z t) :precision binary64 (+ (- x (/ y (* z 3.0))) (/ t (* (* y z) 3.0))))
double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((y * z) * 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, 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 / ((y * z) * 3.0d0))
end function
public static double code(double x, double y, double z, double t) {
return (x - (y / (z * 3.0))) + (t / ((y * z) * 3.0));
}
def code(x, y, z, t): return (x - (y / (z * 3.0))) + (t / ((y * z) * 3.0))
function code(x, y, z, t) return Float64(Float64(x - Float64(y / Float64(z * 3.0))) + Float64(t / Float64(Float64(y * z) * 3.0))) end
function tmp = code(x, y, z, t) tmp = (x - (y / (z * 3.0))) + (t / ((y * z) * 3.0)); end
code[x_, y_, z_, t_] := N[(N[(x - N[(y / N[(z * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + N[(t / N[(N[(y * z), $MachinePrecision] * 3.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(x - \frac{y}{z \cdot 3}\right) + \frac{t}{\left(y \cdot z\right) \cdot 3}
\end{array}
Initial program 97.2%
lift-*.f64N/A
*-commutativeN/A
lift-*.f64N/A
associate-*r*N/A
lower-*.f64N/A
lower-*.f6497.2
Applied rewrites97.2%
(FPCore (x y z t)
:precision binary64
(if (<= y -80.0)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 8.2e+52)
(fma (/ t z) (/ 0.3333333333333333 y) x)
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -80.0) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 8.2e+52) {
tmp = fma((t / z), (0.3333333333333333 / y), x);
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -80.0) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 8.2e+52) tmp = fma(Float64(t / z), Float64(0.3333333333333333 / y), x); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -80.0], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 8.2e+52], N[(N[(t / z), $MachinePrecision] * N[(0.3333333333333333 / y), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -80:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 8.2 \cdot 10^{+52}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z}, \frac{0.3333333333333333}{y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -80Initial program 98.3%
Taylor expanded in y around inf
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
distribute-lft-inN/A
Applied rewrites94.2%
if -80 < y < 8.1999999999999999e52Initial program 95.5%
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
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6488.8
Applied rewrites88.8%
Applied rewrites90.2%
if 8.1999999999999999e52 < 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%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6499.9
Applied rewrites99.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -80.0)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 9.5e+54)
(fma (/ t (* z y)) 0.3333333333333333 x)
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -80.0) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 9.5e+54) {
tmp = fma((t / (z * y)), 0.3333333333333333, x);
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -80.0) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 9.5e+54) tmp = fma(Float64(t / Float64(z * y)), 0.3333333333333333, x); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -80.0], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 9.5e+54], N[(N[(t / N[(z * y), $MachinePrecision]), $MachinePrecision] * 0.3333333333333333 + x), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -80:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(\frac{t}{z \cdot y}, 0.3333333333333333, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -80Initial program 98.3%
Taylor expanded in y around inf
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
distribute-lft-inN/A
Applied rewrites94.2%
if -80 < y < 9.4999999999999999e54Initial program 95.5%
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
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6488.8
Applied rewrites88.8%
if 9.4999999999999999e54 < 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%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6499.9
Applied rewrites99.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -80.0)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 9.5e+54)
(fma t (/ 0.3333333333333333 (* z y)) x)
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -80.0) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 9.5e+54) {
tmp = fma(t, (0.3333333333333333 / (z * y)), x);
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -80.0) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 9.5e+54) tmp = fma(t, Float64(0.3333333333333333 / Float64(z * y)), x); else tmp = Float64(x - Float64(Float64(0.3333333333333333 * y) / z)); end return tmp end
code[x_, y_, z_, t_] := If[LessEqual[y, -80.0], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 9.5e+54], N[(t * N[(0.3333333333333333 / N[(z * y), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -80:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 9.5 \cdot 10^{+54}:\\
\;\;\;\;\mathsf{fma}\left(t, \frac{0.3333333333333333}{z \cdot y}, x\right)\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -80Initial program 98.3%
Taylor expanded in y around inf
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
distribute-lft-inN/A
Applied rewrites94.2%
if -80 < y < 9.4999999999999999e54Initial program 95.5%
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
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6488.8
Applied rewrites88.8%
Applied rewrites88.2%
if 9.4999999999999999e54 < 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%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6499.9
Applied rewrites99.9%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.05e-11)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 2.3e-95)
(* (/ 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.05e-11) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 2.3e-95) {
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.05e-11) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 2.3e-95) 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.05e-11], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.3e-95], 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.05 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-95}:\\
\;\;\;\;\frac{t}{z \cdot y} \cdot 0.3333333333333333\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.0499999999999999e-11Initial program 98.4%
Taylor expanded in y around inf
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
distribute-lft-inN/A
Applied rewrites93.1%
if -1.0499999999999999e-11 < y < 2.29999999999999999e-95Initial program 95.2%
Taylor expanded in y around 0
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6469.0
Applied rewrites69.0%
if 2.29999999999999999e-95 < y Initial program 98.6%
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%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6489.3
Applied rewrites89.3%
(FPCore (x y z t)
:precision binary64
(if (<= y -1.05e-11)
(fma -0.3333333333333333 (/ y z) x)
(if (<= y 2.3e-95)
(/ (* 0.3333333333333333 t) (* z y))
(- x (/ (* 0.3333333333333333 y) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -1.05e-11) {
tmp = fma(-0.3333333333333333, (y / z), x);
} else if (y <= 2.3e-95) {
tmp = (0.3333333333333333 * t) / (z * y);
} else {
tmp = x - ((0.3333333333333333 * y) / z);
}
return tmp;
}
function code(x, y, z, t) tmp = 0.0 if (y <= -1.05e-11) tmp = fma(-0.3333333333333333, Float64(y / z), x); elseif (y <= 2.3e-95) tmp = Float64(Float64(0.3333333333333333 * t) / 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.05e-11], N[(-0.3333333333333333 * N[(y / z), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[y, 2.3e-95], N[(N[(0.3333333333333333 * t), $MachinePrecision] / N[(z * y), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(0.3333333333333333 * y), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.05 \cdot 10^{-11}:\\
\;\;\;\;\mathsf{fma}\left(-0.3333333333333333, \frac{y}{z}, x\right)\\
\mathbf{elif}\;y \leq 2.3 \cdot 10^{-95}:\\
\;\;\;\;\frac{0.3333333333333333 \cdot t}{z \cdot y}\\
\mathbf{else}:\\
\;\;\;\;x - \frac{0.3333333333333333 \cdot y}{z}\\
\end{array}
\end{array}
if y < -1.0499999999999999e-11Initial program 98.4%
Taylor expanded in y around inf
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
distribute-lft-inN/A
Applied rewrites93.1%
if -1.0499999999999999e-11 < y < 2.29999999999999999e-95Initial program 95.2%
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
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
*-commutativeN/A
lower-*.f6492.2
Applied rewrites92.2%
Applied rewrites91.4%
Taylor expanded in x around 0
Applied rewrites58.7%
Applied rewrites69.0%
if 2.29999999999999999e-95 < y Initial program 98.6%
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%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6499.8
Applied rewrites99.8%
Taylor expanded in y around inf
lower-*.f6489.3
Applied rewrites89.3%
(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 97.2%
Taylor expanded in y around inf
fp-cancel-sub-sign-invN/A
*-lft-identityN/A
metadata-evalN/A
distribute-lft-neg-outN/A
*-commutativeN/A
distribute-lft-neg-outN/A
mul-1-negN/A
distribute-lft-neg-outN/A
*-rgt-identityN/A
distribute-rgt-neg-inN/A
metadata-evalN/A
distribute-rgt-inN/A
associate-*l*N/A
*-commutativeN/A
mul-1-negN/A
distribute-lft-neg-inN/A
mul-1-negN/A
associate-*r*N/A
+-commutativeN/A
distribute-lft-inN/A
Applied rewrites66.0%
(FPCore (x y z t) :precision binary64 (* (/ y z) -0.3333333333333333))
double code(double x, double y, double z, double t) {
return (y / z) * -0.3333333333333333;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z, t)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (y / z) * (-0.3333333333333333d0)
end function
public static double code(double x, double y, double z, double t) {
return (y / z) * -0.3333333333333333;
}
def code(x, y, z, t): return (y / z) * -0.3333333333333333
function code(x, y, z, t) return Float64(Float64(y / z) * -0.3333333333333333) end
function tmp = code(x, y, z, t) tmp = (y / z) * -0.3333333333333333; end
code[x_, y_, z_, t_] := N[(N[(y / z), $MachinePrecision] * -0.3333333333333333), $MachinePrecision]
\begin{array}{l}
\\
\frac{y}{z} \cdot -0.3333333333333333
\end{array}
Initial program 97.2%
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-/.f6493.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.6
Applied rewrites93.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6440.0
Applied rewrites40.0%
Final simplification40.0%
(FPCore (x y z t) :precision binary64 (* y (/ -0.3333333333333333 z)))
double code(double x, double y, double z, double t) {
return y * (-0.3333333333333333 / 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 = y * ((-0.3333333333333333d0) / z)
end function
public static double code(double x, double y, double z, double t) {
return y * (-0.3333333333333333 / z);
}
def code(x, y, z, t): return y * (-0.3333333333333333 / z)
function code(x, y, z, t) return Float64(y * Float64(-0.3333333333333333 / z)) end
function tmp = code(x, y, z, t) tmp = y * (-0.3333333333333333 / z); end
code[x_, y_, z_, t_] := N[(y * N[(-0.3333333333333333 / z), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
y \cdot \frac{-0.3333333333333333}{z}
\end{array}
Initial program 97.2%
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-/.f6493.6
lift-*.f64N/A
*-commutativeN/A
lower-*.f6493.6
Applied rewrites93.6%
lift-/.f64N/A
lift-*.f64N/A
associate-/r*N/A
lower-/.f64N/A
lower-/.f6493.6
Applied rewrites93.6%
Taylor expanded in y around inf
*-commutativeN/A
lower-*.f64N/A
lower-/.f6440.0
Applied rewrites40.0%
Applied rewrites40.0%
Final simplification40.0%
(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 2025017
(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))))