
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 7 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t) :precision binary64 (/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0);
}
def code(x, y, z, t): return (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / Float64(Float64(t * z) - x))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + (((y * z) - x) / ((t * z) - x))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \frac{y \cdot z - x}{t \cdot z - x}}{x + 1}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_2 -2e+169)
(* y (/ (/ z (+ x 1.0)) t_1))
(if (<= t_2 5e+195) t_2 (/ (+ x (/ y t)) (+ x 1.0))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -2e+169) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+195) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: t_1
real(8) :: t_2
real(8) :: tmp
t_1 = (z * t) - x
t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0d0)
if (t_2 <= (-2d+169)) then
tmp = y * ((z / (x + 1.0d0)) / t_1)
else if (t_2 <= 5d+195) then
tmp = t_2
else
tmp = (x + (y / t)) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_2 <= -2e+169) {
tmp = y * ((z / (x + 1.0)) / t_1);
} else if (t_2 <= 5e+195) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_2 <= -2e+169: tmp = y * ((z / (x + 1.0)) / t_1) elif t_2 <= 5e+195: tmp = t_2 else: tmp = (x + (y / t)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_2 <= -2e+169) tmp = Float64(y * Float64(Float64(z / Float64(x + 1.0)) / t_1)); elseif (t_2 <= 5e+195) tmp = t_2; else tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_2 <= -2e+169) tmp = y * ((z / (x + 1.0)) / t_1); elseif (t_2 <= 5e+195) tmp = t_2; else tmp = (x + (y / t)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(N[(N[(y * z), $MachinePrecision] - x), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, -2e+169], N[(y * N[(N[(z / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 5e+195], t$95$2, N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y \cdot z - x}{t\_1}}{x + 1}\\
\mathbf{if}\;t\_2 \leq -2 \cdot 10^{+169}:\\
\;\;\;\;y \cdot \frac{\frac{z}{x + 1}}{t\_1}\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+195}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\end{array}
\end{array}
if (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < -1.99999999999999987e169Initial program 56.8%
*-commutative56.8%
Simplified56.8%
Taylor expanded in y around inf 56.5%
associate-/l*86.4%
associate-/r*93.0%
+-commutative93.0%
Simplified93.0%
if -1.99999999999999987e169 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 4.9999999999999998e195Initial program 99.8%
if 4.9999999999999998e195 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 46.5%
*-commutative46.5%
Simplified46.5%
Taylor expanded in z around inf 97.2%
+-commutative97.2%
+-commutative97.2%
Simplified97.2%
Final simplification98.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.45e-73) (not (<= t 1.3e-62))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (+ 1.0 (- x (* y (/ z x)))) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.45e-73) || !(t <= 1.3e-62)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0);
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((t <= (-1.45d-73)) .or. (.not. (t <= 1.3d-62))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (1.0d0 + (x - (y * (z / x)))) / (x + 1.0d0)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.45e-73) || !(t <= 1.3e-62)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.45e-73) or not (t <= 1.3e-62): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.45e-73) || !(t <= 1.3e-62)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 + Float64(x - Float64(y * Float64(z / x)))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.45e-73) || ~((t <= 1.3e-62))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (1.0 + (x - (y * (z / x)))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.45e-73], N[Not[LessEqual[t, 1.3e-62]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-73} \lor \neg \left(t \leq 1.3 \cdot 10^{-62}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - y \cdot \frac{z}{x}\right)}{x + 1}\\
\end{array}
\end{array}
if t < -1.45e-73 or 1.3e-62 < t Initial program 83.3%
*-commutative83.3%
Simplified83.3%
Taylor expanded in z around inf 88.1%
+-commutative88.1%
+-commutative88.1%
Simplified88.1%
if -1.45e-73 < t < 1.3e-62Initial program 95.3%
*-commutative95.3%
Simplified95.3%
Taylor expanded in t around 0 81.2%
mul-1-neg81.2%
unsub-neg81.2%
associate-/l*84.0%
+-commutative84.0%
Simplified84.0%
Final simplification86.4%
(FPCore (x y z t)
:precision binary64
(if (<= x -1.6e-25)
1.0
(if (<= x 2.6e+82)
(/ (+ x (/ y t)) (+ x 1.0))
(/ (+ 1.0 (- x (* y (/ z x)))) x))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-25) {
tmp = 1.0;
} else if (x <= 2.6e+82) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (y * (z / x)))) / x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1.6d-25)) then
tmp = 1.0d0
else if (x <= 2.6d+82) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (1.0d0 + (x - (y * (z / x)))) / x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.6e-25) {
tmp = 1.0;
} else if (x <= 2.6e+82) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 + (x - (y * (z / x)))) / x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.6e-25: tmp = 1.0 elif x <= 2.6e+82: tmp = (x + (y / t)) / (x + 1.0) else: tmp = (1.0 + (x - (y * (z / x)))) / x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.6e-25) tmp = 1.0; elseif (x <= 2.6e+82) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 + Float64(x - Float64(y * Float64(z / x)))) / x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1.6e-25) tmp = 1.0; elseif (x <= 2.6e+82) tmp = (x + (y / t)) / (x + 1.0); else tmp = (1.0 + (x - (y * (z / x)))) / x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.6e-25], 1.0, If[LessEqual[x, 2.6e+82], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 + N[(x - N[(y * N[(z / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / x), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.6 \cdot 10^{-25}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2.6 \cdot 10^{+82}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 + \left(x - y \cdot \frac{z}{x}\right)}{x}\\
\end{array}
\end{array}
if x < -1.6000000000000001e-25Initial program 85.0%
*-commutative85.0%
Simplified85.0%
Taylor expanded in x around inf 87.7%
if -1.6000000000000001e-25 < x < 2.5999999999999998e82Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in z around inf 68.4%
+-commutative68.4%
+-commutative68.4%
Simplified68.4%
if 2.5999999999999998e82 < x Initial program 94.8%
*-commutative94.8%
Simplified94.8%
Taylor expanded in t around 0 89.3%
mul-1-neg89.3%
unsub-neg89.3%
associate-/l*92.0%
+-commutative92.0%
Simplified92.0%
Taylor expanded in x around inf 92.0%
Final simplification77.1%
(FPCore (x y z t) :precision binary64 (if (<= x -4.5e-26) 1.0 (if (<= x 2e+82) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e-26) {
tmp = 1.0;
} else if (x <= 2e+82) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-4.5d-26)) then
tmp = 1.0d0
else if (x <= 2d+82) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -4.5e-26) {
tmp = 1.0;
} else if (x <= 2e+82) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -4.5e-26: tmp = 1.0 elif x <= 2e+82: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -4.5e-26) tmp = 1.0; elseif (x <= 2e+82) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -4.5e-26) tmp = 1.0; elseif (x <= 2e+82) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -4.5e-26], 1.0, If[LessEqual[x, 2e+82], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -4.5 \cdot 10^{-26}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 2 \cdot 10^{+82}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -4.4999999999999999e-26 or 1.9999999999999999e82 < x Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in x around inf 88.8%
if -4.4999999999999999e-26 < x < 1.9999999999999999e82Initial program 87.9%
*-commutative87.9%
Simplified87.9%
Taylor expanded in z around inf 68.4%
+-commutative68.4%
+-commutative68.4%
Simplified68.4%
Final simplification77.0%
(FPCore (x y z t) :precision binary64 (if (<= x -1e-25) 1.0 (if (<= x 4.2e-7) (+ x (/ y t)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-25) {
tmp = 1.0;
} else if (x <= 4.2e-7) {
tmp = x + (y / t);
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1d-25)) then
tmp = 1.0d0
else if (x <= 4.2d-7) then
tmp = x + (y / t)
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-25) {
tmp = 1.0;
} else if (x <= 4.2e-7) {
tmp = x + (y / t);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1e-25: tmp = 1.0 elif x <= 4.2e-7: tmp = x + (y / t) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1e-25) tmp = 1.0; elseif (x <= 4.2e-7) tmp = Float64(x + Float64(y / t)); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1e-25) tmp = 1.0; elseif (x <= 4.2e-7) tmp = x + (y / t); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1e-25], 1.0, If[LessEqual[x, 4.2e-7], N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-25}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.2 \cdot 10^{-7}:\\
\;\;\;\;x + \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.00000000000000004e-25 or 4.2e-7 < x Initial program 87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in x around inf 84.2%
if -1.00000000000000004e-25 < x < 4.2e-7Initial program 88.4%
*-commutative88.4%
Simplified88.4%
Taylor expanded in z around inf 67.2%
+-commutative67.2%
+-commutative67.2%
Simplified67.2%
Taylor expanded in x around 0 67.2%
Taylor expanded in y around 0 67.2%
+-commutative67.2%
Simplified67.2%
Final simplification75.7%
(FPCore (x y z t) :precision binary64 (if (<= x -1e-27) 1.0 (if (<= x 5.9e-30) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-27) {
tmp = 1.0;
} else if (x <= 5.9e-30) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if (x <= (-1d-27)) then
tmp = 1.0d0
else if (x <= 5.9d-30) then
tmp = y / t
else
tmp = 1.0d0
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1e-27) {
tmp = 1.0;
} else if (x <= 5.9e-30) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1e-27: tmp = 1.0 elif x <= 5.9e-30: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1e-27) tmp = 1.0; elseif (x <= 5.9e-30) tmp = Float64(y / t); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -1e-27) tmp = 1.0; elseif (x <= 5.9e-30) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1e-27], 1.0, If[LessEqual[x, 5.9e-30], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1 \cdot 10^{-27}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 5.9 \cdot 10^{-30}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1e-27 or 5.89999999999999979e-30 < x Initial program 88.3%
*-commutative88.3%
Simplified88.3%
Taylor expanded in x around inf 82.1%
if -1e-27 < x < 5.89999999999999979e-30Initial program 87.8%
*-commutative87.8%
Simplified87.8%
Taylor expanded in x around 0 52.2%
(FPCore (x y z t) :precision binary64 1.0)
double code(double x, double y, double z, double t) {
return 1.0;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = 1.0d0
end function
public static double code(double x, double y, double z, double t) {
return 1.0;
}
def code(x, y, z, t): return 1.0
function code(x, y, z, t) return 1.0 end
function tmp = code(x, y, z, t) tmp = 1.0; end
code[x_, y_, z_, t_] := 1.0
\begin{array}{l}
\\
1
\end{array}
Initial program 88.1%
*-commutative88.1%
Simplified88.1%
Taylor expanded in x around inf 50.2%
(FPCore (x y z t) :precision binary64 (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0)))
double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
code = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0d0)
end function
public static double code(double x, double y, double z, double t) {
return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0);
}
def code(x, y, z, t): return (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0)
function code(x, y, z, t) return Float64(Float64(x + Float64(Float64(y / Float64(t - Float64(x / z))) - Float64(x / Float64(Float64(t * z) - x)))) / Float64(x + 1.0)) end
function tmp = code(x, y, z, t) tmp = (x + ((y / (t - (x / z))) - (x / ((t * z) - x)))) / (x + 1.0); end
code[x_, y_, z_, t_] := N[(N[(x + N[(N[(y / N[(t - N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] - N[(x / N[(N[(t * z), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
\frac{x + \left(\frac{y}{t - \frac{x}{z}} - \frac{x}{t \cdot z - x}\right)}{x + 1}
\end{array}
herbie shell --seed 2024135
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:alt
(! :herbie-platform default (/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1)))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))