
(FPCore (x y z t) :precision binary64 (+ x (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\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)))
double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
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)
end function
public static double code(double x, double y, double z, double t) {
return x + ((y * (z - x)) / t);
}
def code(x, y, z, t): return x + ((y * (z - x)) / t)
function code(x, y, z, t) return Float64(x + Float64(Float64(y * Float64(z - x)) / t)) end
function tmp = code(x, y, z, t) tmp = x + ((y * (z - x)) / t); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - x\right)}{t}
\end{array}
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* y (- z x)) t))))
(if (<= t_1 (- INFINITY))
(+ (/ y (/ t (- z x))) x)
(if (<= t_1 5e+300) t_1 (+ x (* (/ (- z x) t) y))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = (y / (t / (z - x))) + x;
} else if (t_1 <= 5e+300) {
tmp = t_1;
} else {
tmp = x + (((z - x) / t) * y);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = (y / (t / (z - x))) + x;
} else if (t_1 <= 5e+300) {
tmp = t_1;
} else {
tmp = x + (((z - x) / t) * y);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y * (z - x)) / t) tmp = 0 if t_1 <= -math.inf: tmp = (y / (t / (z - x))) + x elif t_1 <= 5e+300: tmp = t_1 else: tmp = x + (((z - x) / t) * y) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y * Float64(z - x)) / t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(Float64(y / Float64(t / Float64(z - x))) + x); elseif (t_1 <= 5e+300) tmp = t_1; else tmp = Float64(x + Float64(Float64(Float64(z - x) / t) * y)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y * (z - x)) / t); tmp = 0.0; if (t_1 <= -Inf) tmp = (y / (t / (z - x))) + x; elseif (t_1 <= 5e+300) tmp = t_1; else tmp = x + (((z - x) / t) * y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(N[(y / N[(t / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[t$95$1, 5e+300], t$95$1, N[(x + N[(N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;\frac{y}{\frac{t}{z - x}} + x\\
\mathbf{elif}\;t\_1 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z - x}{t} \cdot y\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0Initial program 71.4%
Applied egg-rr0
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 5.00000000000000026e300Initial program 99.3%
if 5.00000000000000026e300 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 84.5%
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (* (/ (- z x) t) y))) (t_2 (+ x (/ (* y (- z x)) t)))) (if (<= t_2 (- INFINITY)) t_1 (if (<= t_2 5e+300) t_2 t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (((z - x) / t) * y);
double t_2 = x + ((y * (z - x)) / t);
double tmp;
if (t_2 <= -((double) INFINITY)) {
tmp = t_1;
} else if (t_2 <= 5e+300) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((z - x) / t) * y);
double t_2 = x + ((y * (z - x)) / t);
double tmp;
if (t_2 <= -Double.POSITIVE_INFINITY) {
tmp = t_1;
} else if (t_2 <= 5e+300) {
tmp = t_2;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((z - x) / t) * y) t_2 = x + ((y * (z - x)) / t) tmp = 0 if t_2 <= -math.inf: tmp = t_1 elif t_2 <= 5e+300: tmp = t_2 else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(z - x) / t) * y)) t_2 = Float64(x + Float64(Float64(y * Float64(z - x)) / t)) tmp = 0.0 if (t_2 <= Float64(-Inf)) tmp = t_1; elseif (t_2 <= 5e+300) tmp = t_2; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((z - x) / t) * y); t_2 = x + ((y * (z - x)) / t); tmp = 0.0; if (t_2 <= -Inf) tmp = t_1; elseif (t_2 <= 5e+300) tmp = t_2; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]), $MachinePrecision]}, Block[{t$95$2 = N[(x + N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$2, (-Infinity)], t$95$1, If[LessEqual[t$95$2, 5e+300], t$95$2, t$95$1]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{z - x}{t} \cdot y\\
t_2 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_2 \leq -\infty:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;t\_2 \leq 5 \cdot 10^{+300}:\\
\;\;\;\;t\_2\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0 or 5.00000000000000026e300 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 77.7%
Applied egg-rr0
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 5.00000000000000026e300Initial program 99.3%
(FPCore (x y z t) :precision binary64 (if (<= z -1.6e-129) (+ (/ y (/ t z)) x) (if (<= z 5e+47) (* x (- 1.0 (/ y t))) (+ x (* (/ y t) z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e-129) {
tmp = (y / (t / z)) + x;
} else if (z <= 5e+47) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + ((y / t) * z);
}
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 (z <= (-1.6d-129)) then
tmp = (y / (t / z)) + x
else if (z <= 5d+47) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + ((y / t) * z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -1.6e-129) {
tmp = (y / (t / z)) + x;
} else if (z <= 5e+47) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + ((y / t) * z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -1.6e-129: tmp = (y / (t / z)) + x elif z <= 5e+47: tmp = x * (1.0 - (y / t)) else: tmp = x + ((y / t) * z) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -1.6e-129) tmp = Float64(Float64(y / Float64(t / z)) + x); elseif (z <= 5e+47) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(Float64(y / t) * z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -1.6e-129) tmp = (y / (t / z)) + x; elseif (z <= 5e+47) tmp = x * (1.0 - (y / t)); else tmp = x + ((y / t) * z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -1.6e-129], N[(N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision], If[LessEqual[z, 5e+47], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.6 \cdot 10^{-129}:\\
\;\;\;\;\frac{y}{\frac{t}{z}} + x\\
\mathbf{elif}\;z \leq 5 \cdot 10^{+47}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y}{t} \cdot z\\
\end{array}
\end{array}
if z < -1.6000000000000001e-129Initial program 92.2%
Applied egg-rr0
Taylor expanded in z around inf 0
Simplified0
if -1.6000000000000001e-129 < z < 5.00000000000000022e47Initial program 96.8%
Taylor expanded in x around inf 0
Simplified0
if 5.00000000000000022e47 < z Initial program 85.2%
Applied egg-rr0
Taylor expanded in z around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (* (/ y t) z)))) (if (<= z -1.9e+31) t_1 (if (<= z 5.1e+47) (* x (- 1.0 (/ y t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y / t) * z);
double tmp;
if (z <= -1.9e+31) {
tmp = t_1;
} else if (z <= 5.1e+47) {
tmp = x * (1.0 - (y / t));
} 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) * z)
if (z <= (-1.9d+31)) then
tmp = t_1
else if (z <= 5.1d+47) then
tmp = x * (1.0d0 - (y / t))
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) * z);
double tmp;
if (z <= -1.9e+31) {
tmp = t_1;
} else if (z <= 5.1e+47) {
tmp = x * (1.0 - (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y / t) * z) tmp = 0 if z <= -1.9e+31: tmp = t_1 elif z <= 5.1e+47: tmp = x * (1.0 - (y / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(y / t) * z)) tmp = 0.0 if (z <= -1.9e+31) tmp = t_1; elseif (z <= 5.1e+47) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + ((y / t) * z); tmp = 0.0; if (z <= -1.9e+31) tmp = t_1; elseif (z <= 5.1e+47) tmp = x * (1.0 - (y / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(y / t), $MachinePrecision] * z), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[z, -1.9e+31], t$95$1, If[LessEqual[z, 5.1e+47], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{t} \cdot z\\
\mathbf{if}\;z \leq -1.9 \cdot 10^{+31}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;z \leq 5.1 \cdot 10^{+47}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if z < -1.9000000000000001e31 or 5.1000000000000001e47 < z Initial program 89.2%
Applied egg-rr0
Taylor expanded in z around inf 0
Simplified0
if -1.9000000000000001e31 < z < 5.1000000000000001e47Initial program 95.6%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ (- z x) t) y))) (if (<= y -2.3e-26) t_1 (if (<= y 3.5e-6) (* x (- 1.0 (/ y t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = ((z - x) / t) * y;
double tmp;
if (y <= -2.3e-26) {
tmp = t_1;
} else if (y <= 3.5e-6) {
tmp = x * (1.0 - (y / t));
} 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 = ((z - x) / t) * y
if (y <= (-2.3d-26)) then
tmp = t_1
else if (y <= 3.5d-6) then
tmp = x * (1.0d0 - (y / t))
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 = ((z - x) / t) * y;
double tmp;
if (y <= -2.3e-26) {
tmp = t_1;
} else if (y <= 3.5e-6) {
tmp = x * (1.0 - (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = ((z - x) / t) * y tmp = 0 if y <= -2.3e-26: tmp = t_1 elif y <= 3.5e-6: tmp = x * (1.0 - (y / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(Float64(z - x) / t) * y) tmp = 0.0 if (y <= -2.3e-26) tmp = t_1; elseif (y <= 3.5e-6) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = ((z - x) / t) * y; tmp = 0.0; if (y <= -2.3e-26) tmp = t_1; elseif (y <= 3.5e-6) tmp = x * (1.0 - (y / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -2.3e-26], t$95$1, If[LessEqual[y, 3.5e-6], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - x}{t} \cdot y\\
\mathbf{if}\;y \leq -2.3 \cdot 10^{-26}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 3.5 \cdot 10^{-6}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -2.30000000000000009e-26 or 3.49999999999999995e-6 < y Initial program 87.0%
Taylor expanded in y around inf 0
Simplified0
Applied egg-rr0
if -2.30000000000000009e-26 < y < 3.49999999999999995e-6Initial program 99.2%
Taylor expanded in x around inf 0
Simplified0
(FPCore (x y z t) :precision binary64 (if (<= z -2.5e+173) (/ y (/ t z)) (if (<= z 1.6e+55) (* x (- 1.0 (/ y t))) (/ z (/ t y)))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e+173) {
tmp = y / (t / z);
} else if (z <= 1.6e+55) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z / (t / y);
}
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 (z <= (-2.5d+173)) then
tmp = y / (t / z)
else if (z <= 1.6d+55) then
tmp = x * (1.0d0 - (y / t))
else
tmp = z / (t / y)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -2.5e+173) {
tmp = y / (t / z);
} else if (z <= 1.6e+55) {
tmp = x * (1.0 - (y / t));
} else {
tmp = z / (t / y);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -2.5e+173: tmp = y / (t / z) elif z <= 1.6e+55: tmp = x * (1.0 - (y / t)) else: tmp = z / (t / y) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -2.5e+173) tmp = Float64(y / Float64(t / z)); elseif (z <= 1.6e+55) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(z / Float64(t / y)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -2.5e+173) tmp = y / (t / z); elseif (z <= 1.6e+55) tmp = x * (1.0 - (y / t)); else tmp = z / (t / y); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -2.5e+173], N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.6e+55], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{+173}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\mathbf{elif}\;z \leq 1.6 \cdot 10^{+55}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -2.50000000000000017e173Initial program 90.9%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -2.50000000000000017e173 < z < 1.6000000000000001e55Initial program 95.4%
Taylor expanded in x around inf 0
Simplified0
if 1.6000000000000001e55 < z Initial program 84.9%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (if (<= y -6.4e-45) (/ z (/ t y)) (if (<= y 2.8e-41) x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e-45) {
tmp = z / (t / y);
} else if (y <= 2.8e-41) {
tmp = x;
} else {
tmp = y / (t / z);
}
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 (y <= (-6.4d-45)) then
tmp = z / (t / y)
else if (y <= 2.8d-41) then
tmp = x
else
tmp = y / (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -6.4e-45) {
tmp = z / (t / y);
} else if (y <= 2.8e-41) {
tmp = x;
} else {
tmp = y / (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -6.4e-45: tmp = z / (t / y) elif y <= 2.8e-41: tmp = x else: tmp = y / (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -6.4e-45) tmp = Float64(z / Float64(t / y)); elseif (y <= 2.8e-41) tmp = x; else tmp = Float64(y / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -6.4e-45) tmp = z / (t / y); elseif (y <= 2.8e-41) tmp = x; else tmp = y / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -6.4e-45], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], If[LessEqual[y, 2.8e-41], x, N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -6.4 \cdot 10^{-45}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\mathbf{elif}\;y \leq 2.8 \cdot 10^{-41}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if y < -6.40000000000000015e-45Initial program 91.7%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -6.40000000000000015e-45 < y < 2.8000000000000002e-41Initial program 99.1%
Taylor expanded in y around 0 0
Simplified0
if 2.8000000000000002e-41 < y Initial program 83.2%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (if (<= y -8.6e-45) (* (/ z t) y) (if (<= y 7e-41) x (/ y (/ t z)))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.6e-45) {
tmp = (z / t) * y;
} else if (y <= 7e-41) {
tmp = x;
} else {
tmp = y / (t / z);
}
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 (y <= (-8.6d-45)) then
tmp = (z / t) * y
else if (y <= 7d-41) then
tmp = x
else
tmp = y / (t / z)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= -8.6e-45) {
tmp = (z / t) * y;
} else if (y <= 7e-41) {
tmp = x;
} else {
tmp = y / (t / z);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= -8.6e-45: tmp = (z / t) * y elif y <= 7e-41: tmp = x else: tmp = y / (t / z) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= -8.6e-45) tmp = Float64(Float64(z / t) * y); elseif (y <= 7e-41) tmp = x; else tmp = Float64(y / Float64(t / z)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= -8.6e-45) tmp = (z / t) * y; elseif (y <= 7e-41) tmp = x; else tmp = y / (t / z); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, -8.6e-45], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], If[LessEqual[y, 7e-41], x, N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.6 \cdot 10^{-45}:\\
\;\;\;\;\frac{z}{t} \cdot y\\
\mathbf{elif}\;y \leq 7 \cdot 10^{-41}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;\frac{y}{\frac{t}{z}}\\
\end{array}
\end{array}
if y < -8.5999999999999998e-45Initial program 91.7%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -8.5999999999999998e-45 < y < 6.9999999999999999e-41Initial program 99.1%
Taylor expanded in y around 0 0
Simplified0
if 6.9999999999999999e-41 < y Initial program 83.2%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* (/ z t) y))) (if (<= y -7.2e-45) t_1 (if (<= y 9.6e-42) x t_1))))
double code(double x, double y, double z, double t) {
double t_1 = (z / t) * y;
double tmp;
if (y <= -7.2e-45) {
tmp = t_1;
} else if (y <= 9.6e-42) {
tmp = x;
} 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 = (z / t) * y
if (y <= (-7.2d-45)) then
tmp = t_1
else if (y <= 9.6d-42) then
tmp = x
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 = (z / t) * y;
double tmp;
if (y <= -7.2e-45) {
tmp = t_1;
} else if (y <= 9.6e-42) {
tmp = x;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = (z / t) * y tmp = 0 if y <= -7.2e-45: tmp = t_1 elif y <= 9.6e-42: tmp = x else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(Float64(z / t) * y) tmp = 0.0 if (y <= -7.2e-45) tmp = t_1; elseif (y <= 9.6e-42) tmp = x; else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = (z / t) * y; tmp = 0.0; if (y <= -7.2e-45) tmp = t_1; elseif (y <= 9.6e-42) tmp = x; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision]}, If[LessEqual[y, -7.2e-45], t$95$1, If[LessEqual[y, 9.6e-42], x, t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z}{t} \cdot y\\
\mathbf{if}\;y \leq -7.2 \cdot 10^{-45}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 9.6 \cdot 10^{-42}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -7.20000000000000001e-45 or 9.60000000000000011e-42 < y Initial program 88.1%
Taylor expanded in x around 0 0
Simplified0
Applied egg-rr0
if -7.20000000000000001e-45 < y < 9.60000000000000011e-42Initial program 99.1%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (+ x (* (/ y t) (- z x))))
double code(double x, double y, double z, double t) {
return x + ((y / t) * (z - x));
}
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) * (z - x))
end function
public static double code(double x, double y, double z, double t) {
return x + ((y / t) * (z - x));
}
def code(x, y, z, t): return x + ((y / t) * (z - x))
function code(x, y, z, t) return Float64(x + Float64(Float64(y / t) * Float64(z - x))) end
function tmp = code(x, y, z, t) tmp = x + ((y / t) * (z - x)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{t} \cdot \left(z - x\right)
\end{array}
Initial program 93.0%
Applied egg-rr0
(FPCore (x y z t) :precision binary64 x)
double code(double x, double y, double z, double t) {
return x;
}
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
end function
public static double code(double x, double y, double z, double t) {
return x;
}
def code(x, y, z, t): return x
function code(x, y, z, t) return x end
function tmp = code(x, y, z, t) tmp = x; end
code[x_, y_, z_, t_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 93.0%
Taylor expanded in y around 0 0
Simplified0
(FPCore (x y z t) :precision binary64 (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
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 - ((x * (y / t)) + (-z * (y / t)))
end function
public static double code(double x, double y, double z, double t) {
return x - ((x * (y / t)) + (-z * (y / t)));
}
def code(x, y, z, t): return x - ((x * (y / t)) + (-z * (y / t)))
function code(x, y, z, t) return Float64(x - Float64(Float64(x * Float64(y / t)) + Float64(Float64(-z) * Float64(y / t)))) end
function tmp = code(x, y, z, t) tmp = x - ((x * (y / t)) + (-z * (y / t))); end
code[x_, y_, z_, t_] := N[(x - N[(N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision] + N[((-z) * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x - \left(x \cdot \frac{y}{t} + \left(-z\right) \cdot \frac{y}{t}\right)
\end{array}
herbie shell --seed 2024110
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:alt
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))