
(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 11 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+181)
(* (/ z t_1) (/ y (+ x 1.0)))
(if (<= t_2 2e+208) 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+181) {
tmp = (z / t_1) * (y / (x + 1.0));
} else if (t_2 <= 2e+208) {
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+181)) then
tmp = (z / t_1) * (y / (x + 1.0d0))
else if (t_2 <= 2d+208) 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+181) {
tmp = (z / t_1) * (y / (x + 1.0));
} else if (t_2 <= 2e+208) {
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+181: tmp = (z / t_1) * (y / (x + 1.0)) elif t_2 <= 2e+208: 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+181) tmp = Float64(Float64(z / t_1) * Float64(y / Float64(x + 1.0))); elseif (t_2 <= 2e+208) 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+181) tmp = (z / t_1) * (y / (x + 1.0)); elseif (t_2 <= 2e+208) 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+181], N[(N[(z / t$95$1), $MachinePrecision] * N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$2, 2e+208], 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^{+181}:\\
\;\;\;\;\frac{z}{t\_1} \cdot \frac{y}{x + 1}\\
\mathbf{elif}\;t\_2 \leq 2 \cdot 10^{+208}:\\
\;\;\;\;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.9999999999999998e181Initial program 39.9%
*-commutative39.9%
Simplified39.9%
Taylor expanded in y around inf 39.3%
*-commutative39.3%
+-commutative39.3%
*-commutative39.3%
times-frac81.5%
Applied egg-rr81.5%
if -1.9999999999999998e181 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) < 2e208Initial program 99.4%
if 2e208 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x #s(literal 1 binary64))) Initial program 42.4%
*-commutative42.4%
Simplified42.4%
Taylor expanded in z around inf 83.1%
+-commutative83.1%
+-commutative83.1%
Simplified83.1%
Final simplification97.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.45e-49) (not (<= t 5.9e-92))) (/ (+ x (/ y t)) (+ x 1.0)) (/ (- 1.0 (- (/ y (/ x z)) x)) (+ x 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.45e-49) || !(t <= 5.9e-92)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 - ((y / (x / 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-49)) .or. (.not. (t <= 5.9d-92))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = (1.0d0 - ((y / (x / 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-49) || !(t <= 5.9e-92)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = (1.0 - ((y / (x / z)) - x)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.45e-49) or not (t <= 5.9e-92): tmp = (x + (y / t)) / (x + 1.0) else: tmp = (1.0 - ((y / (x / z)) - x)) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.45e-49) || !(t <= 5.9e-92)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(1.0 - Float64(Float64(y / Float64(x / 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-49) || ~((t <= 5.9e-92))) tmp = (x + (y / t)) / (x + 1.0); else tmp = (1.0 - ((y / (x / z)) - x)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.45e-49], N[Not[LessEqual[t, 5.9e-92]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.45 \cdot 10^{-49} \lor \neg \left(t \leq 5.9 \cdot 10^{-92}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{1 - \left(\frac{y}{\frac{x}{z}} - x\right)}{x + 1}\\
\end{array}
\end{array}
if t < -1.45e-49 or 5.9e-92 < t Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around inf 85.8%
+-commutative85.8%
+-commutative85.8%
Simplified85.8%
if -1.45e-49 < t < 5.9e-92Initial program 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in t around 0 76.1%
mul-1-neg76.1%
unsub-neg76.1%
associate-/l*80.9%
+-commutative80.9%
Simplified80.9%
clear-num80.9%
un-div-inv80.9%
Applied egg-rr80.9%
Final simplification83.9%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.5e-50) (not (<= t 1.48e-92))) (/ (+ 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 <= -8.5e-50) || !(t <= 1.48e-92)) {
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 <= (-8.5d-50)) .or. (.not. (t <= 1.48d-92))) 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 <= -8.5e-50) || !(t <= 1.48e-92)) {
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 <= -8.5e-50) or not (t <= 1.48e-92): 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 <= -8.5e-50) || !(t <= 1.48e-92)) 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 <= -8.5e-50) || ~((t <= 1.48e-92))) 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, -8.5e-50], N[Not[LessEqual[t, 1.48e-92]], $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 -8.5 \cdot 10^{-50} \lor \neg \left(t \leq 1.48 \cdot 10^{-92}\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 < -8.50000000000000012e-50 or 1.48000000000000001e-92 < t Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around inf 85.8%
+-commutative85.8%
+-commutative85.8%
Simplified85.8%
if -8.50000000000000012e-50 < t < 1.48000000000000001e-92Initial program 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in t around 0 76.1%
mul-1-neg76.1%
unsub-neg76.1%
associate-/l*80.9%
+-commutative80.9%
Simplified80.9%
Final simplification83.9%
(FPCore (x y z t)
:precision binary64
(if (<= x -8.5e-35)
(/ (+ 1.0 (- x (/ y (/ x z)))) (+ x 1.0))
(if (<= x 1.65e-66)
(/ (+ x (/ (- y (/ x z)) t)) (+ x 1.0))
(/ (- x (/ x (- (* z t) x))) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -8.5e-35) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} else if (x <= 1.65e-66) {
tmp = (x + ((y - (x / z)) / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - 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 (x <= (-8.5d-35)) then
tmp = (1.0d0 + (x - (y / (x / z)))) / (x + 1.0d0)
else if (x <= 1.65d-66) then
tmp = (x + ((y - (x / z)) / t)) / (x + 1.0d0)
else
tmp = (x - (x / ((z * t) - 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 (x <= -8.5e-35) {
tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0);
} else if (x <= 1.65e-66) {
tmp = (x + ((y - (x / z)) / t)) / (x + 1.0);
} else {
tmp = (x - (x / ((z * t) - x))) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -8.5e-35: tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0) elif x <= 1.65e-66: tmp = (x + ((y - (x / z)) / t)) / (x + 1.0) else: tmp = (x - (x / ((z * t) - x))) / (x + 1.0) return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -8.5e-35) tmp = Float64(Float64(1.0 + Float64(x - Float64(y / Float64(x / z)))) / Float64(x + 1.0)); elseif (x <= 1.65e-66) tmp = Float64(Float64(x + Float64(Float64(y - Float64(x / z)) / t)) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / Float64(Float64(z * t) - x))) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -8.5e-35) tmp = (1.0 + (x - (y / (x / z)))) / (x + 1.0); elseif (x <= 1.65e-66) tmp = (x + ((y - (x / z)) / t)) / (x + 1.0); else tmp = (x - (x / ((z * t) - x))) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -8.5e-35], N[(N[(1.0 + N[(x - N[(y / N[(x / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 1.65e-66], N[(N[(x + N[(N[(y - N[(x / z), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -8.5 \cdot 10^{-35}:\\
\;\;\;\;\frac{1 + \left(x - \frac{y}{\frac{x}{z}}\right)}{x + 1}\\
\mathbf{elif}\;x \leq 1.65 \cdot 10^{-66}:\\
\;\;\;\;\frac{x + \frac{y - \frac{x}{z}}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{z \cdot t - x}}{x + 1}\\
\end{array}
\end{array}
if x < -8.5000000000000001e-35Initial program 86.6%
*-commutative86.6%
Simplified86.6%
Taylor expanded in t around 0 80.1%
mul-1-neg80.1%
unsub-neg80.1%
associate-/l*88.6%
+-commutative88.6%
Simplified88.6%
clear-num88.6%
un-div-inv88.6%
Applied egg-rr88.6%
if -8.5000000000000001e-35 < x < 1.6499999999999999e-66Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in t around -inf 78.7%
mul-1-neg78.7%
unsub-neg78.7%
sub-neg78.7%
mul-1-neg78.7%
remove-double-neg78.7%
+-commutative78.7%
mul-1-neg78.7%
unsub-neg78.7%
Simplified78.7%
if 1.6499999999999999e-66 < x Initial program 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in y around 0 91.5%
+-commutative91.5%
Simplified91.5%
Final simplification85.5%
(FPCore (x y z t)
:precision binary64
(if (<= x -6.8e-74)
1.0
(if (<= x 3.9e-211)
(/ y (* t (- (- x) -1.0)))
(if (<= x 4e-65) (- x (/ x (* z t))) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -6.8e-74) {
tmp = 1.0;
} else if (x <= 3.9e-211) {
tmp = y / (t * (-x - -1.0));
} else if (x <= 4e-65) {
tmp = x - (x / (z * 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 <= (-6.8d-74)) then
tmp = 1.0d0
else if (x <= 3.9d-211) then
tmp = y / (t * (-x - (-1.0d0)))
else if (x <= 4d-65) then
tmp = x - (x / (z * 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 <= -6.8e-74) {
tmp = 1.0;
} else if (x <= 3.9e-211) {
tmp = y / (t * (-x - -1.0));
} else if (x <= 4e-65) {
tmp = x - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -6.8e-74: tmp = 1.0 elif x <= 3.9e-211: tmp = y / (t * (-x - -1.0)) elif x <= 4e-65: tmp = x - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -6.8e-74) tmp = 1.0; elseif (x <= 3.9e-211) tmp = Float64(y / Float64(t * Float64(Float64(-x) - -1.0))); elseif (x <= 4e-65) tmp = Float64(x - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -6.8e-74) tmp = 1.0; elseif (x <= 3.9e-211) tmp = y / (t * (-x - -1.0)); elseif (x <= 4e-65) tmp = x - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -6.8e-74], 1.0, If[LessEqual[x, 3.9e-211], N[(y / N[(t * N[((-x) - -1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4e-65], N[(x - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -6.8 \cdot 10^{-74}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 3.9 \cdot 10^{-211}:\\
\;\;\;\;\frac{y}{t \cdot \left(\left(-x\right) - -1\right)}\\
\mathbf{elif}\;x \leq 4 \cdot 10^{-65}:\\
\;\;\;\;x - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -6.8000000000000001e-74 or 3.99999999999999969e-65 < x Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around inf 82.2%
if -6.8000000000000001e-74 < x < 3.8999999999999996e-211Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in z around inf 76.2%
+-commutative76.2%
+-commutative76.2%
Simplified76.2%
Taylor expanded in y around inf 63.0%
+-commutative63.0%
Simplified63.0%
frac-2neg63.0%
div-inv62.8%
distribute-rgt-neg-in62.8%
distribute-neg-in62.8%
add-sqr-sqrt37.8%
sqrt-unprod62.8%
sqr-neg62.8%
sqrt-unprod25.0%
add-sqr-sqrt62.8%
metadata-eval62.8%
Applied egg-rr62.8%
distribute-lft-neg-out62.8%
associate-*r/63.0%
*-rgt-identity63.0%
distribute-neg-frac263.0%
*-commutative63.0%
distribute-rgt-neg-in63.0%
Simplified63.0%
if 3.8999999999999996e-211 < x < 3.99999999999999969e-65Initial program 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in t around -inf 68.4%
mul-1-neg68.4%
unsub-neg68.4%
sub-neg68.4%
mul-1-neg68.4%
remove-double-neg68.4%
+-commutative68.4%
mul-1-neg68.4%
unsub-neg68.4%
Simplified68.4%
Taylor expanded in x around inf 49.1%
Taylor expanded in x around 0 48.9%
sub-neg48.9%
distribute-lft-in48.9%
*-rgt-identity48.9%
distribute-rgt-neg-in48.9%
*-commutative48.9%
associate-*r/49.2%
associate-*l/49.2%
*-rgt-identity49.2%
unsub-neg49.2%
Simplified49.2%
Final simplification73.7%
(FPCore (x y z t) :precision binary64 (if (<= x -7.6e-74) 1.0 (if (<= x 7.1e-211) (/ y t) (if (<= x 1.62e-63) (- x (/ x (* z t))) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -7.6e-74) {
tmp = 1.0;
} else if (x <= 7.1e-211) {
tmp = y / t;
} else if (x <= 1.62e-63) {
tmp = x - (x / (z * 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 <= (-7.6d-74)) then
tmp = 1.0d0
else if (x <= 7.1d-211) then
tmp = y / t
else if (x <= 1.62d-63) then
tmp = x - (x / (z * 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 <= -7.6e-74) {
tmp = 1.0;
} else if (x <= 7.1e-211) {
tmp = y / t;
} else if (x <= 1.62e-63) {
tmp = x - (x / (z * t));
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -7.6e-74: tmp = 1.0 elif x <= 7.1e-211: tmp = y / t elif x <= 1.62e-63: tmp = x - (x / (z * t)) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -7.6e-74) tmp = 1.0; elseif (x <= 7.1e-211) tmp = Float64(y / t); elseif (x <= 1.62e-63) tmp = Float64(x - Float64(x / Float64(z * t))); else tmp = 1.0; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -7.6e-74) tmp = 1.0; elseif (x <= 7.1e-211) tmp = y / t; elseif (x <= 1.62e-63) tmp = x - (x / (z * t)); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -7.6e-74], 1.0, If[LessEqual[x, 7.1e-211], N[(y / t), $MachinePrecision], If[LessEqual[x, 1.62e-63], N[(x - N[(x / N[(z * t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -7.6 \cdot 10^{-74}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 7.1 \cdot 10^{-211}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 1.62 \cdot 10^{-63}:\\
\;\;\;\;x - \frac{x}{z \cdot t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -7.5999999999999993e-74 or 1.6200000000000001e-63 < x Initial program 92.7%
*-commutative92.7%
Simplified92.7%
Taylor expanded in x around inf 82.2%
if -7.5999999999999993e-74 < x < 7.09999999999999987e-211Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x around 0 63.0%
if 7.09999999999999987e-211 < x < 1.6200000000000001e-63Initial program 98.8%
*-commutative98.8%
Simplified98.8%
Taylor expanded in t around -inf 68.4%
mul-1-neg68.4%
unsub-neg68.4%
sub-neg68.4%
mul-1-neg68.4%
remove-double-neg68.4%
+-commutative68.4%
mul-1-neg68.4%
unsub-neg68.4%
Simplified68.4%
Taylor expanded in x around inf 49.1%
Taylor expanded in x around 0 48.9%
sub-neg48.9%
distribute-lft-in48.9%
*-rgt-identity48.9%
distribute-rgt-neg-in48.9%
*-commutative48.9%
associate-*r/49.2%
associate-*l/49.2%
*-rgt-identity49.2%
unsub-neg49.2%
Simplified49.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.5e-49) (not (<= t 1.42e-91))) (/ (+ x (/ y t)) (+ x 1.0)) (- 1.0 (* y (/ z (* x (+ x 1.0)))))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.5e-49) || !(t <= 1.42e-91)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (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 <= (-8.5d-49)) .or. (.not. (t <= 1.42d-91))) then
tmp = (x + (y / t)) / (x + 1.0d0)
else
tmp = 1.0d0 - (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 <= -8.5e-49) || !(t <= 1.42e-91)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0 - (y * (z / (x * (x + 1.0))));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.5e-49) or not (t <= 1.42e-91): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 - (y * (z / (x * (x + 1.0)))) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.5e-49) || !(t <= 1.42e-91)) tmp = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)); else tmp = Float64(1.0 - Float64(y * Float64(z / Float64(x * Float64(x + 1.0))))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.5e-49) || ~((t <= 1.42e-91))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0 - (y * (z / (x * (x + 1.0)))); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.5e-49], N[Not[LessEqual[t, 1.42e-91]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(1.0 - N[(y * N[(z / N[(x * N[(x + 1.0), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.5 \cdot 10^{-49} \lor \neg \left(t \leq 1.42 \cdot 10^{-91}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1 - y \cdot \frac{z}{x \cdot \left(x + 1\right)}\\
\end{array}
\end{array}
if t < -8.50000000000000069e-49 or 1.4199999999999999e-91 < t Initial program 91.1%
*-commutative91.1%
Simplified91.1%
Taylor expanded in z around inf 85.8%
+-commutative85.8%
+-commutative85.8%
Simplified85.8%
if -8.50000000000000069e-49 < t < 1.4199999999999999e-91Initial program 93.2%
*-commutative93.2%
Simplified93.2%
Taylor expanded in t around 0 76.1%
mul-1-neg76.1%
unsub-neg76.1%
associate-/l*80.9%
+-commutative80.9%
Simplified80.9%
Taylor expanded in y around 0 76.0%
mul-1-neg76.0%
sub-neg76.0%
associate-/l*78.9%
+-commutative78.9%
Simplified78.9%
Final simplification83.1%
(FPCore (x y z t) :precision binary64 (if (<= x -1.35e-73) 1.0 (if (<= x 7.1e-211) (/ y t) (if (<= x 1.02e-75) (/ x (+ x 1.0)) 1.0))))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.35e-73) {
tmp = 1.0;
} else if (x <= 7.1e-211) {
tmp = y / t;
} else if (x <= 1.02e-75) {
tmp = x / (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 <= (-1.35d-73)) then
tmp = 1.0d0
else if (x <= 7.1d-211) then
tmp = y / t
else if (x <= 1.02d-75) then
tmp = x / (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 <= -1.35e-73) {
tmp = 1.0;
} else if (x <= 7.1e-211) {
tmp = y / t;
} else if (x <= 1.02e-75) {
tmp = x / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.35e-73: tmp = 1.0 elif x <= 7.1e-211: tmp = y / t elif x <= 1.02e-75: tmp = x / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.35e-73) tmp = 1.0; elseif (x <= 7.1e-211) tmp = Float64(y / t); elseif (x <= 1.02e-75) tmp = Float64(x / 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 <= -1.35e-73) tmp = 1.0; elseif (x <= 7.1e-211) tmp = y / t; elseif (x <= 1.02e-75) tmp = x / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.35e-73], 1.0, If[LessEqual[x, 7.1e-211], N[(y / t), $MachinePrecision], If[LessEqual[x, 1.02e-75], N[(x / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.35 \cdot 10^{-73}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 7.1 \cdot 10^{-211}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{elif}\;x \leq 1.02 \cdot 10^{-75}:\\
\;\;\;\;\frac{x}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.34999999999999997e-73 or 1.01999999999999997e-75 < x Initial program 92.8%
*-commutative92.8%
Simplified92.8%
Taylor expanded in x around inf 81.2%
if -1.34999999999999997e-73 < x < 7.09999999999999987e-211Initial program 87.5%
*-commutative87.5%
Simplified87.5%
Taylor expanded in x around 0 63.0%
if 7.09999999999999987e-211 < x < 1.01999999999999997e-75Initial program 98.7%
*-commutative98.7%
Simplified98.7%
Taylor expanded in t around inf 45.1%
+-commutative45.1%
Simplified45.1%
(FPCore (x y z t) :precision binary64 (if (<= x -0.00125) 1.0 (if (<= x 9.6e-51) (/ (+ x (/ y t)) (+ x 1.0)) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -0.00125) {
tmp = 1.0;
} else if (x <= 9.6e-51) {
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 <= (-0.00125d0)) then
tmp = 1.0d0
else if (x <= 9.6d-51) 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 <= -0.00125) {
tmp = 1.0;
} else if (x <= 9.6e-51) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -0.00125: tmp = 1.0 elif x <= 9.6e-51: tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -0.00125) tmp = 1.0; elseif (x <= 9.6e-51) 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 <= -0.00125) tmp = 1.0; elseif (x <= 9.6e-51) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -0.00125], 1.0, If[LessEqual[x, 9.6e-51], 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 -0.00125:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 9.6 \cdot 10^{-51}:\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -0.00125000000000000003 or 9.6000000000000001e-51 < x Initial program 92.6%
*-commutative92.6%
Simplified92.6%
Taylor expanded in x around inf 88.2%
if -0.00125000000000000003 < x < 9.6000000000000001e-51Initial program 91.0%
*-commutative91.0%
Simplified91.0%
Taylor expanded in z around inf 67.6%
+-commutative67.6%
+-commutative67.6%
Simplified67.6%
Final simplification79.2%
(FPCore (x y z t) :precision binary64 (if (<= x -1.32e-73) 1.0 (if (<= x 4.5e-84) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -1.32e-73) {
tmp = 1.0;
} else if (x <= 4.5e-84) {
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 <= (-1.32d-73)) then
tmp = 1.0d0
else if (x <= 4.5d-84) 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 <= -1.32e-73) {
tmp = 1.0;
} else if (x <= 4.5e-84) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -1.32e-73: tmp = 1.0 elif x <= 4.5e-84: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -1.32e-73) tmp = 1.0; elseif (x <= 4.5e-84) 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 <= -1.32e-73) tmp = 1.0; elseif (x <= 4.5e-84) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -1.32e-73], 1.0, If[LessEqual[x, 4.5e-84], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -1.32 \cdot 10^{-73}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 4.5 \cdot 10^{-84}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -1.31999999999999998e-73 or 4.50000000000000016e-84 < x Initial program 93.0%
*-commutative93.0%
Simplified93.0%
Taylor expanded in x around inf 79.9%
if -1.31999999999999998e-73 < x < 4.50000000000000016e-84Initial program 90.0%
*-commutative90.0%
Simplified90.0%
Taylor expanded in x around 0 54.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 91.9%
*-commutative91.9%
Simplified91.9%
Taylor expanded in x around inf 57.5%
(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 2024123
(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)))