
(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 8 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 (fma (/ y t) (- z x) x))
double code(double x, double y, double z, double t) {
return fma((y / t), (z - x), x);
}
function code(x, y, z, t) return fma(Float64(y / t), Float64(z - x), x) end
code[x_, y_, z_, t_] := N[(N[(y / t), $MachinePrecision] * N[(z - x), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(\frac{y}{t}, z - x, x\right)
\end{array}
Initial program 90.6%
lift-+.f64N/A
+-commutativeN/A
lift-/.f64N/A
lift-*.f64N/A
*-commutativeN/A
associate-/l*N/A
*-commutativeN/A
lower-fma.f64N/A
lower-/.f6498.2
Applied rewrites98.2%
(FPCore (x y z t)
:precision binary64
(let* ((t_1 (+ x (/ (* y (- z x)) t))))
(if (or (<= t_1 (- INFINITY)) (not (<= t_1 1e+265)))
(* (/ (- z x) t) y)
(+ x (/ (* z 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 <= -((double) INFINITY)) || !(t_1 <= 1e+265)) {
tmp = ((z - x) / t) * y;
} else {
tmp = x + ((z * y) / t);
}
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+265)) {
tmp = ((z - x) / t) * y;
} else {
tmp = x + ((z * y) / t);
}
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+265): tmp = ((z - x) / t) * y else: tmp = x + ((z * 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 <= Float64(-Inf)) || !(t_1 <= 1e+265)) tmp = Float64(Float64(Float64(z - x) / t) * y); else tmp = Float64(x + Float64(Float64(z * 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 <= -Inf) || ~((t_1 <= 1e+265))) tmp = ((z - x) / t) * y; else tmp = x + ((z * 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[Or[LessEqual[t$95$1, (-Infinity)], N[Not[LessEqual[t$95$1, 1e+265]], $MachinePrecision]], N[(N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision], N[(x + N[(N[(z * y), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := x + \frac{y \cdot \left(z - x\right)}{t}\\
\mathbf{if}\;t\_1 \leq -\infty \lor \neg \left(t\_1 \leq 10^{+265}\right):\\
\;\;\;\;\frac{z - x}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + \frac{z \cdot y}{t}\\
\end{array}
\end{array}
if (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < -inf.0 or 1.00000000000000007e265 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) Initial program 77.1%
Taylor expanded in y around inf
div-subN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6491.5
Applied rewrites91.5%
if -inf.0 < (+.f64 x (/.f64 (*.f64 y (-.f64 z x)) t)) < 1.00000000000000007e265Initial program 98.1%
Taylor expanded in x around 0
*-commutativeN/A
lower-*.f6484.7
Applied rewrites84.7%
Final simplification87.1%
(FPCore (x y z t)
:precision binary64
(if (<= t -9.5e+135)
(* 1.0 x)
(if (<= t 6.6e-213)
(* z (/ y t))
(if (<= t 1.65e-106)
(* (/ (- y) t) x)
(if (<= t 1.1e+134) (* (/ z t) y) (* 1.0 x))))))
double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9.5e+135) {
tmp = 1.0 * x;
} else if (t <= 6.6e-213) {
tmp = z * (y / t);
} else if (t <= 1.65e-106) {
tmp = (-y / t) * x;
} else if (t <= 1.1e+134) {
tmp = (z / t) * y;
} else {
tmp = 1.0 * 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 <= (-9.5d+135)) then
tmp = 1.0d0 * x
else if (t <= 6.6d-213) then
tmp = z * (y / t)
else if (t <= 1.65d-106) then
tmp = (-y / t) * x
else if (t <= 1.1d+134) then
tmp = (z / t) * y
else
tmp = 1.0d0 * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (t <= -9.5e+135) {
tmp = 1.0 * x;
} else if (t <= 6.6e-213) {
tmp = z * (y / t);
} else if (t <= 1.65e-106) {
tmp = (-y / t) * x;
} else if (t <= 1.1e+134) {
tmp = (z / t) * y;
} else {
tmp = 1.0 * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if t <= -9.5e+135: tmp = 1.0 * x elif t <= 6.6e-213: tmp = z * (y / t) elif t <= 1.65e-106: tmp = (-y / t) * x elif t <= 1.1e+134: tmp = (z / t) * y else: tmp = 1.0 * x return tmp
function code(x, y, z, t) tmp = 0.0 if (t <= -9.5e+135) tmp = Float64(1.0 * x); elseif (t <= 6.6e-213) tmp = Float64(z * Float64(y / t)); elseif (t <= 1.65e-106) tmp = Float64(Float64(Float64(-y) / t) * x); elseif (t <= 1.1e+134) tmp = Float64(Float64(z / t) * y); else tmp = Float64(1.0 * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (t <= -9.5e+135) tmp = 1.0 * x; elseif (t <= 6.6e-213) tmp = z * (y / t); elseif (t <= 1.65e-106) tmp = (-y / t) * x; elseif (t <= 1.1e+134) tmp = (z / t) * y; else tmp = 1.0 * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[t, -9.5e+135], N[(1.0 * x), $MachinePrecision], If[LessEqual[t, 6.6e-213], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[t, 1.65e-106], N[(N[((-y) / t), $MachinePrecision] * x), $MachinePrecision], If[LessEqual[t, 1.1e+134], N[(N[(z / t), $MachinePrecision] * y), $MachinePrecision], N[(1.0 * x), $MachinePrecision]]]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+135}:\\
\;\;\;\;1 \cdot x\\
\mathbf{elif}\;t \leq 6.6 \cdot 10^{-213}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;t \leq 1.65 \cdot 10^{-106}:\\
\;\;\;\;\frac{-y}{t} \cdot x\\
\mathbf{elif}\;t \leq 1.1 \cdot 10^{+134}:\\
\;\;\;\;\frac{z}{t} \cdot y\\
\mathbf{else}:\\
\;\;\;\;1 \cdot x\\
\end{array}
\end{array}
if t < -9.50000000000000036e135 or 1.1e134 < t Initial program 78.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f6481.6
Applied rewrites81.6%
Taylor expanded in y around 0
Applied rewrites74.8%
if -9.50000000000000036e135 < t < 6.60000000000000062e-213Initial program 95.5%
Taylor expanded in x around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6452.2
Applied rewrites52.2%
Applied rewrites60.8%
if 6.60000000000000062e-213 < t < 1.65000000000000008e-106Initial program 94.4%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f6486.3
Applied rewrites86.3%
Taylor expanded in y around inf
Applied rewrites78.7%
if 1.65000000000000008e-106 < t < 1.1e134Initial program 97.3%
Taylor expanded in x around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6460.7
Applied rewrites60.7%
(FPCore (x y z t) :precision binary64 (if (or (<= t -1.75e+72) (not (<= t 1.1e+134))) (* (- 1.0 (/ y t)) x) (/ (* (- z x) y) t)))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -1.75e+72) || !(t <= 1.1e+134)) {
tmp = (1.0 - (y / t)) * x;
} 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.75d+72)) .or. (.not. (t <= 1.1d+134))) then
tmp = (1.0d0 - (y / t)) * x
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.75e+72) || !(t <= 1.1e+134)) {
tmp = (1.0 - (y / t)) * x;
} else {
tmp = ((z - x) * y) / t;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -1.75e+72) or not (t <= 1.1e+134): tmp = (1.0 - (y / t)) * x else: tmp = ((z - x) * y) / t return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -1.75e+72) || !(t <= 1.1e+134)) tmp = Float64(Float64(1.0 - Float64(y / t)) * x); else tmp = Float64(Float64(Float64(z - x) * y) / t); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -1.75e+72) || ~((t <= 1.1e+134))) tmp = (1.0 - (y / t)) * x; else tmp = ((z - x) * y) / t; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -1.75e+72], N[Not[LessEqual[t, 1.1e+134]], $MachinePrecision]], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(z - x), $MachinePrecision] * y), $MachinePrecision] / t), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.75 \cdot 10^{+72} \lor \neg \left(t \leq 1.1 \cdot 10^{+134}\right):\\
\;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{\left(z - x\right) \cdot y}{t}\\
\end{array}
\end{array}
if t < -1.75000000000000005e72 or 1.1e134 < t Initial program 77.1%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f6476.3
Applied rewrites76.3%
if -1.75000000000000005e72 < t < 1.1e134Initial program 97.6%
Taylor expanded in y around inf
div-subN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6478.1
Applied rewrites78.1%
Applied rewrites83.7%
Final simplification81.2%
(FPCore (x y z t) :precision binary64 (if (or (<= z -7.2e+42) (not (<= z 1.18e+14))) (* z (/ y t)) (* (- 1.0 (/ y t)) x)))
double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e+42) || !(z <= 1.18e+14)) {
tmp = z * (y / t);
} else {
tmp = (1.0 - (y / t)) * 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 ((z <= (-7.2d+42)) .or. (.not. (z <= 1.18d+14))) then
tmp = z * (y / t)
else
tmp = (1.0d0 - (y / t)) * x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if ((z <= -7.2e+42) || !(z <= 1.18e+14)) {
tmp = z * (y / t);
} else {
tmp = (1.0 - (y / t)) * x;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (z <= -7.2e+42) or not (z <= 1.18e+14): tmp = z * (y / t) else: tmp = (1.0 - (y / t)) * x return tmp
function code(x, y, z, t) tmp = 0.0 if ((z <= -7.2e+42) || !(z <= 1.18e+14)) tmp = Float64(z * Float64(y / t)); else tmp = Float64(Float64(1.0 - Float64(y / t)) * x); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((z <= -7.2e+42) || ~((z <= 1.18e+14))) tmp = z * (y / t); else tmp = (1.0 - (y / t)) * x; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[z, -7.2e+42], N[Not[LessEqual[z, 1.18e+14]], $MachinePrecision]], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+42} \lor \neg \left(z \leq 1.18 \cdot 10^{+14}\right):\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{else}:\\
\;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\
\end{array}
\end{array}
if z < -7.2000000000000002e42 or 1.18e14 < z Initial program 89.2%
Taylor expanded in x around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6464.2
Applied rewrites64.2%
Applied rewrites72.5%
if -7.2000000000000002e42 < z < 1.18e14Initial program 91.9%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f6481.8
Applied rewrites81.8%
Final simplification77.4%
(FPCore (x y z t) :precision binary64 (if (<= z -7.2e+42) (* z (/ y t)) (if (<= z 1.2e-98) (* (- 1.0 (/ y t)) x) (* (/ (- z x) t) y))))
double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.2e+42) {
tmp = z * (y / t);
} else if (z <= 1.2e-98) {
tmp = (1.0 - (y / t)) * x;
} else {
tmp = ((z - x) / 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 <= (-7.2d+42)) then
tmp = z * (y / t)
else if (z <= 1.2d-98) then
tmp = (1.0d0 - (y / t)) * x
else
tmp = ((z - x) / t) * y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t) {
double tmp;
if (z <= -7.2e+42) {
tmp = z * (y / t);
} else if (z <= 1.2e-98) {
tmp = (1.0 - (y / t)) * x;
} else {
tmp = ((z - x) / t) * y;
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if z <= -7.2e+42: tmp = z * (y / t) elif z <= 1.2e-98: tmp = (1.0 - (y / t)) * x else: tmp = ((z - x) / t) * y return tmp
function code(x, y, z, t) tmp = 0.0 if (z <= -7.2e+42) tmp = Float64(z * Float64(y / t)); elseif (z <= 1.2e-98) tmp = Float64(Float64(1.0 - Float64(y / t)) * x); else tmp = Float64(Float64(Float64(z - x) / t) * y); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if (z <= -7.2e+42) tmp = z * (y / t); elseif (z <= 1.2e-98) tmp = (1.0 - (y / t)) * x; else tmp = ((z - x) / t) * y; end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[LessEqual[z, -7.2e+42], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.2e-98], N[(N[(1.0 - N[(y / t), $MachinePrecision]), $MachinePrecision] * x), $MachinePrecision], N[(N[(N[(z - x), $MachinePrecision] / t), $MachinePrecision] * y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -7.2 \cdot 10^{+42}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\mathbf{elif}\;z \leq 1.2 \cdot 10^{-98}:\\
\;\;\;\;\left(1 - \frac{y}{t}\right) \cdot x\\
\mathbf{else}:\\
\;\;\;\;\frac{z - x}{t} \cdot y\\
\end{array}
\end{array}
if z < -7.2000000000000002e42Initial program 88.1%
Taylor expanded in x around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6469.6
Applied rewrites69.6%
Applied rewrites77.0%
if -7.2000000000000002e42 < z < 1.20000000000000002e-98Initial program 93.3%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f6487.1
Applied rewrites87.1%
if 1.20000000000000002e-98 < z Initial program 89.2%
Taylor expanded in y around inf
div-subN/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f64N/A
lower--.f6469.1
Applied rewrites69.1%
(FPCore (x y z t) :precision binary64 (if (or (<= t -9.5e+135) (not (<= t 1e+134))) (* 1.0 x) (* z (/ y t))))
double code(double x, double y, double z, double t) {
double tmp;
if ((t <= -9.5e+135) || !(t <= 1e+134)) {
tmp = 1.0 * x;
} else {
tmp = 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 <= (-9.5d+135)) .or. (.not. (t <= 1d+134))) then
tmp = 1.0d0 * x
else
tmp = 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 <= -9.5e+135) || !(t <= 1e+134)) {
tmp = 1.0 * x;
} else {
tmp = z * (y / t);
}
return tmp;
}
def code(x, y, z, t): tmp = 0 if (t <= -9.5e+135) or not (t <= 1e+134): tmp = 1.0 * x else: tmp = z * (y / t) return tmp
function code(x, y, z, t) tmp = 0.0 if ((t <= -9.5e+135) || !(t <= 1e+134)) tmp = Float64(1.0 * x); else tmp = Float64(z * Float64(y / t)); end return tmp end
function tmp_2 = code(x, y, z, t) tmp = 0.0; if ((t <= -9.5e+135) || ~((t <= 1e+134))) tmp = 1.0 * x; else tmp = z * (y / t); end tmp_2 = tmp; end
code[x_, y_, z_, t_] := If[Or[LessEqual[t, -9.5e+135], N[Not[LessEqual[t, 1e+134]], $MachinePrecision]], N[(1.0 * x), $MachinePrecision], N[(z * N[(y / t), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -9.5 \cdot 10^{+135} \lor \neg \left(t \leq 10^{+134}\right):\\
\;\;\;\;1 \cdot x\\
\mathbf{else}:\\
\;\;\;\;z \cdot \frac{y}{t}\\
\end{array}
\end{array}
if t < -9.50000000000000036e135 or 9.99999999999999921e133 < t Initial program 78.2%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f6481.6
Applied rewrites81.6%
Taylor expanded in y around 0
Applied rewrites74.8%
if -9.50000000000000036e135 < t < 9.99999999999999921e133Initial program 95.7%
Taylor expanded in x around 0
associate-/l*N/A
*-commutativeN/A
lower-*.f64N/A
lower-/.f6451.8
Applied rewrites51.8%
Applied rewrites58.0%
Final simplification62.9%
(FPCore (x y z t) :precision binary64 (* 1.0 x))
double code(double x, double y, double z, double t) {
return 1.0 * 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 = 1.0d0 * x
end function
public static double code(double x, double y, double z, double t) {
return 1.0 * x;
}
def code(x, y, z, t): return 1.0 * x
function code(x, y, z, t) return Float64(1.0 * x) end
function tmp = code(x, y, z, t) tmp = 1.0 * x; end
code[x_, y_, z_, t_] := N[(1.0 * x), $MachinePrecision]
\begin{array}{l}
\\
1 \cdot x
\end{array}
Initial program 90.6%
Taylor expanded in x around inf
*-commutativeN/A
lower-*.f64N/A
fp-cancel-sign-sub-invN/A
metadata-evalN/A
*-lft-identityN/A
lower--.f64N/A
lower-/.f6460.3
Applied rewrites60.3%
Taylor expanded in y around 0
Applied rewrites34.2%
(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 2024339
(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)))