
(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 (/ (* (- z x) y) t))))
(if (<= t_1 (- INFINITY))
(+ x (/ y (/ t (- z x))))
(if (<= t_1 1e+300) t_1 (* y (/ (- z x) t))))))
double code(double x, double y, double z, double t) {
double t_1 = x + (((z - x) * y) / t);
double tmp;
if (t_1 <= -((double) INFINITY)) {
tmp = x + (y / (t / (z - x)));
} else if (t_1 <= 1e+300) {
tmp = t_1;
} else {
tmp = y * ((z - x) / t);
}
return tmp;
}
public static double code(double x, double y, double z, double t) {
double t_1 = x + (((z - x) * y) / t);
double tmp;
if (t_1 <= -Double.POSITIVE_INFINITY) {
tmp = x + (y / (t / (z - x)));
} else if (t_1 <= 1e+300) {
tmp = t_1;
} else {
tmp = y * ((z - x) / t);
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (((z - x) * y) / t) tmp = 0 if t_1 <= -math.inf: tmp = x + (y / (t / (z - x))) elif t_1 <= 1e+300: tmp = t_1 else: tmp = y * ((z - x) / t) return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(Float64(Float64(z - x) * y) / t)) tmp = 0.0 if (t_1 <= Float64(-Inf)) tmp = Float64(x + Float64(y / Float64(t / Float64(z - x)))); elseif (t_1 <= 1e+300) tmp = t_1; else tmp = Float64(y * Float64(Float64(z - x) / t)); end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x + (((z - x) * y) / t); tmp = 0.0; if (t_1 <= -Inf) tmp = x + (y / (t / (z - x))); elseif (t_1 <= 1e+300) tmp = t_1; else tmp = y * ((z - x) / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, (-Infinity)], N[(x + N[(y / N[(t / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[t$95$1, 1e+300], t$95$1, N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{\left(z - x\right) \cdot y}{t}\\
\mathbf{if}\;t\_1 \leq -\infty:\\
\;\;\;\;x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{elif}\;t\_1 \leq 10^{+300}:\\
\;\;\;\;t\_1\\
\mathbf{else}:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0Initial program 79.9%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6499.9%
Applied egg-rr99.9%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 1.0000000000000001e300Initial program 98.6%
if 1.0000000000000001e300 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 88.6%
Taylor expanded in y around inf
div-subN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f64100.0%
Simplified100.0%
Final simplification99.1%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (+ x (/ y (/ t (- z x)))))) (if (<= y -1.25e-191) t_1 (if (<= y 2.1e-191) (+ x (* z (/ y t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x + (y / (t / (z - x)));
double tmp;
if (y <= -1.25e-191) {
tmp = t_1;
} else if (y <= 2.1e-191) {
tmp = x + (z * (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 - x)))
if (y <= (-1.25d-191)) then
tmp = t_1
else if (y <= 2.1d-191) then
tmp = x + (z * (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 - x)));
double tmp;
if (y <= -1.25e-191) {
tmp = t_1;
} else if (y <= 2.1e-191) {
tmp = x + (z * (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x + (y / (t / (z - x))) tmp = 0 if y <= -1.25e-191: tmp = t_1 elif y <= 2.1e-191: tmp = x + (z * (y / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x + Float64(y / Float64(t / Float64(z - x)))) tmp = 0.0 if (y <= -1.25e-191) tmp = t_1; elseif (y <= 2.1e-191) tmp = Float64(x + Float64(z * 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 - x))); tmp = 0.0; if (y <= -1.25e-191) tmp = t_1; elseif (y <= 2.1e-191) tmp = x + (z * (y / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x + N[(y / N[(t / N[(z - x), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[y, -1.25e-191], t$95$1, If[LessEqual[y, 2.1e-191], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y}{\frac{t}{z - x}}\\
\mathbf{if}\;y \leq -1.25 \cdot 10^{-191}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;y \leq 2.1 \cdot 10^{-191}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if y < -1.25e-191 or 2.09999999999999985e-191 < y Initial program 92.3%
associate-/l*N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
/-lowering-/.f64N/A
--lowering--.f6494.8%
Applied egg-rr94.8%
if -1.25e-191 < y < 2.09999999999999985e-191Initial program 99.9%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f64100.0%
Applied egg-rr100.0%
Taylor expanded in z around inf
Simplified100.0%
Final simplification95.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y t))))) (if (<= x -1450000000.0) t_1 (if (<= x 2.4e+103) (+ x (* z (/ y t))) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (x <= -1450000000.0) {
tmp = t_1;
} else if (x <= 2.4e+103) {
tmp = x + (z * (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 * (1.0d0 - (y / t))
if (x <= (-1450000000.0d0)) then
tmp = t_1
else if (x <= 2.4d+103) then
tmp = x + (z * (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 * (1.0 - (y / t));
double tmp;
if (x <= -1450000000.0) {
tmp = t_1;
} else if (x <= 2.4e+103) {
tmp = x + (z * (y / t));
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if x <= -1450000000.0: tmp = t_1 elif x <= 2.4e+103: tmp = x + (z * (y / t)) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -1450000000.0) tmp = t_1; elseif (x <= 2.4e+103) tmp = Float64(x + Float64(z * Float64(y / t))); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); tmp = 0.0; if (x <= -1450000000.0) tmp = t_1; elseif (x <= 2.4e+103) tmp = x + (z * (y / t)); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -1450000000.0], t$95$1, If[LessEqual[x, 2.4e+103], N[(x + N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -1450000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.4 \cdot 10^{+103}:\\
\;\;\;\;x + z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -1.45e9 or 2.3999999999999998e103 < x Initial program 94.3%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6497.5%
Simplified97.5%
if -1.45e9 < x < 2.3999999999999998e103Initial program 93.0%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6495.7%
Applied egg-rr95.7%
Taylor expanded in z around inf
Simplified80.6%
Final simplification88.4%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y t))))) (if (<= x -980000000.0) t_1 (if (<= x 6e+58) (+ x (/ (* z y) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (x <= -980000000.0) {
tmp = t_1;
} else if (x <= 6e+58) {
tmp = x + ((z * 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 * (1.0d0 - (y / t))
if (x <= (-980000000.0d0)) then
tmp = t_1
else if (x <= 6d+58) then
tmp = x + ((z * 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 * (1.0 - (y / t));
double tmp;
if (x <= -980000000.0) {
tmp = t_1;
} else if (x <= 6e+58) {
tmp = x + ((z * y) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if x <= -980000000.0: tmp = t_1 elif x <= 6e+58: tmp = x + ((z * y) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -980000000.0) tmp = t_1; elseif (x <= 6e+58) tmp = Float64(x + Float64(Float64(z * y) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); tmp = 0.0; if (x <= -980000000.0) tmp = t_1; elseif (x <= 6e+58) tmp = x + ((z * y) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -980000000.0], t$95$1, If[LessEqual[x, 6e+58], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -980000000:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 6 \cdot 10^{+58}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -9.8e8 or 6.0000000000000005e58 < x Initial program 93.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6496.8%
Simplified96.8%
if -9.8e8 < x < 6.0000000000000005e58Initial program 93.4%
Taylor expanded in z around inf
/-lowering-/.f64N/A
*-lowering-*.f6479.0%
Simplified79.0%
Final simplification87.6%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y t))))) (if (<= x -7.6e+36) t_1 (if (<= x 0.00068) (* y (/ (- z x) t)) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (x <= -7.6e+36) {
tmp = t_1;
} else if (x <= 0.00068) {
tmp = y * ((z - x) / 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 * (1.0d0 - (y / t))
if (x <= (-7.6d+36)) then
tmp = t_1
else if (x <= 0.00068d0) then
tmp = y * ((z - x) / 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 * (1.0 - (y / t));
double tmp;
if (x <= -7.6e+36) {
tmp = t_1;
} else if (x <= 0.00068) {
tmp = y * ((z - x) / t);
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if x <= -7.6e+36: tmp = t_1 elif x <= 0.00068: tmp = y * ((z - x) / t) else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -7.6e+36) tmp = t_1; elseif (x <= 0.00068) tmp = Float64(y * Float64(Float64(z - x) / t)); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); tmp = 0.0; if (x <= -7.6e+36) tmp = t_1; elseif (x <= 0.00068) tmp = y * ((z - x) / t); else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -7.6e+36], t$95$1, If[LessEqual[x, 0.00068], N[(y * N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -7.6 \cdot 10^{+36}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 0.00068:\\
\;\;\;\;y \cdot \frac{z - x}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -7.6000000000000005e36 or 6.8e-4 < x Initial program 93.0%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6492.3%
Simplified92.3%
if -7.6000000000000005e36 < x < 6.8e-4Initial program 94.2%
Taylor expanded in y around inf
div-subN/A
*-lowering-*.f64N/A
/-lowering-/.f64N/A
--lowering--.f6469.3%
Simplified69.3%
(FPCore (x y z t) :precision binary64 (let* ((t_1 (* x (- 1.0 (/ y t))))) (if (<= x -3.15e-102) t_1 (if (<= x 2.5e-21) (/ (* z y) t) t_1))))
double code(double x, double y, double z, double t) {
double t_1 = x * (1.0 - (y / t));
double tmp;
if (x <= -3.15e-102) {
tmp = t_1;
} else if (x <= 2.5e-21) {
tmp = (z * 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 * (1.0d0 - (y / t))
if (x <= (-3.15d-102)) then
tmp = t_1
else if (x <= 2.5d-21) then
tmp = (z * 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 * (1.0 - (y / t));
double tmp;
if (x <= -3.15e-102) {
tmp = t_1;
} else if (x <= 2.5e-21) {
tmp = (z * y) / t;
} else {
tmp = t_1;
}
return tmp;
}
def code(x, y, z, t): t_1 = x * (1.0 - (y / t)) tmp = 0 if x <= -3.15e-102: tmp = t_1 elif x <= 2.5e-21: tmp = (z * y) / t else: tmp = t_1 return tmp
function code(x, y, z, t) t_1 = Float64(x * Float64(1.0 - Float64(y / t))) tmp = 0.0 if (x <= -3.15e-102) tmp = t_1; elseif (x <= 2.5e-21) tmp = Float64(Float64(z * y) / t); else tmp = t_1; end return tmp end
function tmp_2 = code(x, y, z, t) t_1 = x * (1.0 - (y / t)); tmp = 0.0; if (x <= -3.15e-102) tmp = t_1; elseif (x <= 2.5e-21) tmp = (z * y) / t; else tmp = t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := Block[{t$95$1 = N[(x * N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[x, -3.15e-102], t$95$1, If[LessEqual[x, 2.5e-21], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], t$95$1]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x \cdot \left(1 - \frac{y}{t}\right)\\
\mathbf{if}\;x \leq -3.15 \cdot 10^{-102}:\\
\;\;\;\;t\_1\\
\mathbf{elif}\;x \leq 2.5 \cdot 10^{-21}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;t\_1\\
\end{array}
\end{array}
if x < -3.15e-102 or 2.49999999999999986e-21 < x Initial program 93.1%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6487.0%
Simplified87.0%
if -3.15e-102 < x < 2.49999999999999986e-21Initial program 94.5%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6464.2%
Simplified64.2%
Final simplification79.0%
(FPCore (x y z t) :precision binary64 (if (<= x -5000000000.0) (- 0.0 (* x (/ y t))) (if (<= x 8e+54) (/ z (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -5000000000.0) {
tmp = 0.0 - (x * (y / t));
} else if (x <= 8e+54) {
tmp = z / (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 (x <= (-5000000000.0d0)) then
tmp = 0.0d0 - (x * (y / t))
else if (x <= 8d+54) then
tmp = z / (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 (x <= -5000000000.0) {
tmp = 0.0 - (x * (y / t));
} else if (x <= 8e+54) {
tmp = z / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -5000000000.0: tmp = 0.0 - (x * (y / t)) elif x <= 8e+54: tmp = z / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -5000000000.0) tmp = Float64(0.0 - Float64(x * Float64(y / t))); elseif (x <= 8e+54) tmp = Float64(z / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -5000000000.0) tmp = 0.0 - (x * (y / t)); elseif (x <= 8e+54) tmp = z / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -5000000000.0], N[(0.0 - N[(x * N[(y / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 8e+54], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -5000000000:\\
\;\;\;\;0 - x \cdot \frac{y}{t}\\
\mathbf{elif}\;x \leq 8 \cdot 10^{+54}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -5e9Initial program 94.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6498.5%
Simplified98.5%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6456.2%
Simplified56.2%
sub0-negN/A
associate-/l*N/A
distribute-rgt-neg-inN/A
*-lowering-*.f64N/A
neg-lowering-neg.f64N/A
/-lowering-/.f6458.9%
Applied egg-rr58.9%
if -5e9 < x < 8.0000000000000006e54Initial program 93.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6454.5%
Simplified54.5%
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6456.3%
Applied egg-rr56.3%
if 8.0000000000000006e54 < x Initial program 92.5%
Taylor expanded in y around 0
Simplified61.7%
Final simplification58.1%
(FPCore (x y z t) :precision binary64 (if (<= x -190000000.0) (/ x (- 0.0 (/ t y))) (if (<= x 4.8e+54) (/ z (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (x <= -190000000.0) {
tmp = x / (0.0 - (t / y));
} else if (x <= 4.8e+54) {
tmp = z / (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 (x <= (-190000000.0d0)) then
tmp = x / (0.0d0 - (t / y))
else if (x <= 4.8d+54) then
tmp = z / (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 (x <= -190000000.0) {
tmp = x / (0.0 - (t / y));
} else if (x <= 4.8e+54) {
tmp = z / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if x <= -190000000.0: tmp = x / (0.0 - (t / y)) elif x <= 4.8e+54: tmp = z / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (x <= -190000000.0) tmp = Float64(x / Float64(0.0 - Float64(t / y))); elseif (x <= 4.8e+54) tmp = Float64(z / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (x <= -190000000.0) tmp = x / (0.0 - (t / y)); elseif (x <= 4.8e+54) tmp = z / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[x, -190000000.0], N[(x / N[(0.0 - N[(t / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[x, 4.8e+54], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;x \leq -190000000:\\
\;\;\;\;\frac{x}{0 - \frac{t}{y}}\\
\mathbf{elif}\;x \leq 4.8 \cdot 10^{+54}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if x < -1.9e8Initial program 94.8%
Taylor expanded in x around inf
*-lowering-*.f64N/A
mul-1-negN/A
unsub-negN/A
--lowering--.f64N/A
/-lowering-/.f6498.5%
Simplified98.5%
Taylor expanded in y around inf
mul-1-negN/A
neg-sub0N/A
--lowering--.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6456.2%
Simplified56.2%
sub0-negN/A
neg-lowering-neg.f64N/A
/-lowering-/.f64N/A
*-lowering-*.f6456.2%
Applied egg-rr56.2%
associate-*l/N/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6458.8%
Applied egg-rr58.8%
if -1.9e8 < x < 4.79999999999999997e54Initial program 93.4%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6454.5%
Simplified54.5%
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6456.3%
Applied egg-rr56.3%
if 4.79999999999999997e54 < x Initial program 92.5%
Taylor expanded in y around 0
Simplified61.7%
Final simplification55.7%
(FPCore (x y z t) :precision binary64 (if (<= t -2.8e-44) x (if (<= t 1.55e-18) (/ (* z y) t) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.8e-44) {
tmp = x;
} else if (t <= 1.55e-18) {
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-44)) then
tmp = x
else if (t <= 1.55d-18) 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-44) {
tmp = x;
} else if (t <= 1.55e-18) {
tmp = (z * y) / t;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.8e-44: tmp = x elif t <= 1.55e-18: tmp = (z * y) / t else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.8e-44) tmp = x; elseif (t <= 1.55e-18) tmp = Float64(Float64(z * y) / t); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.8e-44) tmp = x; elseif (t <= 1.55e-18) tmp = (z * y) / t; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.8e-44], x, If[LessEqual[t, 1.55e-18], N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.8 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.55 \cdot 10^{-18}:\\
\;\;\;\;\frac{z \cdot y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.8e-44 or 1.55000000000000003e-18 < t Initial program 89.0%
Taylor expanded in y around 0
Simplified61.4%
if -2.8e-44 < t < 1.55000000000000003e-18Initial program 98.3%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6450.6%
Simplified50.6%
Final simplification56.1%
(FPCore (x y z t) :precision binary64 (if (<= t -2.7e-44) x (if (<= t 1.7e+95) (/ z (/ t y)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -2.7e-44) {
tmp = x;
} else if (t <= 1.7e+95) {
tmp = z / (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 (t <= (-2.7d-44)) then
tmp = x
else if (t <= 1.7d+95) then
tmp = z / (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 (t <= -2.7e-44) {
tmp = x;
} else if (t <= 1.7e+95) {
tmp = z / (t / y);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -2.7e-44: tmp = x elif t <= 1.7e+95: tmp = z / (t / y) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -2.7e-44) tmp = x; elseif (t <= 1.7e+95) tmp = Float64(z / Float64(t / y)); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -2.7e-44) tmp = x; elseif (t <= 1.7e+95) tmp = z / (t / y); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -2.7e-44], x, If[LessEqual[t, 1.7e+95], N[(z / N[(t / y), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.7 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 1.7 \cdot 10^{+95}:\\
\;\;\;\;\frac{z}{\frac{t}{y}}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -2.6999999999999999e-44 or 1.70000000000000011e95 < t Initial program 89.2%
Taylor expanded in y around 0
Simplified64.6%
if -2.6999999999999999e-44 < t < 1.70000000000000011e95Initial program 97.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6448.3%
Simplified48.3%
associate-/l*N/A
*-commutativeN/A
associate-/r/N/A
/-lowering-/.f64N/A
/-lowering-/.f6448.6%
Applied egg-rr48.6%
(FPCore (x y z t) :precision binary64 (if (<= t -3.4e-44) x (if (<= t 2.4e+95) (* z (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -3.4e-44) {
tmp = x;
} else if (t <= 2.4e+95) {
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 <= (-3.4d-44)) then
tmp = x
else if (t <= 2.4d+95) 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 <= -3.4e-44) {
tmp = x;
} else if (t <= 2.4e+95) {
tmp = z * (y / t);
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -3.4e-44: tmp = x elif t <= 2.4e+95: tmp = z * (y / t) else: tmp = x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -3.4e-44) tmp = x; elseif (t <= 2.4e+95) 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 <= -3.4e-44) tmp = x; elseif (t <= 2.4e+95) tmp = z * (y / t); else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -3.4e-44], x, If[LessEqual[t, 2.4e+95], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], x]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -3.4 \cdot 10^{-44}:\\
\;\;\;\;x\\
\mathbf{elif}\;t \leq 2.4 \cdot 10^{+95}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if t < -3.40000000000000016e-44 or 2.4e95 < t Initial program 89.2%
Taylor expanded in y around 0
Simplified64.6%
if -3.40000000000000016e-44 < t < 2.4e95Initial program 97.2%
Taylor expanded in x around 0
/-lowering-/.f64N/A
*-lowering-*.f6448.3%
Simplified48.3%
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
*-lowering-*.f64N/A
/-lowering-/.f6448.6%
Applied egg-rr48.6%
Final simplification55.8%
(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 93.6%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.6%
Applied egg-rr97.6%
associate-*r/N/A
remove-double-divN/A
associate-/r/N/A
clear-numN/A
+-lowering-+.f64N/A
associate-/r/N/A
/-rgt-identityN/A
*-commutativeN/A
associate-*r/N/A
clear-numN/A
un-div-invN/A
/-lowering-/.f64N/A
--lowering--.f64N/A
/-lowering-/.f6498.0%
Applied egg-rr98.0%
Final simplification98.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 93.6%
+-commutativeN/A
+-lowering-+.f64N/A
*-commutativeN/A
associate-/l*N/A
*-lowering-*.f64N/A
--lowering--.f64N/A
/-lowering-/.f6497.6%
Applied egg-rr97.6%
Final simplification97.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 93.6%
Taylor expanded in y around 0
Simplified38.1%
(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 2024185
(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)))