
(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 12 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 (+ x (/ (- z x) (/ t y))))
double code(double x, double y, double z, double t) {
return x + ((z - x) / (t / y));
}
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 + ((z - x) / (t / y))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) / (t / y));
}
def code(x, y, z, t): return x + ((z - x) / (t / y))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) / Float64(t / y))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) / (t / y)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{z - x}{\frac{t}{y}}
\end{array}
Initial program 90.0%
associate-*l/98.3%
Simplified98.3%
*-commutative98.3%
clear-num98.3%
un-div-inv98.4%
Applied egg-rr98.4%
Final simplification98.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.85e-155) (not (<= z 3.5e+30))) (+ x (* y (/ z t))) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-155) || !(z <= 3.5e+30)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (y / t));
}
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.85d-155)) .or. (.not. (z <= 3.5d+30))) then
tmp = x + (y * (z / t))
else
tmp = x * (1.0d0 - (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.85e-155) || !(z <= 3.5e+30)) {
tmp = x + (y * (z / t));
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.85e-155) or not (z <= 3.5e+30): tmp = x + (y * (z / t)) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.85e-155) || !(z <= 3.5e+30)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(x * Float64(1.0 - Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.85e-155) || ~((z <= 3.5e+30))) tmp = x + (y * (z / t)); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.85e-155], N[Not[LessEqual[z, 3.5e+30]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{-155} \lor \neg \left(z \leq 3.5 \cdot 10^{+30}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -1.85e-155 or 3.50000000000000021e30 < z Initial program 87.3%
associate-*l/99.2%
Simplified99.2%
*-commutative99.2%
clear-num99.1%
un-div-inv99.2%
Applied egg-rr99.2%
Taylor expanded in z around inf 80.4%
associate-*r/84.3%
Simplified84.3%
if -1.85e-155 < z < 3.50000000000000021e30Initial program 94.8%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 87.3%
mul-1-neg87.3%
unsub-neg87.3%
Simplified87.3%
Final simplification85.4%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.55e-155) (not (<= z 2.22e+30))) (+ x (* z (/ y t))) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e-155) || !(z <= 2.22e+30)) {
tmp = x + (z * (y / t));
} else {
tmp = x * (1.0 - (y / t));
}
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.55d-155)) .or. (.not. (z <= 2.22d+30))) then
tmp = x + (z * (y / t))
else
tmp = x * (1.0d0 - (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e-155) || !(z <= 2.22e+30)) {
tmp = x + (z * (y / t));
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.55e-155) or not (z <= 2.22e+30): tmp = x + (z * (y / t)) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.55e-155) || !(z <= 2.22e+30)) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = Float64(x * Float64(1.0 - Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -1.55e-155) || ~((z <= 2.22e+30))) tmp = x + (z * (y / t)); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.55e-155], N[Not[LessEqual[z, 2.22e+30]], $MachinePrecision]], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-155} \lor \neg \left(z \leq 2.22 \cdot 10^{+30}\right):\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -1.55e-155 or 2.22e30 < z Initial program 87.3%
associate-*l/99.2%
Simplified99.2%
Taylor expanded in z around inf 80.4%
associate-*l/89.3%
*-commutative89.3%
Simplified89.3%
if -1.55e-155 < z < 2.22e30Initial program 94.8%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 87.3%
mul-1-neg87.3%
unsub-neg87.3%
Simplified87.3%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (<= z -8.6e-156) (+ x (* z (/ y t))) (if (<= z 2.3e+30) (* x (- 1.0 (/ y t))) (+ x (/ z (/ t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -8.6e-156) {
tmp = x + (z * (y / t));
} else if (z <= 2.3e+30) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (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 <= (-8.6d-156)) then
tmp = x + (z * (y / t))
else if (z <= 2.3d+30) then
tmp = x * (1.0d0 - (y / t))
else
tmp = x + (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 <= -8.6e-156) {
tmp = x + (z * (y / t));
} else if (z <= 2.3e+30) {
tmp = x * (1.0 - (y / t));
} else {
tmp = x + (z / (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -8.6e-156: tmp = x + (z * (y / t)) elif z <= 2.3e+30: tmp = x * (1.0 - (y / t)) else: tmp = x + (z / (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -8.6e-156) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (z <= 2.3e+30) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(x + Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -8.6e-156) tmp = x + (z * (y / t)); elseif (z <= 2.3e+30) tmp = x * (1.0 - (y / t)); else tmp = x + (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -8.6e-156], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.3e+30], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -8.6 \cdot 10^{-156}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.3 \cdot 10^{+30}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -8.59999999999999954e-156Initial program 87.4%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in z around inf 77.4%
associate-*l/86.0%
*-commutative86.0%
Simplified86.0%
if -8.59999999999999954e-156 < z < 2.3e30Initial program 94.8%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 87.3%
mul-1-neg87.3%
unsub-neg87.3%
Simplified87.3%
if 2.3e30 < z Initial program 87.1%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in z around inf 84.2%
associate-/r/94.9%
Applied egg-rr94.9%
*-commutative94.9%
clear-num94.9%
un-div-inv95.0%
Applied egg-rr95.0%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (<= z -5.8e-158) (+ x (* z (/ y t))) (if (<= z 2.22e+30) (- x (/ x (/ t y))) (+ x (/ z (/ t y))))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -5.8e-158) {
tmp = x + (z * (y / t));
} else if (z <= 2.22e+30) {
tmp = x - (x / (t / y));
} else {
tmp = x + (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 <= (-5.8d-158)) then
tmp = x + (z * (y / t))
else if (z <= 2.22d+30) then
tmp = x - (x / (t / y))
else
tmp = x + (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 <= -5.8e-158) {
tmp = x + (z * (y / t));
} else if (z <= 2.22e+30) {
tmp = x - (x / (t / y));
} else {
tmp = x + (z / (t / y));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -5.8e-158: tmp = x + (z * (y / t)) elif z <= 2.22e+30: tmp = x - (x / (t / y)) else: tmp = x + (z / (t / y)) return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -5.8e-158) tmp = Float64(x + Float64(z * Float64(y / t))); elseif (z <= 2.22e+30) tmp = Float64(x - Float64(x / Float64(t / y))); else tmp = Float64(x + Float64(z / Float64(t / y))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -5.8e-158) tmp = x + (z * (y / t)); elseif (z <= 2.22e+30) tmp = x - (x / (t / y)); else tmp = x + (z / (t / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -5.8e-158], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.22e+30], N[(x - N[(x / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.8 \cdot 10^{-158}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 2.22 \cdot 10^{+30}:\\
\;\;\;\;x - \frac{x}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z}{\frac{t}{y}}\\
\end{array}
\end{array}
if z < -5.79999999999999961e-158Initial program 87.4%
associate-*l/98.9%
Simplified98.9%
Taylor expanded in z around inf 77.4%
associate-*l/86.0%
*-commutative86.0%
Simplified86.0%
if -5.79999999999999961e-158 < z < 2.22e30Initial program 94.8%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in z around 0 85.2%
mul-1-neg85.2%
associate-/l*87.4%
Simplified87.4%
if 2.22e30 < z Initial program 87.1%
associate-/l*87.5%
Simplified87.5%
Taylor expanded in z around inf 84.2%
associate-/r/94.9%
Applied egg-rr94.9%
*-commutative94.9%
clear-num94.9%
un-div-inv95.0%
Applied egg-rr95.0%
Final simplification88.6%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.35e+47) (not (<= y 5.3e-6))) (* (- y) (/ x t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.35e+47) || !(y <= 5.3e-6)) {
tmp = -y * (x / t);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.35d+47)) .or. (.not. (y <= 5.3d-6))) then
tmp = -y * (x / t)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.35e+47) || !(y <= 5.3e-6)) {
tmp = -y * (x / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.35e+47) or not (y <= 5.3e-6): tmp = -y * (x / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.35e+47) || !(y <= 5.3e-6)) tmp = Float64(Float64(-y) * Float64(x / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.35e+47) || ~((y <= 5.3e-6))) tmp = -y * (x / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.35e+47], N[Not[LessEqual[y, 5.3e-6]], $MachinePrecision]], N[((-y) * N[(x / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.35 \cdot 10^{+47} \lor \neg \left(y \leq 5.3 \cdot 10^{-6}\right):\\
\;\;\;\;\left(-y\right) \cdot \frac{x}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.34999999999999998e47 or 5.3000000000000001e-6 < y Initial program 82.9%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 53.5%
mul-1-neg53.5%
unsub-neg53.5%
Simplified53.5%
Taylor expanded in y around inf 43.0%
associate-*r/43.0%
neg-mul-143.0%
Simplified43.0%
associate-*r/39.7%
distribute-rgt-neg-out39.7%
distribute-neg-frac39.7%
associate-*l/41.0%
*-commutative41.0%
Applied egg-rr41.0%
if -1.34999999999999998e47 < y < 5.3000000000000001e-6Initial program 97.2%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in y around 0 61.2%
Final simplification51.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.4e+47) (not (<= y 1.5e-14))) (* (/ y t) (- x)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+47) || !(y <= 1.5e-14)) {
tmp = (y / t) * -x;
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.4d+47)) .or. (.not. (y <= 1.5d-14))) then
tmp = (y / t) * -x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.4e+47) || !(y <= 1.5e-14)) {
tmp = (y / t) * -x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.4e+47) or not (y <= 1.5e-14): tmp = (y / t) * -x else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.4e+47) || !(y <= 1.5e-14)) tmp = Float64(Float64(y / t) * Float64(-x)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.4e+47) || ~((y <= 1.5e-14))) tmp = (y / t) * -x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.4e+47], N[Not[LessEqual[y, 1.5e-14]], $MachinePrecision]], N[(N[(y / t), $MachinePrecision] * (-x)), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.4 \cdot 10^{+47} \lor \neg \left(y \leq 1.5 \cdot 10^{-14}\right):\\
\;\;\;\;\frac{y}{t} \cdot \left(-x\right)\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.39999999999999994e47 or 1.4999999999999999e-14 < y Initial program 82.9%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 53.5%
mul-1-neg53.5%
unsub-neg53.5%
Simplified53.5%
Taylor expanded in y around inf 43.0%
associate-*r/43.0%
neg-mul-143.0%
Simplified43.0%
if -1.39999999999999994e47 < y < 1.4999999999999999e-14Initial program 97.2%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in y around 0 61.2%
Final simplification52.0%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.3e+47) (not (<= y 7e-15))) (/ x (/ (- t) y)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+47) || !(y <= 7e-15)) {
tmp = x / (-t / y);
} else {
tmp = x;
}
return tmp;
}
real(8) function code(x, y, z, t)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8) :: tmp
if ((y <= (-1.3d+47)) .or. (.not. (y <= 7d-15))) then
tmp = x / (-t / y)
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.3e+47) || !(y <= 7e-15)) {
tmp = x / (-t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.3e+47) or not (y <= 7e-15): tmp = x / (-t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.3e+47) || !(y <= 7e-15)) tmp = Float64(x / Float64(Float64(-t) / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.3e+47) || ~((y <= 7e-15))) tmp = x / (-t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.3e+47], N[Not[LessEqual[y, 7e-15]], $MachinePrecision]], N[(x / N[((-t) / y), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1.3 \cdot 10^{+47} \lor \neg \left(y \leq 7 \cdot 10^{-15}\right):\\
\;\;\;\;\frac{x}{\frac{-t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -1.30000000000000002e47 or 7.0000000000000001e-15 < y Initial program 82.9%
associate-*l/96.9%
Simplified96.9%
Taylor expanded in x around inf 53.5%
mul-1-neg53.5%
unsub-neg53.5%
Simplified53.5%
Taylor expanded in y around inf 43.0%
associate-*r/43.0%
neg-mul-143.0%
Simplified43.0%
frac-2neg43.0%
remove-double-neg43.0%
associate-*r/39.7%
Applied egg-rr39.7%
associate-/l*43.0%
Simplified43.0%
if -1.30000000000000002e47 < y < 7.0000000000000001e-15Initial program 97.2%
associate-*l/99.8%
Simplified99.8%
Taylor expanded in y around 0 61.2%
Final simplification52.0%
(FPCore (x y z t) :precision binary64 (+ x (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
return x + ((z - x) * (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 + ((z - x) * (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x + ((z - x) * (y / t));
}
def code(x, y, z, t): return x + ((z - x) * (y / t))
function code(x, y, z, t) return Float64(x + Float64(Float64(z - x) * Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x + ((z - x) * (y / t)); end
code[x_, y_, z_, t_] := N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \left(z - x\right) \cdot \frac{y}{t}
\end{array}
Initial program 90.0%
associate-*l/98.3%
Simplified98.3%
Final simplification98.3%
(FPCore (x y z t) :precision binary64 (if (<= y 2.2e+224) x (* x (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e+224) {
tmp = x;
} else {
tmp = x * (y / t);
}
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 <= 2.2d+224) then
tmp = x
else
tmp = x * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (y <= 2.2e+224) {
tmp = x;
} else {
tmp = x * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if y <= 2.2e+224: tmp = x else: tmp = x * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if (y <= 2.2e+224) tmp = x; else tmp = Float64(x * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (y <= 2.2e+224) tmp = x; else tmp = x * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[y, 2.2e+224], x, N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq 2.2 \cdot 10^{+224}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < 2.2e224Initial program 89.6%
associate-*l/98.2%
Simplified98.2%
Taylor expanded in y around 0 39.5%
if 2.2e224 < y Initial program 95.3%
associate-*l/100.0%
Simplified100.0%
Taylor expanded in x around inf 60.3%
mul-1-neg60.3%
unsub-neg60.3%
Simplified60.3%
Taylor expanded in y around inf 60.3%
associate-*r/60.3%
neg-mul-160.3%
Simplified60.3%
*-commutative60.3%
associate-*l/55.5%
add-sqr-sqrt0.0%
sqrt-unprod30.3%
sqr-neg30.3%
sqrt-unprod11.7%
add-sqr-sqrt11.7%
associate-*r/11.7%
clear-num11.7%
un-div-inv11.7%
Applied egg-rr11.7%
associate-/r/25.3%
Applied egg-rr25.3%
Final simplification38.4%
(FPCore (x y z t) :precision binary64 (* x (- 1.0 (/ y t))))
double code(double x, double y, double z, double t) {
return x * (1.0 - (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 * (1.0d0 - (y / t))
end function
public static double code(double x, double y, double z, double t) {
return x * (1.0 - (y / t));
}
def code(x, y, z, t): return x * (1.0 - (y / t))
function code(x, y, z, t) return Float64(x * Float64(1.0 - Float64(y / t))) end
function tmp = code(x, y, z, t) tmp = x * (1.0 - (y / t)); end
code[x_, y_, z_, t_] := N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x \cdot \left(1 - \frac{y}{t}\right)
\end{array}
Initial program 90.0%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in x around inf 61.7%
mul-1-neg61.7%
unsub-neg61.7%
Simplified61.7%
Final simplification61.7%
(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 90.0%
associate-*l/98.3%
Simplified98.3%
Taylor expanded in y around 0 36.7%
Final simplification36.7%
(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 2023308
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:herbie-target
(- x (+ (* x (/ y t)) (* (- z) (/ y t))))
(+ x (/ (* y (- z x)) t)))