
(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 10 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 (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+264)))
(+ x (* (- z x) (/ y t)))
t_1)))
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)) || !(t_1 <= 1e+264)) {
tmp = x + ((z - x) * (y / t));
} else {
tmp = t_1;
}
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) || !(t_1 <= 1e+264)) {
tmp = x + ((z - x) * (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y * (z - x)) / t) tmp = 0 if (t_1 <= -math.inf) or not (t_1 <= 1e+264): tmp = x + ((z - x) * (y / t)) else: tmp = t_1 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)) || !(t_1 <= 1e+264)) tmp = Float64(x + Float64(Float64(z - x) * Float64(y / t))); else tmp = t_1; 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) || ~((t_1 <= 1e+264))) tmp = x + ((z - x) * (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 * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+264]], $MachinePrecision]], N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+264}\right):\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0 or 1.00000000000000004e264 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 82.6%
Taylor expanded in z around 0 68.1%
+-commutative68.1%
mul-1-neg68.1%
*-commutative68.1%
associate-*r/74.1%
associate-/l*80.3%
distribute-lft-neg-in80.3%
distribute-rgt-in100.0%
sub-neg100.0%
Simplified100.0%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 1.00000000000000004e264Initial program 99.4%
Final simplification99.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.55e+69) (not (<= z 5.8e+110))) (/ (* y z) t) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.55e+69) || !(z <= 5.8e+110)) {
tmp = (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.55d+69)) .or. (.not. (z <= 5.8d+110))) then
tmp = (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.55e+69) || !(z <= 5.8e+110)) {
tmp = (y * z) / t;
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.55e+69) or not (z <= 5.8e+110): tmp = (y * z) / t else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.55e+69) || !(z <= 5.8e+110)) tmp = Float64(Float64(y * 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.55e+69) || ~((z <= 5.8e+110))) tmp = (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.55e+69], N[Not[LessEqual[z, 5.8e+110]], $MachinePrecision]], N[(N[(y * z), $MachinePrecision] / t), $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^{+69} \lor \neg \left(z \leq 5.8 \cdot 10^{+110}\right):\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -1.5499999999999999e69 or 5.7999999999999999e110 < z Initial program 92.9%
Taylor expanded in y around -inf 70.8%
Taylor expanded in z around inf 69.8%
if -1.5499999999999999e69 < z < 5.7999999999999999e110Initial program 95.2%
Taylor expanded in x around inf 82.2%
mul-1-neg82.2%
unsub-neg82.2%
Simplified82.2%
Final simplification77.6%
(FPCore (x y z t) :precision binary64 (if (or (<= z -1.05e+63) (not (<= z 5e+86))) (* (- z x) (/ y t)) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -1.05e+63) || !(z <= 5e+86)) {
tmp = (z - x) * (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.05d+63)) .or. (.not. (z <= 5d+86))) then
tmp = (z - x) * (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.05e+63) || !(z <= 5e+86)) {
tmp = (z - x) * (y / t);
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -1.05e+63) or not (z <= 5e+86): tmp = (z - x) * (y / t) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -1.05e+63) || !(z <= 5e+86)) tmp = Float64(Float64(z - x) * 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.05e+63) || ~((z <= 5e+86))) tmp = (z - x) * (y / t); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -1.05e+63], N[Not[LessEqual[z, 5e+86]], $MachinePrecision]], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.05 \cdot 10^{+63} \lor \neg \left(z \leq 5 \cdot 10^{+86}\right):\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if z < -1.0500000000000001e63 or 4.9999999999999998e86 < z Initial program 91.8%
Taylor expanded in y around -inf 68.9%
Taylor expanded in z around 0 60.3%
+-commutative83.2%
mul-1-neg83.2%
*-commutative83.2%
associate-*r/87.8%
associate-/l*88.7%
distribute-lft-neg-in88.7%
distribute-rgt-in97.2%
sub-neg97.2%
Simplified73.5%
if -1.0500000000000001e63 < z < 4.9999999999999998e86Initial program 96.2%
Taylor expanded in x around inf 84.3%
mul-1-neg84.3%
unsub-neg84.3%
Simplified84.3%
Final simplification79.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -4.8e-52) (not (<= t 1.95e-147))) (+ x (* y (/ z t))) (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8e-52) || !(t <= 1.95e-147)) {
tmp = x + (y * (z / t));
} else {
tmp = (z - 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 ((t <= (-4.8d-52)) .or. (.not. (t <= 1.95d-147))) then
tmp = x + (y * (z / t))
else
tmp = (z - x) * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -4.8e-52) || !(t <= 1.95e-147)) {
tmp = x + (y * (z / t));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -4.8e-52) or not (t <= 1.95e-147): tmp = x + (y * (z / t)) else: tmp = (z - x) * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -4.8e-52) || !(t <= 1.95e-147)) tmp = Float64(x + Float64(y * Float64(z / t))); else tmp = Float64(Float64(z - x) * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -4.8e-52) || ~((t <= 1.95e-147))) tmp = x + (y * (z / t)); else tmp = (z - x) * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -4.8e-52], N[Not[LessEqual[t, 1.95e-147]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -4.8 \cdot 10^{-52} \lor \neg \left(t \leq 1.95 \cdot 10^{-147}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -4.8000000000000003e-52 or 1.9499999999999999e-147 < t Initial program 92.1%
Taylor expanded in z around inf 84.3%
associate-/l*33.8%
Simplified87.7%
if -4.8000000000000003e-52 < t < 1.9499999999999999e-147Initial program 98.8%
Taylor expanded in y around -inf 92.6%
Taylor expanded in z around 0 82.4%
+-commutative88.6%
mul-1-neg88.6%
*-commutative88.6%
associate-*r/80.9%
associate-/l*78.4%
distribute-lft-neg-in78.4%
distribute-rgt-in94.5%
sub-neg94.5%
Simplified88.1%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.4e-53) (not (<= t 8e-148))) (+ x (/ y (/ t z))) (* (- z x) (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e-53) || !(t <= 8e-148)) {
tmp = x + (y / (t / z));
} else {
tmp = (z - 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 ((t <= (-1.4d-53)) .or. (.not. (t <= 8d-148))) then
tmp = x + (y / (t / z))
else
tmp = (z - x) * (y / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.4e-53) || !(t <= 8e-148)) {
tmp = x + (y / (t / z));
} else {
tmp = (z - x) * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.4e-53) or not (t <= 8e-148): tmp = x + (y / (t / z)) else: tmp = (z - x) * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.4e-53) || !(t <= 8e-148)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(Float64(z - x) * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.4e-53) || ~((t <= 8e-148))) tmp = x + (y / (t / z)); else tmp = (z - x) * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.4e-53], N[Not[LessEqual[t, 8e-148]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.4 \cdot 10^{-53} \lor \neg \left(t \leq 8 \cdot 10^{-148}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -1.39999999999999993e-53 or 7.99999999999999949e-148 < t Initial program 92.1%
Taylor expanded in z around inf 84.3%
associate-/l*33.8%
Simplified87.7%
clear-num87.6%
un-div-inv88.2%
Applied egg-rr88.2%
if -1.39999999999999993e-53 < t < 7.99999999999999949e-148Initial program 98.8%
Taylor expanded in y around -inf 92.6%
Taylor expanded in z around 0 82.4%
+-commutative88.6%
mul-1-neg88.6%
*-commutative88.6%
associate-*r/80.9%
associate-/l*78.4%
distribute-lft-neg-in78.4%
distribute-rgt-in94.5%
sub-neg94.5%
Simplified88.1%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (or (<= t -8.2e-52) (not (<= t 1.85e-147))) (+ x (/ y (/ t z))) (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.2e-52) || !(t <= 1.85e-147)) {
tmp = x + (y / (t / z));
} else {
tmp = (y * (z - x)) / 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 ((t <= (-8.2d-52)) .or. (.not. (t <= 1.85d-147))) then
tmp = x + (y / (t / z))
else
tmp = (y * (z - x)) / t
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -8.2e-52) || !(t <= 1.85e-147)) {
tmp = x + (y / (t / z));
} else {
tmp = (y * (z - x)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -8.2e-52) or not (t <= 1.85e-147): tmp = x + (y / (t / z)) else: tmp = (y * (z - x)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -8.2e-52) || !(t <= 1.85e-147)) tmp = Float64(x + Float64(y / Float64(t / z))); else tmp = Float64(Float64(y * Float64(z - x)) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -8.2e-52) || ~((t <= 1.85e-147))) tmp = x + (y / (t / z)); else tmp = (y * (z - x)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -8.2e-52], N[Not[LessEqual[t, 1.85e-147]], $MachinePrecision]], N[(x + N[(y / N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -8.2 \cdot 10^{-52} \lor \neg \left(t \leq 1.85 \cdot 10^{-147}\right):\\
\;\;\;\;x + \frac{y}{\frac{t}{z}}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z - x\right)}{t}\\
\end{array}
\end{array}
if t < -8.19999999999999977e-52 or 1.8500000000000001e-147 < t Initial program 92.1%
Taylor expanded in z around inf 84.3%
associate-/l*33.8%
Simplified87.7%
clear-num87.6%
un-div-inv88.2%
Applied egg-rr88.2%
if -8.19999999999999977e-52 < t < 1.8500000000000001e-147Initial program 98.8%
Taylor expanded in y around -inf 92.6%
Final simplification89.7%
(FPCore (x y z t) :precision binary64 (if (<= t -1.7e-53) (+ x (* y (/ z t))) (if (<= t 2.2e-187) (* (- z x) (/ y t)) (+ x (* z (/ y t))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-53) {
tmp = x + (y * (z / t));
} else if (t <= 2.2e-187) {
tmp = (z - x) * (y / t);
} else {
tmp = x + (z * (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 (t <= (-1.7d-53)) then
tmp = x + (y * (z / t))
else if (t <= 2.2d-187) then
tmp = (z - x) * (y / t)
else
tmp = x + (z * (y / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.7e-53) {
tmp = x + (y * (z / t));
} else if (t <= 2.2e-187) {
tmp = (z - x) * (y / t);
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.7e-53: tmp = x + (y * (z / t)) elif t <= 2.2e-187: tmp = (z - x) * (y / t) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.7e-53) tmp = Float64(x + Float64(y * Float64(z / t))); elseif (t <= 2.2e-187) tmp = Float64(Float64(z - x) * Float64(y / t)); else tmp = Float64(x + Float64(z * Float64(y / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.7e-53) tmp = x + (y * (z / t)); elseif (t <= 2.2e-187) tmp = (z - x) * (y / t); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.7e-53], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 2.2e-187], N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.7 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{elif}\;t \leq 2.2 \cdot 10^{-187}:\\
\;\;\;\;\left(z - x\right) \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -1.7e-53Initial program 87.8%
Taylor expanded in z around inf 80.8%
associate-/l*32.8%
Simplified89.2%
if -1.7e-53 < t < 2.20000000000000008e-187Initial program 98.7%
Taylor expanded in y around -inf 94.1%
Taylor expanded in z around 0 83.8%
+-commutative88.4%
mul-1-neg88.4%
*-commutative88.4%
associate-*r/79.7%
associate-/l*76.9%
distribute-lft-neg-in76.9%
distribute-rgt-in93.8%
sub-neg93.8%
Simplified89.0%
if 2.20000000000000008e-187 < t Initial program 96.2%
Taylor expanded in z around inf 86.6%
associate-*l/86.6%
Applied egg-rr86.6%
Final simplification88.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -8.5e+44) (not (<= y 5.5e-95))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -8.5e+44) || !(y <= 5.5e-95)) {
tmp = y * (z / 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 <= (-8.5d+44)) .or. (.not. (y <= 5.5d-95))) then
tmp = y * (z / 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 <= -8.5e+44) || !(y <= 5.5e-95)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -8.5e+44) or not (y <= 5.5e-95): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -8.5e+44) || !(y <= 5.5e-95)) tmp = Float64(y * Float64(z / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -8.5e+44) || ~((y <= 5.5e-95))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -8.5e+44], N[Not[LessEqual[y, 5.5e-95]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -8.5 \cdot 10^{+44} \lor \neg \left(y \leq 5.5 \cdot 10^{-95}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -8.5e44 or 5.50000000000000003e-95 < y Initial program 90.5%
Taylor expanded in y around -inf 77.2%
Taylor expanded in z around inf 50.3%
associate-/l*55.3%
Simplified55.3%
if -8.5e44 < y < 5.50000000000000003e-95Initial program 98.4%
Taylor expanded in y around 0 62.2%
Final simplification58.7%
(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 94.4%
Taylor expanded in z around 0 90.1%
+-commutative90.1%
mul-1-neg90.1%
*-commutative90.1%
associate-*r/88.9%
associate-/l*90.7%
distribute-lft-neg-in90.7%
distribute-rgt-in96.6%
sub-neg96.6%
Simplified96.6%
Final simplification96.6%
(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 94.4%
Taylor expanded in y around 0 39.6%
Final simplification39.6%
(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 2024089
(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)))