
(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 10 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 (/ z (/ t_1 y))) (+ x 1.0)))
(t_3 (/ (+ x (/ (- (* y z) x) t_1)) (+ x 1.0))))
(if (<= t_3 -6e-46)
t_2
(if (<= t_3 4e+265)
t_3
(if (<= t_3 INFINITY) 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 + (z / (t_1 / y))) / (x + 1.0);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -6e-46) {
tmp = t_2;
} else if (t_3 <= 4e+265) {
tmp = t_3;
} else if (t_3 <= ((double) INFINITY)) {
tmp = t_2;
} else {
tmp = (x + (y / t)) / (x + 1.0);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (z / (t_1 / y))) / (x + 1.0);
double t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0);
double tmp;
if (t_3 <= -6e-46) {
tmp = t_2;
} else if (t_3 <= 4e+265) {
tmp = t_3;
} else if (t_3 <= Double.POSITIVE_INFINITY) {
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 + (z / (t_1 / y))) / (x + 1.0) t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0) tmp = 0 if t_3 <= -6e-46: tmp = t_2 elif t_3 <= 4e+265: tmp = t_3 elif t_3 <= math.inf: 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(z / Float64(t_1 / y))) / Float64(x + 1.0)) t_3 = Float64(Float64(x + Float64(Float64(Float64(y * z) - x) / t_1)) / Float64(x + 1.0)) tmp = 0.0 if (t_3 <= -6e-46) tmp = t_2; elseif (t_3 <= 4e+265) tmp = t_3; elseif (t_3 <= Inf) 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 + (z / (t_1 / y))) / (x + 1.0); t_3 = (x + (((y * z) - x) / t_1)) / (x + 1.0); tmp = 0.0; if (t_3 <= -6e-46) tmp = t_2; elseif (t_3 <= 4e+265) tmp = t_3; elseif (t_3 <= Inf) 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[(z / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$3 = 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$3, -6e-46], t$95$2, If[LessEqual[t$95$3, 4e+265], t$95$3, If[LessEqual[t$95$3, Infinity], 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{z}{\frac{t_1}{y}}}{x + 1}\\
t_3 := \frac{x + \frac{y \cdot z - x}{t_1}}{x + 1}\\
\mathbf{if}\;t_3 \leq -6 \cdot 10^{-46}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t_3 \leq 4 \cdot 10^{+265}:\\
\;\;\;\;t_3\\
\mathbf{elif}\;t_3 \leq \infty:\\
\;\;\;\;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 1)) < -5.99999999999999975e-46 or 4.00000000000000027e265 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < +inf.0Initial program 67.3%
*-commutative67.3%
Simplified67.3%
Taylor expanded in y around inf 67.3%
*-commutative67.3%
associate-*l/97.9%
*-commutative97.9%
*-commutative97.9%
Simplified97.9%
clear-num97.9%
un-div-inv98.1%
*-commutative98.1%
Applied egg-rr98.1%
if -5.99999999999999975e-46 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) < 4.00000000000000027e265Initial program 99.4%
if +inf.0 < (/.f64 (+.f64 x (/.f64 (-.f64 (*.f64 y z) x) (-.f64 (*.f64 t z) x))) (+.f64 x 1)) Initial program 0.0%
*-commutative0.0%
Simplified0.0%
Taylor expanded in z around inf 100.0%
Final simplification99.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -1.16e-143)
t_1
(if (<= t -1.2e-288)
(/ (- x (* z (/ y x))) (+ x 1.0))
(if (<= t 5.6e-285)
1.0
(if (<= t 1.5e-201)
(* (/ y (+ x 1.0)) (/ z (- (* z t) x)))
(if (<= t 5.4e-151) 1.0 t_1)))))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.16e-143) {
tmp = t_1;
} else if (t <= -1.2e-288) {
tmp = (x - (z * (y / x))) / (x + 1.0);
} else if (t <= 5.6e-285) {
tmp = 1.0;
} else if (t <= 1.5e-201) {
tmp = (y / (x + 1.0)) * (z / ((z * t) - x));
} else if (t <= 5.4e-151) {
tmp = 1.0;
} else {
tmp = t_1;
}
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) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-1.16d-143)) then
tmp = t_1
else if (t <= (-1.2d-288)) then
tmp = (x - (z * (y / x))) / (x + 1.0d0)
else if (t <= 5.6d-285) then
tmp = 1.0d0
else if (t <= 1.5d-201) then
tmp = (y / (x + 1.0d0)) * (z / ((z * t) - x))
else if (t <= 5.4d-151) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -1.16e-143) {
tmp = t_1;
} else if (t <= -1.2e-288) {
tmp = (x - (z * (y / x))) / (x + 1.0);
} else if (t <= 5.6e-285) {
tmp = 1.0;
} else if (t <= 1.5e-201) {
tmp = (y / (x + 1.0)) * (z / ((z * t) - x));
} else if (t <= 5.4e-151) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -1.16e-143: tmp = t_1 elif t <= -1.2e-288: tmp = (x - (z * (y / x))) / (x + 1.0) elif t <= 5.6e-285: tmp = 1.0 elif t <= 1.5e-201: tmp = (y / (x + 1.0)) * (z / ((z * t) - x)) elif t <= 5.4e-151: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -1.16e-143) tmp = t_1; elseif (t <= -1.2e-288) tmp = Float64(Float64(x - Float64(z * Float64(y / x))) / Float64(x + 1.0)); elseif (t <= 5.6e-285) tmp = 1.0; elseif (t <= 1.5e-201) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / Float64(Float64(z * t) - x))); elseif (t <= 5.4e-151) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -1.16e-143) tmp = t_1; elseif (t <= -1.2e-288) tmp = (x - (z * (y / x))) / (x + 1.0); elseif (t <= 5.6e-285) tmp = 1.0; elseif (t <= 1.5e-201) tmp = (y / (x + 1.0)) * (z / ((z * t) - x)); elseif (t <= 5.4e-151) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -1.16e-143], t$95$1, If[LessEqual[t, -1.2e-288], N[(N[(x - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.6e-285], 1.0, If[LessEqual[t, 1.5e-201], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-151], 1.0, t$95$1]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -1.16 \cdot 10^{-143}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -1.2 \cdot 10^{-288}:\\
\;\;\;\;\frac{x - z \cdot \frac{y}{x}}{x + 1}\\
\mathbf{elif}\;t \leq 5.6 \cdot 10^{-285}:\\
\;\;\;\;1\\
\mathbf{elif}\;t \leq 1.5 \cdot 10^{-201}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{z \cdot t - x}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-151}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -1.16000000000000008e-143 or 5.40000000000000014e-151 < t Initial program 84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in z around inf 85.7%
if -1.16000000000000008e-143 < t < -1.1999999999999999e-288Initial program 92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
associate-*l/79.2%
*-commutative79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in t around 0 71.8%
mul-1-neg71.8%
distribute-frac-neg71.8%
Simplified71.8%
distribute-frac-neg71.8%
add-sqr-sqrt41.8%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod18.8%
add-sqr-sqrt38.2%
distribute-rgt-neg-in38.2%
sub-neg38.2%
clear-num38.2%
clear-num38.2%
add-sqr-sqrt18.8%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod41.8%
add-sqr-sqrt71.8%
Applied egg-rr71.8%
if -1.1999999999999999e-288 < t < 5.59999999999999982e-285 or 1.50000000000000001e-201 < t < 5.40000000000000014e-151Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 57.0%
*-commutative57.0%
associate-*l/57.0%
*-commutative57.0%
*-commutative57.0%
Simplified57.0%
Taylor expanded in x around inf 88.3%
if 5.59999999999999982e-285 < t < 1.50000000000000001e-201Initial program 90.1%
*-commutative90.1%
Simplified90.1%
Taylor expanded in y around inf 56.4%
times-frac65.6%
+-commutative65.6%
Simplified65.6%
Final simplification82.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (- (+ x 1.0) (/ (* y z) x)) (+ x 1.0)))
(t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -3e-143)
t_2
(if (<= t 2.3e-260)
t_1
(if (<= t 2.8e-205)
(* (/ y (+ x 1.0)) (/ z (- (* z t) x)))
(if (<= t 1.12e-150) t_1 t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = ((x + 1.0) - ((y * z) / x)) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -3e-143) {
tmp = t_2;
} else if (t <= 2.3e-260) {
tmp = t_1;
} else if (t <= 2.8e-205) {
tmp = (y / (x + 1.0)) * (z / ((z * t) - x));
} else if (t <= 1.12e-150) {
tmp = t_1;
} else {
tmp = t_2;
}
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 = ((x + 1.0d0) - ((y * z) / x)) / (x + 1.0d0)
t_2 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-3d-143)) then
tmp = t_2
else if (t <= 2.3d-260) then
tmp = t_1
else if (t <= 2.8d-205) then
tmp = (y / (x + 1.0d0)) * (z / ((z * t) - x))
else if (t <= 1.12d-150) then
tmp = t_1
else
tmp = t_2
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = ((x + 1.0) - ((y * z) / x)) / (x + 1.0);
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -3e-143) {
tmp = t_2;
} else if (t <= 2.3e-260) {
tmp = t_1;
} else if (t <= 2.8e-205) {
tmp = (y / (x + 1.0)) * (z / ((z * t) - x));
} else if (t <= 1.12e-150) {
tmp = t_1;
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((x + 1.0) - ((y * z) / x)) / (x + 1.0) t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -3e-143: tmp = t_2 elif t <= 2.3e-260: tmp = t_1 elif t <= 2.8e-205: tmp = (y / (x + 1.0)) * (z / ((z * t) - x)) elif t <= 1.12e-150: tmp = t_1 else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(x + 1.0) - Float64(Float64(y * z) / x)) / Float64(x + 1.0)) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -3e-143) tmp = t_2; elseif (t <= 2.3e-260) tmp = t_1; elseif (t <= 2.8e-205) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / Float64(Float64(z * t) - x))); elseif (t <= 1.12e-150) tmp = t_1; else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((x + 1.0) - ((y * z) / x)) / (x + 1.0); t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -3e-143) tmp = t_2; elseif (t <= 2.3e-260) tmp = t_1; elseif (t <= 2.8e-205) tmp = (y / (x + 1.0)) * (z / ((z * t) - x)); elseif (t <= 1.12e-150) tmp = t_1; else tmp = t_2; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(x + 1.0), $MachinePrecision] - N[(N[(y * z), $MachinePrecision] / x), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -3e-143], t$95$2, If[LessEqual[t, 2.3e-260], t$95$1, If[LessEqual[t, 2.8e-205], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.12e-150], t$95$1, t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{\left(x + 1\right) - \frac{y \cdot z}{x}}{x + 1}\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -3 \cdot 10^{-143}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;t \leq 2.3 \cdot 10^{-260}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq 2.8 \cdot 10^{-205}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{z \cdot t - x}\\
\mathbf{elif}\;t \leq 1.12 \cdot 10^{-150}:\\
\;\;\;\;t_1\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if t < -2.99999999999999985e-143 or 1.12e-150 < t Initial program 84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in z around inf 85.7%
if -2.99999999999999985e-143 < t < 2.3e-260 or 2.79999999999999991e-205 < t < 1.12e-150Initial program 96.6%
*-commutative96.6%
Simplified96.6%
Taylor expanded in t around 0 91.6%
associate-+r+91.6%
+-commutative91.6%
associate-*r/91.6%
mul-1-neg91.6%
*-commutative91.6%
+-commutative91.6%
Simplified91.6%
if 2.3e-260 < t < 2.79999999999999991e-205Initial program 83.8%
*-commutative83.8%
Simplified83.8%
Taylor expanded in y around inf 59.5%
times-frac74.8%
+-commutative74.8%
Simplified74.8%
Final simplification86.6%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)) (t_2 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= z -3.1e-50)
t_2
(if (<= z 3.3e-28)
(/ (- x (/ x t_1)) (+ x 1.0))
(if (<= z 5.5e-18)
(* (/ y (+ x 1.0)) (/ z t_1))
(if (<= z 2.2e+66) (/ (- x (* z (/ y x))) (+ x 1.0)) t_2))))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double t_2 = (x + (y / t)) / (x + 1.0);
double tmp;
if (z <= -3.1e-50) {
tmp = t_2;
} else if (z <= 3.3e-28) {
tmp = (x - (x / t_1)) / (x + 1.0);
} else if (z <= 5.5e-18) {
tmp = (y / (x + 1.0)) * (z / t_1);
} else if (z <= 2.2e+66) {
tmp = (x - (z * (y / x))) / (x + 1.0);
} else {
tmp = t_2;
}
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 / t)) / (x + 1.0d0)
if (z <= (-3.1d-50)) then
tmp = t_2
else if (z <= 3.3d-28) then
tmp = (x - (x / t_1)) / (x + 1.0d0)
else if (z <= 5.5d-18) then
tmp = (y / (x + 1.0d0)) * (z / t_1)
else if (z <= 2.2d+66) then
tmp = (x - (z * (y / x))) / (x + 1.0d0)
else
tmp = t_2
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 / t)) / (x + 1.0);
double tmp;
if (z <= -3.1e-50) {
tmp = t_2;
} else if (z <= 3.3e-28) {
tmp = (x - (x / t_1)) / (x + 1.0);
} else if (z <= 5.5e-18) {
tmp = (y / (x + 1.0)) * (z / t_1);
} else if (z <= 2.2e+66) {
tmp = (x - (z * (y / x))) / (x + 1.0);
} else {
tmp = t_2;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x t_2 = (x + (y / t)) / (x + 1.0) tmp = 0 if z <= -3.1e-50: tmp = t_2 elif z <= 3.3e-28: tmp = (x - (x / t_1)) / (x + 1.0) elif z <= 5.5e-18: tmp = (y / (x + 1.0)) * (z / t_1) elif z <= 2.2e+66: tmp = (x - (z * (y / x))) / (x + 1.0) else: tmp = t_2 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) t_2 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (z <= -3.1e-50) tmp = t_2; elseif (z <= 3.3e-28) tmp = Float64(Float64(x - Float64(x / t_1)) / Float64(x + 1.0)); elseif (z <= 5.5e-18) tmp = Float64(Float64(y / Float64(x + 1.0)) * Float64(z / t_1)); elseif (z <= 2.2e+66) tmp = Float64(Float64(x - Float64(z * Float64(y / x))) / Float64(x + 1.0)); else tmp = t_2; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; t_2 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (z <= -3.1e-50) tmp = t_2; elseif (z <= 3.3e-28) tmp = (x - (x / t_1)) / (x + 1.0); elseif (z <= 5.5e-18) tmp = (y / (x + 1.0)) * (z / t_1); elseif (z <= 2.2e+66) tmp = (x - (z * (y / x))) / (x + 1.0); else tmp = t_2; 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[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -3.1e-50], t$95$2, If[LessEqual[z, 3.3e-28], N[(N[(x - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 5.5e-18], N[(N[(y / N[(x + 1.0), $MachinePrecision]), $MachinePrecision] * N[(z / t$95$1), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+66], N[(N[(x - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], t$95$2]]]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
t_2 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;z \leq -3.1 \cdot 10^{-50}:\\
\;\;\;\;t_2\\
\mathbf{elif}\;z \leq 3.3 \cdot 10^{-28}:\\
\;\;\;\;\frac{x - \frac{x}{t_1}}{x + 1}\\
\mathbf{elif}\;z \leq 5.5 \cdot 10^{-18}:\\
\;\;\;\;\frac{y}{x + 1} \cdot \frac{z}{t_1}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+66}:\\
\;\;\;\;\frac{x - z \cdot \frac{y}{x}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;t_2\\
\end{array}
\end{array}
if z < -3.1000000000000002e-50 or 2.1999999999999998e66 < z Initial program 74.4%
*-commutative74.4%
Simplified74.4%
Taylor expanded in z around inf 85.4%
if -3.1000000000000002e-50 < z < 3.3000000000000002e-28Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 81.2%
+-commutative81.2%
Simplified81.2%
if 3.3000000000000002e-28 < z < 5.5e-18Initial program 99.4%
*-commutative99.4%
Simplified99.4%
Taylor expanded in y around inf 94.2%
times-frac94.2%
+-commutative94.2%
Simplified94.2%
if 5.5e-18 < z < 2.1999999999999998e66Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
associate-*l/75.7%
*-commutative75.7%
*-commutative75.7%
Simplified75.7%
Taylor expanded in t around 0 69.3%
mul-1-neg69.3%
distribute-frac-neg69.3%
Simplified69.3%
distribute-frac-neg69.3%
add-sqr-sqrt34.7%
sqrt-unprod42.8%
sqr-neg42.8%
sqrt-unprod27.8%
add-sqr-sqrt41.9%
distribute-rgt-neg-in41.9%
sub-neg41.9%
clear-num41.9%
clear-num41.9%
add-sqr-sqrt27.8%
sqrt-unprod42.8%
sqr-neg42.8%
sqrt-unprod34.7%
add-sqr-sqrt69.3%
Applied egg-rr69.3%
Final simplification82.9%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(if (or (<= z -6.5e-207) (not (<= z 1.4e-131)))
(/ (+ x (* z (/ y t_1))) (+ x 1.0))
(/ (- x (/ x t_1)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if ((z <= -6.5e-207) || !(z <= 1.4e-131)) {
tmp = (x + (z * (y / t_1))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (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) :: tmp
t_1 = (z * t) - x
if ((z <= (-6.5d-207)) .or. (.not. (z <= 1.4d-131))) then
tmp = (x + (z * (y / t_1))) / (x + 1.0d0)
else
tmp = (x - (x / t_1)) / (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 tmp;
if ((z <= -6.5e-207) || !(z <= 1.4e-131)) {
tmp = (x + (z * (y / t_1))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x tmp = 0 if (z <= -6.5e-207) or not (z <= 1.4e-131): tmp = (x + (z * (y / t_1))) / (x + 1.0) else: tmp = (x - (x / t_1)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if ((z <= -6.5e-207) || !(z <= 1.4e-131)) tmp = Float64(Float64(x + Float64(z * Float64(y / t_1))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / t_1)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; tmp = 0.0; if ((z <= -6.5e-207) || ~((z <= 1.4e-131))) tmp = (x + (z * (y / t_1))) / (x + 1.0); else tmp = (x - (x / t_1)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[Or[LessEqual[z, -6.5e-207], N[Not[LessEqual[z, 1.4e-131]], $MachinePrecision]], N[(N[(x + N[(z * N[(y / t$95$1), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;z \leq -6.5 \cdot 10^{-207} \lor \neg \left(z \leq 1.4 \cdot 10^{-131}\right):\\
\;\;\;\;\frac{x + z \cdot \frac{y}{t_1}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{t_1}}{x + 1}\\
\end{array}
\end{array}
if z < -6.5000000000000001e-207 or 1.4e-131 < z Initial program 83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in y around inf 77.9%
*-commutative77.9%
associate-*l/88.8%
*-commutative88.8%
*-commutative88.8%
Simplified88.8%
if -6.5000000000000001e-207 < z < 1.4e-131Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 87.2%
+-commutative87.2%
Simplified87.2%
Final simplification88.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (- (* z t) x)))
(if (or (<= z -2.5e-205) (not (<= z 6.5e-129)))
(/ (+ x (/ z (/ t_1 y))) (+ x 1.0))
(/ (- x (/ x t_1)) (+ x 1.0)))))
double code(double x, double y, double z, double t) {
double t_1 = (z * t) - x;
double tmp;
if ((z <= -2.5e-205) || !(z <= 6.5e-129)) {
tmp = (x + (z / (t_1 / y))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (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) :: tmp
t_1 = (z * t) - x
if ((z <= (-2.5d-205)) .or. (.not. (z <= 6.5d-129))) then
tmp = (x + (z / (t_1 / y))) / (x + 1.0d0)
else
tmp = (x - (x / t_1)) / (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 tmp;
if ((z <= -2.5e-205) || !(z <= 6.5e-129)) {
tmp = (x + (z / (t_1 / y))) / (x + 1.0);
} else {
tmp = (x - (x / t_1)) / (x + 1.0);
}
return tmp;
}
def code(x, y, z, t): t_1 = (z * t) - x tmp = 0 if (z <= -2.5e-205) or not (z <= 6.5e-129): tmp = (x + (z / (t_1 / y))) / (x + 1.0) else: tmp = (x - (x / t_1)) / (x + 1.0) return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z * t) - x) tmp = 0.0 if ((z <= -2.5e-205) || !(z <= 6.5e-129)) tmp = Float64(Float64(x + Float64(z / Float64(t_1 / y))) / Float64(x + 1.0)); else tmp = Float64(Float64(x - Float64(x / t_1)) / Float64(x + 1.0)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z * t) - x; tmp = 0.0; if ((z <= -2.5e-205) || ~((z <= 6.5e-129))) tmp = (x + (z / (t_1 / y))) / (x + 1.0); else tmp = (x - (x / t_1)) / (x + 1.0); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z * t), $MachinePrecision] - x), $MachinePrecision]}, If[Or[LessEqual[z, -2.5e-205], N[Not[LessEqual[z, 6.5e-129]], $MachinePrecision]], N[(N[(x + N[(z / N[(t$95$1 / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], N[(N[(x - N[(x / t$95$1), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := z \cdot t - x\\
\mathbf{if}\;z \leq -2.5 \cdot 10^{-205} \lor \neg \left(z \leq 6.5 \cdot 10^{-129}\right):\\
\;\;\;\;\frac{x + \frac{z}{\frac{t_1}{y}}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;\frac{x - \frac{x}{t_1}}{x + 1}\\
\end{array}
\end{array}
if z < -2.5e-205 or 6.49999999999999952e-129 < z Initial program 83.2%
*-commutative83.2%
Simplified83.2%
Taylor expanded in y around inf 77.9%
*-commutative77.9%
associate-*l/88.8%
*-commutative88.8%
*-commutative88.8%
Simplified88.8%
clear-num88.8%
un-div-inv88.9%
*-commutative88.9%
Applied egg-rr88.9%
if -2.5e-205 < z < 6.49999999999999952e-129Initial program 99.9%
*-commutative99.9%
Simplified99.9%
Taylor expanded in y around 0 87.2%
+-commutative87.2%
Simplified87.2%
Final simplification88.5%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (/ (+ x (/ y t)) (+ x 1.0))))
(if (<= t -4.6e-144)
t_1
(if (<= t -5.5e-287)
(/ (- x (* z (/ y x))) (+ x 1.0))
(if (<= t 5.4e-151) 1.0 t_1)))))
double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4.6e-144) {
tmp = t_1;
} else if (t <= -5.5e-287) {
tmp = (x - (z * (y / x))) / (x + 1.0);
} else if (t <= 5.4e-151) {
tmp = 1.0;
} else {
tmp = t_1;
}
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) :: tmp
t_1 = (x + (y / t)) / (x + 1.0d0)
if (t <= (-4.6d-144)) then
tmp = t_1
else if (t <= (-5.5d-287)) then
tmp = (x - (z * (y / x))) / (x + 1.0d0)
else if (t <= 5.4d-151) then
tmp = 1.0d0
else
tmp = t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double t_1 = (x + (y / t)) / (x + 1.0);
double tmp;
if (t <= -4.6e-144) {
tmp = t_1;
} else if (t <= -5.5e-287) {
tmp = (x - (z * (y / x))) / (x + 1.0);
} else if (t <= 5.4e-151) {
tmp = 1.0;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (x + (y / t)) / (x + 1.0) tmp = 0 if t <= -4.6e-144: tmp = t_1 elif t <= -5.5e-287: tmp = (x - (z * (y / x))) / (x + 1.0) elif t <= 5.4e-151: tmp = 1.0 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(x + Float64(y / t)) / Float64(x + 1.0)) tmp = 0.0 if (t <= -4.6e-144) tmp = t_1; elseif (t <= -5.5e-287) tmp = Float64(Float64(x - Float64(z * Float64(y / x))) / Float64(x + 1.0)); elseif (t <= 5.4e-151) tmp = 1.0; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (x + (y / t)) / (x + 1.0); tmp = 0.0; if (t <= -4.6e-144) tmp = t_1; elseif (t <= -5.5e-287) tmp = (x - (z * (y / x))) / (x + 1.0); elseif (t <= 5.4e-151) tmp = 1.0; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t, -4.6e-144], t$95$1, If[LessEqual[t, -5.5e-287], N[(N[(x - N[(z * N[(y / x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 5.4e-151], 1.0, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{if}\;t \leq -4.6 \cdot 10^{-144}:\\
\;\;\;\;t_1\\
\mathbf{elif}\;t \leq -5.5 \cdot 10^{-287}:\\
\;\;\;\;\frac{x - z \cdot \frac{y}{x}}{x + 1}\\
\mathbf{elif}\;t \leq 5.4 \cdot 10^{-151}:\\
\;\;\;\;1\\
\mathbf{else}:\\
\;\;\;\;t_1\\
\end{array}
\end{array}
if t < -4.6e-144 or 5.40000000000000014e-151 < t Initial program 84.1%
*-commutative84.1%
Simplified84.1%
Taylor expanded in z around inf 85.7%
if -4.6e-144 < t < -5.4999999999999998e-287Initial program 92.9%
*-commutative92.9%
Simplified92.9%
Taylor expanded in y around inf 75.6%
*-commutative75.6%
associate-*l/79.2%
*-commutative79.2%
*-commutative79.2%
Simplified79.2%
Taylor expanded in t around 0 71.8%
mul-1-neg71.8%
distribute-frac-neg71.8%
Simplified71.8%
distribute-frac-neg71.8%
add-sqr-sqrt41.8%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod18.8%
add-sqr-sqrt38.2%
distribute-rgt-neg-in38.2%
sub-neg38.2%
clear-num38.2%
clear-num38.2%
add-sqr-sqrt18.8%
sqrt-unprod49.9%
sqr-neg49.9%
sqrt-unprod41.8%
add-sqr-sqrt71.8%
Applied egg-rr71.8%
if -5.4999999999999998e-287 < t < 5.40000000000000014e-151Initial program 95.4%
*-commutative95.4%
Simplified95.4%
Taylor expanded in y around inf 65.6%
*-commutative65.6%
associate-*l/70.0%
*-commutative70.0%
*-commutative70.0%
Simplified70.0%
Taylor expanded in x around inf 65.2%
Final simplification80.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -2.1e-181) (not (<= t 8.2e-151))) (/ (+ x (/ y t)) (+ x 1.0)) 1.0))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -2.1e-181) || !(t <= 8.2e-151)) {
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 ((t <= (-2.1d-181)) .or. (.not. (t <= 8.2d-151))) 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 ((t <= -2.1e-181) || !(t <= 8.2e-151)) {
tmp = (x + (y / t)) / (x + 1.0);
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -2.1e-181) or not (t <= 8.2e-151): tmp = (x + (y / t)) / (x + 1.0) else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -2.1e-181) || !(t <= 8.2e-151)) 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 ((t <= -2.1e-181) || ~((t <= 8.2e-151))) tmp = (x + (y / t)) / (x + 1.0); else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -2.1e-181], N[Not[LessEqual[t, 8.2e-151]], $MachinePrecision]], N[(N[(x + N[(y / t), $MachinePrecision]), $MachinePrecision] / N[(x + 1.0), $MachinePrecision]), $MachinePrecision], 1.0]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.1 \cdot 10^{-181} \lor \neg \left(t \leq 8.2 \cdot 10^{-151}\right):\\
\;\;\;\;\frac{x + \frac{y}{t}}{x + 1}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if t < -2.10000000000000003e-181 or 8.2000000000000002e-151 < t Initial program 84.3%
*-commutative84.3%
Simplified84.3%
Taylor expanded in z around inf 84.7%
if -2.10000000000000003e-181 < t < 8.2000000000000002e-151Initial program 95.2%
*-commutative95.2%
Simplified95.2%
Taylor expanded in y around inf 67.9%
*-commutative67.9%
associate-*l/71.1%
*-commutative71.1%
*-commutative71.1%
Simplified71.1%
Taylor expanded in x around inf 61.3%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= x -3.2e-25) 1.0 (if (<= x 7.8e-99) (/ y t) 1.0)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -3.2e-25) {
tmp = 1.0;
} else if (x <= 7.8e-99) {
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 <= (-3.2d-25)) then
tmp = 1.0d0
else if (x <= 7.8d-99) 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 <= -3.2e-25) {
tmp = 1.0;
} else if (x <= 7.8e-99) {
tmp = y / t;
} else {
tmp = 1.0;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -3.2e-25: tmp = 1.0 elif x <= 7.8e-99: tmp = y / t else: tmp = 1.0 return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -3.2e-25) tmp = 1.0; elseif (x <= 7.8e-99) 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 <= -3.2e-25) tmp = 1.0; elseif (x <= 7.8e-99) tmp = y / t; else tmp = 1.0; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -3.2e-25], 1.0, If[LessEqual[x, 7.8e-99], N[(y / t), $MachinePrecision], 1.0]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.2 \cdot 10^{-25}:\\
\;\;\;\;1\\
\mathbf{elif}\;x \leq 7.8 \cdot 10^{-99}:\\
\;\;\;\;\frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;1\\
\end{array}
\end{array}
if x < -3.2000000000000001e-25 or 7.79999999999999975e-99 < x Initial program 87.6%
*-commutative87.6%
Simplified87.6%
Taylor expanded in y around inf 80.6%
*-commutative80.6%
associate-*l/92.4%
*-commutative92.4%
*-commutative92.4%
Simplified92.4%
Taylor expanded in x around inf 81.1%
if -3.2000000000000001e-25 < x < 7.79999999999999975e-99Initial program 85.8%
*-commutative85.8%
Simplified85.8%
Taylor expanded in z around inf 68.3%
Taylor expanded in y around inf 52.9%
+-commutative52.9%
Simplified52.9%
Taylor expanded in x around 0 52.9%
Final simplification70.4%
(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 86.9%
*-commutative86.9%
Simplified86.9%
Taylor expanded in y around inf 74.9%
*-commutative74.9%
associate-*l/82.3%
*-commutative82.3%
*-commutative82.3%
Simplified82.3%
Taylor expanded in x around inf 57.0%
Final simplification57.0%
(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 2023301
(FPCore (x y z t)
:name "Diagrams.Trail:splitAtParam from diagrams-lib-1.3.0.3, A"
:precision binary64
:herbie-target
(/ (+ x (- (/ y (- t (/ x z))) (/ x (- (* t z) x)))) (+ x 1.0))
(/ (+ x (/ (- (* y z) x) (- (* t z) x))) (+ x 1.0)))