
(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 14 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 2e+297) t_1 (+ x (* (- z x) (/ y t))))))
double code(double x, double y, double z, double t) {
double t_1 = x + ((y * (z - x)) / t);
double tmp;
if (t_1 <= 2e+297) {
tmp = t_1;
} else {
tmp = x + ((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) :: t_1
real(8) :: tmp
t_1 = x + ((y * (z - x)) / t)
if (t_1 <= 2d+297) then
tmp = t_1
else
tmp = x + ((z - x) * (y / t))
end if
code = tmp
end function
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 <= 2e+297) {
tmp = t_1;
} else {
tmp = x + ((z - x) * (y / t));
}
return tmp;
}
def code(x, y, z, t): t_1 = x + ((y * (z - x)) / t) tmp = 0 if t_1 <= 2e+297: tmp = t_1 else: tmp = x + ((z - x) * (y / t)) 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 <= 2e+297) tmp = t_1; else tmp = Float64(x + Float64(Float64(z - x) * Float64(y / t))); 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 <= 2e+297) tmp = t_1; else tmp = x + ((z - x) * (y / t)); 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, 2e+297], t$95$1, N[(x + N[(N[(z - x), $MachinePrecision] * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq 2 \cdot 10^{+297}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;x + \left(z - x\right) \cdot \frac{y}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 2e297Initial program 98.4%
if 2e297 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 77.8%
Taylor expanded in z around 0 69.9%
mul-1-neg69.9%
associate-/l*75.4%
distribute-lft-neg-in75.4%
*-commutative75.4%
associate-*r/84.3%
distribute-rgt-in100.0%
+-commutative100.0%
sub-neg100.0%
Simplified100.0%
Final simplification98.7%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.4e+73)
x
(if (<= t -2.1e-154)
(/ (* y z) t)
(if (<= t 3.1e-151)
(/ (* x (- y)) t)
(if (<= t 1.2e+14) (* z (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.4e+73) {
tmp = x;
} else if (t <= -2.1e-154) {
tmp = (y * z) / t;
} else if (t <= 3.1e-151) {
tmp = (x * -y) / t;
} else if (t <= 1.2e+14) {
tmp = z * (y / 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 (t <= (-2.4d+73)) then
tmp = x
else if (t <= (-2.1d-154)) then
tmp = (y * z) / t
else if (t <= 3.1d-151) then
tmp = (x * -y) / t
else if (t <= 1.2d+14) then
tmp = z * (y / 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 (t <= -2.4e+73) {
tmp = x;
} else if (t <= -2.1e-154) {
tmp = (y * z) / t;
} else if (t <= 3.1e-151) {
tmp = (x * -y) / t;
} else if (t <= 1.2e+14) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.4e+73: tmp = x elif t <= -2.1e-154: tmp = (y * z) / t elif t <= 3.1e-151: tmp = (x * -y) / t elif t <= 1.2e+14: tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.4e+73) tmp = x; elseif (t <= -2.1e-154) tmp = Float64(Float64(y * z) / t); elseif (t <= 3.1e-151) tmp = Float64(Float64(x * Float64(-y)) / t); elseif (t <= 1.2e+14) tmp = Float64(z * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.4e+73) tmp = x; elseif (t <= -2.1e-154) tmp = (y * z) / t; elseif (t <= 3.1e-151) tmp = (x * -y) / t; elseif (t <= 1.2e+14) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.4e+73], x, If[LessEqual[t, -2.1e-154], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 3.1e-151], N[(N[(x * (-y)), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 1.2e+14], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+73}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -2.1 \cdot 10^{-154}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;t \leq 3.1 \cdot 10^{-151}:\\
\;\;\;\;\frac{x \cdot \left(-y\right)}{t}\\
\mathbf{elif}\;t \leq 1.2 \cdot 10^{+14}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.40000000000000002e73 or 1.2e14 < t Initial program 85.7%
Taylor expanded in y around 0 62.6%
if -2.40000000000000002e73 < t < -2.09999999999999984e-154Initial program 99.8%
Taylor expanded in y around -inf 84.2%
Taylor expanded in z around inf 57.2%
if -2.09999999999999984e-154 < t < 3.09999999999999984e-151Initial program 99.9%
Taylor expanded in y around -inf 94.2%
Taylor expanded in z around 0 62.0%
neg-mul-162.0%
Simplified62.0%
if 3.09999999999999984e-151 < t < 1.2e14Initial program 99.8%
Taylor expanded in y around -inf 82.3%
Taylor expanded in z around inf 63.8%
associate-/l*76.9%
Simplified59.4%
clear-num59.3%
un-div-inv60.4%
Applied egg-rr60.4%
associate-/r/63.8%
Applied egg-rr63.8%
Final simplification61.6%
(FPCore (x y z t)
:precision binary64
(if (<= t -2.8e+73)
x
(if (<= t -1.1e-206)
(/ (* y z) t)
(if (<= t 2.9e-150)
(* x (/ (- y) t))
(if (<= t 1.65e+15) (* z (/ y t)) x)))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e+73) {
tmp = x;
} else if (t <= -1.1e-206) {
tmp = (y * z) / t;
} else if (t <= 2.9e-150) {
tmp = x * (-y / t);
} else if (t <= 1.65e+15) {
tmp = z * (y / 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 (t <= (-2.8d+73)) then
tmp = x
else if (t <= (-1.1d-206)) then
tmp = (y * z) / t
else if (t <= 2.9d-150) then
tmp = x * (-y / t)
else if (t <= 1.65d+15) then
tmp = z * (y / 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 (t <= -2.8e+73) {
tmp = x;
} else if (t <= -1.1e-206) {
tmp = (y * z) / t;
} else if (t <= 2.9e-150) {
tmp = x * (-y / t);
} else if (t <= 1.65e+15) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.8e+73: tmp = x elif t <= -1.1e-206: tmp = (y * z) / t elif t <= 2.9e-150: tmp = x * (-y / t) elif t <= 1.65e+15: tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.8e+73) tmp = x; elseif (t <= -1.1e-206) tmp = Float64(Float64(y * z) / t); elseif (t <= 2.9e-150) tmp = Float64(x * Float64(Float64(-y) / t)); elseif (t <= 1.65e+15) tmp = Float64(z * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.8e+73) tmp = x; elseif (t <= -1.1e-206) tmp = (y * z) / t; elseif (t <= 2.9e-150) tmp = x * (-y / t); elseif (t <= 1.65e+15) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.8e+73], x, If[LessEqual[t, -1.1e-206], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], If[LessEqual[t, 2.9e-150], N[(x * N[((-y) / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e+15], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{+73}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq -1.1 \cdot 10^{-206}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{elif}\;t \leq 2.9 \cdot 10^{-150}:\\
\;\;\;\;x \cdot \frac{-y}{t}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{+15}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.80000000000000008e73 or 1.65e15 < t Initial program 85.7%
Taylor expanded in y around 0 62.6%
if -2.80000000000000008e73 < t < -1.0999999999999999e-206Initial program 99.8%
Taylor expanded in y around -inf 83.1%
Taylor expanded in z around inf 54.7%
if -1.0999999999999999e-206 < t < 2.8999999999999998e-150Initial program 99.9%
Taylor expanded in y around -inf 96.6%
Taylor expanded in z around 0 65.0%
mul-1-neg65.0%
associate-/l*65.0%
distribute-rgt-neg-in65.0%
mul-1-neg65.0%
associate-*r/65.0%
mul-1-neg65.0%
Simplified65.0%
if 2.8999999999999998e-150 < t < 1.65e15Initial program 99.8%
Taylor expanded in y around -inf 82.3%
Taylor expanded in z around inf 63.8%
associate-/l*76.9%
Simplified59.4%
clear-num59.3%
un-div-inv60.4%
Applied egg-rr60.4%
associate-/r/63.8%
Applied egg-rr63.8%
Final simplification61.6%
(FPCore (x y z t) :precision binary64 (if (or (<= t -5.8e+47) (not (<= t 5e-32))) (+ x (* y (/ z t))) (/ (* y (- z x)) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -5.8e+47) || !(t <= 5e-32)) {
tmp = x + (y * (z / t));
} 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 <= (-5.8d+47)) .or. (.not. (t <= 5d-32))) then
tmp = x + (y * (z / t))
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 <= -5.8e+47) || !(t <= 5e-32)) {
tmp = x + (y * (z / t));
} else {
tmp = (y * (z - x)) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -5.8e+47) or not (t <= 5e-32): tmp = x + (y * (z / t)) else: tmp = (y * (z - x)) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -5.8e+47) || !(t <= 5e-32)) tmp = Float64(x + Float64(y * Float64(z / t))); 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 <= -5.8e+47) || ~((t <= 5e-32))) tmp = x + (y * (z / t)); else tmp = (y * (z - x)) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -5.8e+47], N[Not[LessEqual[t, 5e-32]], $MachinePrecision]], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(N[(y * N[(z - x), $MachinePrecision]), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.8 \cdot 10^{+47} \lor \neg \left(t \leq 5 \cdot 10^{-32}\right):\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;\frac{y \cdot \left(z - x\right)}{t}\\
\end{array}
\end{array}
if t < -5.79999999999999961e47 or 5e-32 < t Initial program 88.5%
Taylor expanded in z around inf 80.7%
associate-/l*86.2%
Simplified86.2%
if -5.79999999999999961e47 < t < 5e-32Initial program 99.8%
Taylor expanded in y around -inf 90.0%
Final simplification88.2%
(FPCore (x y z t) :precision binary64 (if (or (<= y -1.0) (not (<= y 4e-27))) (* y (/ (- z x) t)) (+ x (/ (* y z) t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.0) || !(y <= 4e-27)) {
tmp = y * ((z - x) / t);
} else {
tmp = x + ((y * z) / 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 <= (-1.0d0)) .or. (.not. (y <= 4d-27))) then
tmp = y * ((z - x) / t)
else
tmp = x + ((y * z) / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -1.0) || !(y <= 4e-27)) {
tmp = y * ((z - x) / t);
} else {
tmp = x + ((y * z) / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -1.0) or not (y <= 4e-27): tmp = y * ((z - x) / t) else: tmp = x + ((y * z) / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -1.0) || !(y <= 4e-27)) tmp = Float64(y * Float64(Float64(z - x) / t)); else tmp = Float64(x + Float64(Float64(y * z) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -1.0) || ~((y <= 4e-27))) tmp = y * ((z - x) / t); else tmp = x + ((y * z) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -1.0], N[Not[LessEqual[y, 4e-27]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -1 \lor \neg \left(y \leq 4 \cdot 10^{-27}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot z}{t}\\
\end{array}
\end{array}
if y < -1 or 4.0000000000000002e-27 < y Initial program 89.7%
Taylor expanded in y around -inf 82.8%
associate-/l*88.9%
*-commutative88.9%
Applied egg-rr88.9%
if -1 < y < 4.0000000000000002e-27Initial program 99.9%
Taylor expanded in z around inf 86.4%
Final simplification87.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -4.5) (not (<= y 4.5e-27))) (* y (/ (- z x) t)) (+ x (* z (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -4.5) || !(y <= 4.5e-27)) {
tmp = y * ((z - x) / 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 ((y <= (-4.5d0)) .or. (.not. (y <= 4.5d-27))) then
tmp = y * ((z - x) / 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 ((y <= -4.5) || !(y <= 4.5e-27)) {
tmp = y * ((z - x) / t);
} else {
tmp = x + (z * (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -4.5) or not (y <= 4.5e-27): tmp = y * ((z - x) / t) else: tmp = x + (z * (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -4.5) || !(y <= 4.5e-27)) tmp = Float64(y * Float64(Float64(z - x) / 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 ((y <= -4.5) || ~((y <= 4.5e-27))) tmp = y * ((z - x) / t); else tmp = x + (z * (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -4.5], N[Not[LessEqual[y, 4.5e-27]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -4.5 \lor \neg \left(y \leq 4.5 \cdot 10^{-27}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if y < -4.5 or 4.5000000000000002e-27 < y Initial program 89.7%
Taylor expanded in y around -inf 82.8%
associate-/l*88.9%
*-commutative88.9%
Applied egg-rr88.9%
if -4.5 < y < 4.5000000000000002e-27Initial program 99.9%
Taylor expanded in z around 0 99.0%
mul-1-neg99.0%
associate-/l*99.0%
distribute-lft-neg-in99.0%
*-commutative99.0%
associate-*r/96.1%
distribute-rgt-in97.0%
+-commutative97.0%
sub-neg97.0%
Simplified97.0%
Taylor expanded in z around inf 83.5%
Final simplification86.5%
(FPCore (x y z t) :precision binary64 (if (or (<= y -3.8) (not (<= y 2.8e-28))) (* y (/ (- z x) t)) (+ x (* y (/ z t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8) || !(y <= 2.8e-28)) {
tmp = y * ((z - x) / t);
} else {
tmp = x + (y * (z / 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 <= (-3.8d0)) .or. (.not. (y <= 2.8d-28))) then
tmp = y * ((z - x) / t)
else
tmp = x + (y * (z / t))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -3.8) || !(y <= 2.8e-28)) {
tmp = y * ((z - x) / t);
} else {
tmp = x + (y * (z / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -3.8) or not (y <= 2.8e-28): tmp = y * ((z - x) / t) else: tmp = x + (y * (z / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -3.8) || !(y <= 2.8e-28)) tmp = Float64(y * Float64(Float64(z - x) / t)); else tmp = Float64(x + Float64(y * Float64(z / t))); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((y <= -3.8) || ~((y <= 2.8e-28))) tmp = y * ((z - x) / t); else tmp = x + (y * (z / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -3.8], N[Not[LessEqual[y, 2.8e-28]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -3.8 \lor \neg \left(y \leq 2.8 \cdot 10^{-28}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if y < -3.7999999999999998 or 2.7999999999999998e-28 < y Initial program 89.7%
Taylor expanded in y around -inf 82.8%
associate-/l*88.9%
*-commutative88.9%
Applied egg-rr88.9%
if -3.7999999999999998 < y < 2.7999999999999998e-28Initial program 99.9%
Taylor expanded in z around inf 86.4%
associate-/l*80.6%
Simplified80.6%
Final simplification85.1%
(FPCore (x y z t) :precision binary64 (if (or (<= y -2600000.0) (not (<= y 1.45e-27))) (* y (/ (- z x) t)) (* x (- 1.0 (/ y t)))))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -2600000.0) || !(y <= 1.45e-27)) {
tmp = y * ((z - x) / 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 ((y <= (-2600000.0d0)) .or. (.not. (y <= 1.45d-27))) then
tmp = y * ((z - x) / 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 ((y <= -2600000.0) || !(y <= 1.45e-27)) {
tmp = y * ((z - x) / t);
} else {
tmp = x * (1.0 - (y / t));
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -2600000.0) or not (y <= 1.45e-27): tmp = y * ((z - x) / t) else: tmp = x * (1.0 - (y / t)) return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -2600000.0) || !(y <= 1.45e-27)) tmp = Float64(y * Float64(Float64(z - x) / 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 ((y <= -2600000.0) || ~((y <= 1.45e-27))) tmp = y * ((z - x) / t); else tmp = x * (1.0 - (y / t)); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -2600000.0], N[Not[LessEqual[y, 1.45e-27]], $MachinePrecision]], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -2600000 \lor \neg \left(y \leq 1.45 \cdot 10^{-27}\right):\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\end{array}
\end{array}
if y < -2.6e6 or 1.45000000000000002e-27 < y Initial program 89.7%
Taylor expanded in y around -inf 82.6%
associate-/l*88.9%
*-commutative88.9%
Applied egg-rr88.9%
if -2.6e6 < y < 1.45000000000000002e-27Initial program 99.9%
Taylor expanded in x around inf 73.1%
mul-1-neg73.1%
unsub-neg73.1%
Simplified73.1%
Final simplification81.7%
(FPCore (x y z t) :precision binary64 (if (or (<= x -3.1e-57) (not (<= x 4.1e-67))) (* x (- 1.0 (/ y t))) (* y (/ z t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-57) || !(x <= 4.1e-67)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * (z / 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 ((x <= (-3.1d-57)) .or. (.not. (x <= 4.1d-67))) then
tmp = x * (1.0d0 - (y / t))
else
tmp = y * (z / t)
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((x <= -3.1e-57) || !(x <= 4.1e-67)) {
tmp = x * (1.0 - (y / t));
} else {
tmp = y * (z / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (x <= -3.1e-57) or not (x <= 4.1e-67): tmp = x * (1.0 - (y / t)) else: tmp = y * (z / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((x <= -3.1e-57) || !(x <= 4.1e-67)) tmp = Float64(x * Float64(1.0 - Float64(y / t))); else tmp = Float64(y * Float64(z / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((x <= -3.1e-57) || ~((x <= 4.1e-67))) tmp = x * (1.0 - (y / t)); else tmp = y * (z / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[x, -3.1e-57], N[Not[LessEqual[x, 4.1e-67]], $MachinePrecision]], N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -3.1 \cdot 10^{-57} \lor \neg \left(x \leq 4.1 \cdot 10^{-67}\right):\\
\;\;\;\;x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z}{t}\\
\end{array}
\end{array}
if x < -3.09999999999999976e-57 or 4.0999999999999997e-67 < x Initial program 94.6%
Taylor expanded in x around inf 82.4%
mul-1-neg82.4%
unsub-neg82.4%
Simplified82.4%
if -3.09999999999999976e-57 < x < 4.0999999999999997e-67Initial program 93.9%
Taylor expanded in y around -inf 73.9%
Taylor expanded in z around inf 64.0%
associate-/l*86.9%
Simplified67.4%
Final simplification76.8%
(FPCore (x y z t) :precision binary64 (if (or (<= y -0.84) (not (<= y 7.6e-26))) (* y (/ z t)) x))
double code(double x, double y, double z, double t) {
double tmp;
if ((y <= -0.84) || !(y <= 7.6e-26)) {
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 <= (-0.84d0)) .or. (.not. (y <= 7.6d-26))) 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 <= -0.84) || !(y <= 7.6e-26)) {
tmp = y * (z / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (y <= -0.84) or not (y <= 7.6e-26): tmp = y * (z / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if ((y <= -0.84) || !(y <= 7.6e-26)) 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 <= -0.84) || ~((y <= 7.6e-26))) tmp = y * (z / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[y, -0.84], N[Not[LessEqual[y, 7.6e-26]], $MachinePrecision]], N[(y * N[(z / t), $MachinePrecision]), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;y \leq -0.84 \lor \neg \left(y \leq 7.6 \cdot 10^{-26}\right):\\
\;\;\;\;y \cdot \frac{z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if y < -0.839999999999999969 or 7.60000000000000029e-26 < y Initial program 89.7%
Taylor expanded in y around -inf 82.6%
Taylor expanded in z around inf 48.5%
associate-/l*60.8%
Simplified52.8%
if -0.839999999999999969 < y < 7.60000000000000029e-26Initial program 99.9%
Taylor expanded in y around 0 59.0%
Final simplification55.7%
(FPCore (x y z t) :precision binary64 (if (<= t -5.2e+73) x (if (<= t 8.5e+14) (/ (* y z) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -5.2e+73) {
tmp = x;
} else if (t <= 8.5e+14) {
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 (t <= (-5.2d+73)) then
tmp = x
else if (t <= 8.5d+14) 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 (t <= -5.2e+73) {
tmp = x;
} else if (t <= 8.5e+14) {
tmp = (y * z) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -5.2e+73: tmp = x elif t <= 8.5e+14: tmp = (y * z) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -5.2e+73) tmp = x; elseif (t <= 8.5e+14) tmp = Float64(Float64(y * z) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -5.2e+73) tmp = x; elseif (t <= 8.5e+14) tmp = (y * z) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -5.2e+73], x, If[LessEqual[t, 8.5e+14], N[(N[(y * z), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -5.2 \cdot 10^{+73}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 8.5 \cdot 10^{+14}:\\
\;\;\;\;\frac{y \cdot z}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -5.2000000000000001e73 or 8.5e14 < t Initial program 85.7%
Taylor expanded in y around 0 62.6%
if -5.2000000000000001e73 < t < 8.5e14Initial program 99.9%
Taylor expanded in y around -inf 87.9%
Taylor expanded in z around inf 53.2%
(FPCore (x y z t) :precision binary64 (if (<= t -1.24e+73) x (if (<= t 4800000000000.0) (* z (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -1.24e+73) {
tmp = x;
} else if (t <= 4800000000000.0) {
tmp = z * (y / 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 (t <= (-1.24d+73)) then
tmp = x
else if (t <= 4800000000000.0d0) then
tmp = z * (y / 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 (t <= -1.24e+73) {
tmp = x;
} else if (t <= 4800000000000.0) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -1.24e+73: tmp = x elif t <= 4800000000000.0: tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -1.24e+73) tmp = x; elseif (t <= 4800000000000.0) tmp = Float64(z * Float64(y / t)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -1.24e+73) tmp = x; elseif (t <= 4800000000000.0) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -1.24e+73], x, If[LessEqual[t, 4800000000000.0], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.24 \cdot 10^{+73}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 4800000000000:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -1.23999999999999995e73 or 4.8e12 < t Initial program 85.7%
Taylor expanded in y around 0 62.6%
if -1.23999999999999995e73 < t < 4.8e12Initial program 99.9%
Taylor expanded in y around -inf 87.9%
Taylor expanded in z around inf 53.2%
associate-/l*59.7%
Simplified48.3%
clear-num48.2%
un-div-inv49.0%
Applied egg-rr49.0%
associate-/r/52.8%
Applied egg-rr52.8%
Final simplification56.6%
(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.3%
Taylor expanded in z around 0 90.0%
mul-1-neg90.0%
associate-/l*88.1%
distribute-lft-neg-in88.1%
*-commutative88.1%
associate-*r/88.4%
distribute-rgt-in96.0%
+-commutative96.0%
sub-neg96.0%
Simplified96.0%
Final simplification96.0%
(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.3%
Taylor expanded in y around 0 32.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 2024144
(FPCore (x y z t)
:name "Optimisation.CirclePacking:place from circle-packing-0.1.0.4, D"
:precision binary64
:alt
(! :herbie-platform default (- x (+ (* x (/ y t)) (* (- z) (/ y t)))))
(+ x (/ (* y (- z x)) t)))