
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
double code(double x, double y, double z) {
return (x + (y * (z - x))) / 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 * (z - x))) / z
end function
public static double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
def code(x, y, z): return (x + (y * (z - x))) / z
function code(x, y, z) return Float64(Float64(x + Float64(y * Float64(z - x))) / z) end
function tmp = code(x, y, z) tmp = (x + (y * (z - x))) / z; end
code[x_, y_, z_] := N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \left(z - x\right)}{z}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z) :precision binary64 (/ (+ x (* y (- z x))) z))
double code(double x, double y, double z) {
return (x + (y * (z - x))) / 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 * (z - x))) / z
end function
public static double code(double x, double y, double z) {
return (x + (y * (z - x))) / z;
}
def code(x, y, z): return (x + (y * (z - x))) / z
function code(x, y, z) return Float64(Float64(x + Float64(y * Float64(z - x))) / z) end
function tmp = code(x, y, z) tmp = (x + (y * (z - x))) / z; end
code[x_, y_, z_] := N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + y \cdot \left(z - x\right)}{z}
\end{array}
(FPCore (x y z) :precision binary64 (if (or (<= y -3e+42) (not (<= y 4.2e-9))) (fma (/ (- x) z) y y) (/ (+ x (* y (- z x))) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -3e+42) || !(y <= 4.2e-9)) {
tmp = fma((-x / z), y, y);
} else {
tmp = (x + (y * (z - x))) / z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((y <= -3e+42) || !(y <= 4.2e-9)) tmp = fma(Float64(Float64(-x) / z), y, y); else tmp = Float64(Float64(x + Float64(y * Float64(z - x))) / z); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[y, -3e+42], N[Not[LessEqual[y, 4.2e-9]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] * y + y), $MachinePrecision], N[(N[(x + N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3 \cdot 10^{+42} \lor \neg \left(y \leq 4.2 \cdot 10^{-9}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{z}, y, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{x + y \cdot \left(z - x\right)}{z}\\
\end{array}
\end{array}
if y < -3.00000000000000029e42 or 4.20000000000000039e-9 < y Initial program 78.5%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6483.1
Applied rewrites83.1%
Taylor expanded in y around inf
Applied rewrites99.9%
Taylor expanded in y around inf
Applied rewrites99.9%
if -3.00000000000000029e42 < y < 4.20000000000000039e-9Initial program 99.9%
Final simplification99.9%
(FPCore (x y z) :precision binary64 (if (or (<= y -68000000.0) (not (<= y 4.2e-9))) (fma (/ (- x) z) y y) (/ (fma z y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -68000000.0) || !(y <= 4.2e-9)) {
tmp = fma((-x / z), y, y);
} else {
tmp = fma(z, y, x) / z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((y <= -68000000.0) || !(y <= 4.2e-9)) tmp = fma(Float64(Float64(-x) / z), y, y); else tmp = Float64(fma(z, y, x) / z); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[y, -68000000.0], N[Not[LessEqual[y, 4.2e-9]], $MachinePrecision]], N[(N[((-x) / z), $MachinePrecision] * y + y), $MachinePrecision], N[(N[(z * y + x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -68000000 \lor \neg \left(y \leq 4.2 \cdot 10^{-9}\right):\\
\;\;\;\;\mathsf{fma}\left(\frac{-x}{z}, y, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, y, x\right)}{z}\\
\end{array}
\end{array}
if y < -6.8e7 or 4.20000000000000039e-9 < y Initial program 78.9%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6483.3
Applied rewrites83.3%
Taylor expanded in y around inf
Applied rewrites99.9%
Taylor expanded in y around inf
Applied rewrites99.9%
if -6.8e7 < y < 4.20000000000000039e-9Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
Final simplification99.7%
(FPCore (x y z) :precision binary64 (if (or (<= y -68000000.0) (not (<= y 4.2e-9))) (fma (- x) (/ y z) y) (/ (fma z y x) z)))
double code(double x, double y, double z) {
double tmp;
if ((y <= -68000000.0) || !(y <= 4.2e-9)) {
tmp = fma(-x, (y / z), y);
} else {
tmp = fma(z, y, x) / z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if ((y <= -68000000.0) || !(y <= 4.2e-9)) tmp = fma(Float64(-x), Float64(y / z), y); else tmp = Float64(fma(z, y, x) / z); end return tmp end
code[x_, y_, z_] := If[Or[LessEqual[y, -68000000.0], N[Not[LessEqual[y, 4.2e-9]], $MachinePrecision]], N[((-x) * N[(y / z), $MachinePrecision] + y), $MachinePrecision], N[(N[(z * y + x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -68000000 \lor \neg \left(y \leq 4.2 \cdot 10^{-9}\right):\\
\;\;\;\;\mathsf{fma}\left(-x, \frac{y}{z}, y\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, y, x\right)}{z}\\
\end{array}
\end{array}
if y < -6.8e7 or 4.20000000000000039e-9 < y Initial program 78.9%
lift-/.f64N/A
lift-+.f64N/A
+-commutativeN/A
div-addN/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f64N/A
lower-/.f6483.3
Applied rewrites83.3%
Taylor expanded in y around inf
Applied rewrites99.9%
Taylor expanded in y around inf
Applied rewrites99.9%
Applied rewrites90.8%
if -6.8e7 < y < 4.20000000000000039e-9Initial program 99.9%
Taylor expanded in x around 0
Applied rewrites99.5%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6499.5
Applied rewrites99.5%
Final simplification95.6%
(FPCore (x y z) :precision binary64 (if (<= y 2.35e+27) (/ (fma z y x) z) (/ (* (- y) x) z)))
double code(double x, double y, double z) {
double tmp;
if (y <= 2.35e+27) {
tmp = fma(z, y, x) / z;
} else {
tmp = (-y * x) / z;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 2.35e+27) tmp = Float64(fma(z, y, x) / z); else tmp = Float64(Float64(Float64(-y) * x) / z); end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 2.35e+27], N[(N[(z * y + x), $MachinePrecision] / z), $MachinePrecision], N[(N[((-y) * x), $MachinePrecision] / z), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.35 \cdot 10^{+27}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, y, x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(-y\right) \cdot x}{z}\\
\end{array}
\end{array}
if y < 2.34999999999999988e27Initial program 94.7%
Taylor expanded in x around 0
Applied rewrites87.0%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6487.0
Applied rewrites87.0%
if 2.34999999999999988e27 < y Initial program 74.9%
Taylor expanded in x around inf
Applied rewrites58.4%
Taylor expanded in y around inf
Applied rewrites58.4%
(FPCore (x y z) :precision binary64 (if (or (<= x -1.22e-91) (not (<= x 2e-40))) (/ x z) y))
double code(double x, double y, double z) {
double tmp;
if ((x <= -1.22e-91) || !(x <= 2e-40)) {
tmp = x / z;
} else {
tmp = 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)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8) :: tmp
if ((x <= (-1.22d-91)) .or. (.not. (x <= 2d-40))) then
tmp = x / z
else
tmp = y
end if
code = tmp
end function
public static double code(double x, double y, double z) {
double tmp;
if ((x <= -1.22e-91) || !(x <= 2e-40)) {
tmp = x / z;
} else {
tmp = y;
}
return tmp;
}
def code(x, y, z): tmp = 0 if (x <= -1.22e-91) or not (x <= 2e-40): tmp = x / z else: tmp = y return tmp
function code(x, y, z) tmp = 0.0 if ((x <= -1.22e-91) || !(x <= 2e-40)) tmp = Float64(x / z); else tmp = y; end return tmp end
function tmp_2 = code(x, y, z) tmp = 0.0; if ((x <= -1.22e-91) || ~((x <= 2e-40))) tmp = x / z; else tmp = y; end tmp_2 = tmp; end
code[x_, y_, z_] := If[Or[LessEqual[x, -1.22e-91], N[Not[LessEqual[x, 2e-40]], $MachinePrecision]], N[(x / z), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.22 \cdot 10^{-91} \lor \neg \left(x \leq 2 \cdot 10^{-40}\right):\\
\;\;\;\;\frac{x}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if x < -1.21999999999999998e-91 or 1.9999999999999999e-40 < x Initial program 93.8%
Taylor expanded in y around 0
Applied rewrites56.5%
if -1.21999999999999998e-91 < x < 1.9999999999999999e-40Initial program 85.2%
Taylor expanded in x around 0
Applied rewrites76.8%
Final simplification64.6%
(FPCore (x y z) :precision binary64 (if (<= y 4.2e-9) (/ (fma z y x) z) y))
double code(double x, double y, double z) {
double tmp;
if (y <= 4.2e-9) {
tmp = fma(z, y, x) / z;
} else {
tmp = y;
}
return tmp;
}
function code(x, y, z) tmp = 0.0 if (y <= 4.2e-9) tmp = Float64(fma(z, y, x) / z); else tmp = y; end return tmp end
code[x_, y_, z_] := If[LessEqual[y, 4.2e-9], N[(N[(z * y + x), $MachinePrecision] / z), $MachinePrecision], y]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 4.2 \cdot 10^{-9}:\\
\;\;\;\;\frac{\mathsf{fma}\left(z, y, x\right)}{z}\\
\mathbf{else}:\\
\;\;\;\;y\\
\end{array}
\end{array}
if y < 4.20000000000000039e-9Initial program 94.6%
Taylor expanded in x around 0
Applied rewrites86.6%
lift-+.f64N/A
+-commutativeN/A
lift-*.f64N/A
*-commutativeN/A
lower-fma.f6486.6
Applied rewrites86.6%
if 4.20000000000000039e-9 < y Initial program 77.3%
Taylor expanded in x around 0
Applied rewrites44.0%
Final simplification76.3%
(FPCore (x y z) :precision binary64 y)
double code(double x, double y, double z) {
return y;
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = y
end function
public static double code(double x, double y, double z) {
return y;
}
def code(x, y, z): return y
function code(x, y, z) return y end
function tmp = code(x, y, z) tmp = y; end
code[x_, y_, z_] := y
\begin{array}{l}
\\
y
\end{array}
Initial program 90.4%
Taylor expanded in x around 0
Applied rewrites39.4%
Final simplification39.4%
(FPCore (x y z) :precision binary64 (- (+ y (/ x z)) (/ y (/ z x))))
double code(double x, double y, double z) {
return (y + (x / z)) - (y / (z / x));
}
module fmin_fmax_functions
implicit none
private
public fmax
public fmin
interface fmax
module procedure fmax88
module procedure fmax44
module procedure fmax84
module procedure fmax48
end interface
interface fmin
module procedure fmin88
module procedure fmin44
module procedure fmin84
module procedure fmin48
end interface
contains
real(8) function fmax88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(4) function fmax44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, max(x, y), y /= y), x /= x)
end function
real(8) function fmax84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, max(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmax48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), max(dble(x), y), y /= y), x /= x)
end function
real(8) function fmin88(x, y) result (res)
real(8), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(4) function fmin44(x, y) result (res)
real(4), intent (in) :: x
real(4), intent (in) :: y
res = merge(y, merge(x, min(x, y), y /= y), x /= x)
end function
real(8) function fmin84(x, y) result(res)
real(8), intent (in) :: x
real(4), intent (in) :: y
res = merge(dble(y), merge(x, min(x, dble(y)), y /= y), x /= x)
end function
real(8) function fmin48(x, y) result(res)
real(4), intent (in) :: x
real(8), intent (in) :: y
res = merge(y, merge(dble(x), min(dble(x), y), y /= y), x /= x)
end function
end module
real(8) function code(x, y, z)
use fmin_fmax_functions
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
code = (y + (x / z)) - (y / (z / x))
end function
public static double code(double x, double y, double z) {
return (y + (x / z)) - (y / (z / x));
}
def code(x, y, z): return (y + (x / z)) - (y / (z / x))
function code(x, y, z) return Float64(Float64(y + Float64(x / z)) - Float64(y / Float64(z / x))) end
function tmp = code(x, y, z) tmp = (y + (x / z)) - (y / (z / x)); end
code[x_, y_, z_] := N[(N[(y + N[(x / z), $MachinePrecision]), $MachinePrecision] - N[(y / N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\left(y + \frac{x}{z}\right) - \frac{y}{\frac{z}{x}}
\end{array}
herbie shell --seed 2025022
(FPCore (x y z)
:name "Diagrams.Backend.Rasterific:rasterificRadialGradient from diagrams-rasterific-1.3.1.3"
:precision binary64
:alt
(! :herbie-platform default (- (+ y (/ x z)) (/ y (/ z x))))
(/ (+ x (* y (- z x))) z))