
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
Sampling outcomes in binary64 precision:
Herbie found 8 alternatives:
| Alternative | Accuracy | Speedup |
|---|
(FPCore (x y z t a) :precision binary64 (+ x (/ (* y (- z t)) (- z a))))
double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + ((y * (z - t)) / (z - a))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + ((y * (z - t)) / (z - a));
}
def code(x, y, z, t, a): return x + ((y * (z - t)) / (z - a))
function code(x, y, z, t, a) return Float64(x + Float64(Float64(y * Float64(z - t)) / Float64(z - a))) end
function tmp = code(x, y, z, t, a) tmp = x + ((y * (z - t)) / (z - a)); end
code[x_, y_, z_, t_, a_] := N[(x + N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y \cdot \left(z - t\right)}{z - a}
\end{array}
(FPCore (x y z t a) :precision binary64 (+ x (* y (/ (- z t) (- z a)))))
double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y * ((z - t) / (z - a)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y * ((z - t) / (z - a)));
}
def code(x, y, z, t, a): return x + (y * ((z - t) / (z - a)))
function code(x, y, z, t, a) return Float64(x + Float64(y * Float64(Float64(z - t) / Float64(z - a)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y * ((z - t) / (z - a))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + y \cdot \frac{z - t}{z - a}
\end{array}
Initial program 81.2%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in y around 0 81.2%
associate-*r/98.2%
Simplified98.2%
Final simplification98.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.6e-21) (not (<= z 1.1e-54))) (+ x (* y (- 1.0 (/ t z)))) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.6e-21) || !(z <= 1.1e-54)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((z <= (-3.6d-21)) .or. (.not. (z <= 1.1d-54))) then
tmp = x + (y * (1.0d0 - (t / z)))
else
tmp = x + (y * (t / a))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.6e-21) || !(z <= 1.1e-54)) {
tmp = x + (y * (1.0 - (t / z)));
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.6e-21) or not (z <= 1.1e-54): tmp = x + (y * (1.0 - (t / z))) else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.6e-21) || !(z <= 1.1e-54)) tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); else tmp = Float64(x + Float64(y * Float64(t / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -3.6e-21) || ~((z <= 1.1e-54))) tmp = x + (y * (1.0 - (t / z))); else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.6e-21], N[Not[LessEqual[z, 1.1e-54]], $MachinePrecision]], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.6 \cdot 10^{-21} \lor \neg \left(z \leq 1.1 \cdot 10^{-54}\right):\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.59999999999999989e-21 or 1.1e-54 < z Initial program 72.4%
associate-*l/96.4%
Simplified96.4%
Taylor expanded in y around 0 72.4%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in a around 0 84.6%
div-sub84.6%
*-inverses84.6%
Simplified84.6%
if -3.59999999999999989e-21 < z < 1.1e-54Initial program 90.2%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in y around 0 90.2%
associate-*r/96.5%
Simplified96.5%
Taylor expanded in z around 0 86.2%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -2.4e+42) (not (<= t 7.5e-27))) (- x (* y (/ t (- z a)))) (+ x (* z (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e+42) || !(t <= 7.5e-27)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-2.4d+42)) .or. (.not. (t <= 7.5d-27))) then
tmp = x - (y * (t / (z - a)))
else
tmp = x + (z * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -2.4e+42) || !(t <= 7.5e-27)) {
tmp = x - (y * (t / (z - a)));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -2.4e+42) or not (t <= 7.5e-27): tmp = x - (y * (t / (z - a))) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -2.4e+42) || !(t <= 7.5e-27)) tmp = Float64(x - Float64(y * Float64(t / Float64(z - a)))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -2.4e+42) || ~((t <= 7.5e-27))) tmp = x - (y * (t / (z - a))); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -2.4e+42], N[Not[LessEqual[t, 7.5e-27]], $MachinePrecision]], N[(x - N[(y * N[(t / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -2.4 \cdot 10^{+42} \lor \neg \left(t \leq 7.5 \cdot 10^{-27}\right):\\
\;\;\;\;x - y \cdot \frac{t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -2.3999999999999999e42 or 7.50000000000000029e-27 < t Initial program 78.9%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in t around inf 76.1%
associate-*r/76.1%
mul-1-neg76.1%
distribute-lft-neg-out76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in x around 0 76.1%
mul-1-neg76.1%
*-commutative76.1%
associate-*r/87.9%
sub-neg87.9%
Simplified87.9%
if -2.3999999999999999e42 < t < 7.50000000000000029e-27Initial program 83.2%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in t around 0 76.9%
associate-*l/92.2%
*-commutative92.2%
Simplified92.2%
Final simplification90.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -6.8e+42) (not (<= t 3.2e-32))) (- x (/ y (/ (- z a) t))) (+ x (* z (/ y (- z a))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e+42) || !(t <= 3.2e-32)) {
tmp = x - (y / ((z - a) / t));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if ((t <= (-6.8d+42)) .or. (.not. (t <= 3.2d-32))) then
tmp = x - (y / ((z - a) / t))
else
tmp = x + (z * (y / (z - a)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -6.8e+42) || !(t <= 3.2e-32)) {
tmp = x - (y / ((z - a) / t));
} else {
tmp = x + (z * (y / (z - a)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -6.8e+42) or not (t <= 3.2e-32): tmp = x - (y / ((z - a) / t)) else: tmp = x + (z * (y / (z - a))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -6.8e+42) || !(t <= 3.2e-32)) tmp = Float64(x - Float64(y / Float64(Float64(z - a) / t))); else tmp = Float64(x + Float64(z * Float64(y / Float64(z - a)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -6.8e+42) || ~((t <= 3.2e-32))) tmp = x - (y / ((z - a) / t)); else tmp = x + (z * (y / (z - a))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -6.8e+42], N[Not[LessEqual[t, 3.2e-32]], $MachinePrecision]], N[(x - N[(y / N[(N[(z - a), $MachinePrecision] / t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(z * N[(y / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -6.8 \cdot 10^{+42} \lor \neg \left(t \leq 3.2 \cdot 10^{-32}\right):\\
\;\;\;\;x - \frac{y}{\frac{z - a}{t}}\\
\mathbf{else}:\\
\;\;\;\;x + z \cdot \frac{y}{z - a}\\
\end{array}
\end{array}
if t < -6.7999999999999995e42 or 3.2000000000000002e-32 < t Initial program 78.9%
associate-*l/95.8%
Simplified95.8%
Taylor expanded in t around inf 76.1%
associate-*r/76.1%
mul-1-neg76.1%
distribute-lft-neg-out76.1%
*-commutative76.1%
Simplified76.1%
Taylor expanded in x around 0 76.1%
mul-1-neg76.1%
*-commutative76.1%
associate-*r/87.9%
sub-neg87.9%
Simplified87.9%
clear-num88.0%
un-div-inv88.1%
Applied egg-rr88.1%
if -6.7999999999999995e42 < t < 3.2000000000000002e-32Initial program 83.2%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in t around 0 76.9%
associate-*l/92.2%
*-commutative92.2%
Simplified92.2%
Final simplification90.3%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.55e-22) (+ x (/ y (/ z (- z t)))) (if (<= z 3.2e-53) (+ x (* y (/ t a))) (+ x (* y (- 1.0 (/ t z)))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-22) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 3.2e-53) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.55d-22)) then
tmp = x + (y / (z / (z - t)))
else if (z <= 3.2d-53) then
tmp = x + (y * (t / a))
else
tmp = x + (y * (1.0d0 - (t / z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.55e-22) {
tmp = x + (y / (z / (z - t)));
} else if (z <= 3.2e-53) {
tmp = x + (y * (t / a));
} else {
tmp = x + (y * (1.0 - (t / z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.55e-22: tmp = x + (y / (z / (z - t))) elif z <= 3.2e-53: tmp = x + (y * (t / a)) else: tmp = x + (y * (1.0 - (t / z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.55e-22) tmp = Float64(x + Float64(y / Float64(z / Float64(z - t)))); elseif (z <= 3.2e-53) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + Float64(y * Float64(1.0 - Float64(t / z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.55e-22) tmp = x + (y / (z / (z - t))); elseif (z <= 3.2e-53) tmp = x + (y * (t / a)); else tmp = x + (y * (1.0 - (t / z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.55e-22], N[(x + N[(y / N[(z / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 3.2e-53], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.55 \cdot 10^{-22}:\\
\;\;\;\;x + \frac{y}{\frac{z}{z - t}}\\
\mathbf{elif}\;z \leq 3.2 \cdot 10^{-53}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \left(1 - \frac{t}{z}\right)\\
\end{array}
\end{array}
if z < -1.55000000000000006e-22Initial program 72.4%
associate-*l/94.9%
Simplified94.9%
Taylor expanded in a around 0 63.3%
+-commutative63.3%
associate-/l*84.5%
Simplified84.5%
if -1.55000000000000006e-22 < z < 3.2000000000000001e-53Initial program 90.2%
associate-*l/96.8%
Simplified96.8%
Taylor expanded in y around 0 90.2%
associate-*r/96.5%
Simplified96.5%
Taylor expanded in z around 0 86.2%
if 3.2000000000000001e-53 < z Initial program 72.5%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in y around 0 72.5%
associate-*r/99.9%
Simplified99.9%
Taylor expanded in a around 0 84.8%
div-sub84.8%
*-inverses84.8%
Simplified84.8%
Final simplification85.4%
(FPCore (x y z t a) :precision binary64 (if (<= z -1.9e+58) (+ x y) (if (<= z 1.36e-8) (+ x (* y (/ t a))) (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+58) {
tmp = x + y;
} else if (z <= 1.36e-8) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-1.9d+58)) then
tmp = x + y
else if (z <= 1.36d-8) then
tmp = x + (y * (t / a))
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -1.9e+58) {
tmp = x + y;
} else if (z <= 1.36e-8) {
tmp = x + (y * (t / a));
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -1.9e+58: tmp = x + y elif z <= 1.36e-8: tmp = x + (y * (t / a)) else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -1.9e+58) tmp = Float64(x + y); elseif (z <= 1.36e-8) tmp = Float64(x + Float64(y * Float64(t / a))); else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -1.9e+58) tmp = x + y; elseif (z <= 1.36e-8) tmp = x + (y * (t / a)); else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -1.9e+58], N[(x + y), $MachinePrecision], If[LessEqual[z, 1.36e-8], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+58}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 1.36 \cdot 10^{-8}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -1.8999999999999999e58 or 1.3599999999999999e-8 < z Initial program 67.4%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around inf 79.0%
+-commutative79.0%
Simplified79.0%
if -1.8999999999999999e58 < z < 1.3599999999999999e-8Initial program 90.2%
associate-*l/97.3%
Simplified97.3%
Taylor expanded in y around 0 90.2%
associate-*r/97.1%
Simplified97.1%
Taylor expanded in z around 0 80.5%
Final simplification79.9%
(FPCore (x y z t a) :precision binary64 (if (<= z -4.4e-59) (+ x y) (if (<= z 9.6e-23) x (+ x y))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e-59) {
tmp = x + y;
} else if (z <= 9.6e-23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
real(8) :: tmp
if (z <= (-4.4d-59)) then
tmp = x + y
else if (z <= 9.6d-23) then
tmp = x
else
tmp = x + y
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -4.4e-59) {
tmp = x + y;
} else if (z <= 9.6e-23) {
tmp = x;
} else {
tmp = x + y;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -4.4e-59: tmp = x + y elif z <= 9.6e-23: tmp = x else: tmp = x + y return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -4.4e-59) tmp = Float64(x + y); elseif (z <= 9.6e-23) tmp = x; else tmp = Float64(x + y); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -4.4e-59) tmp = x + y; elseif (z <= 9.6e-23) tmp = x; else tmp = x + y; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -4.4e-59], N[(x + y), $MachinePrecision], If[LessEqual[z, 9.6e-23], x, N[(x + y), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -4.4 \cdot 10^{-59}:\\
\;\;\;\;x + y\\
\mathbf{elif}\;z \leq 9.6 \cdot 10^{-23}:\\
\;\;\;\;x\\
\mathbf{else}:\\
\;\;\;\;x + y\\
\end{array}
\end{array}
if z < -4.3999999999999998e-59 or 9.59999999999999986e-23 < z Initial program 70.5%
associate-*l/95.5%
Simplified95.5%
Taylor expanded in z around inf 71.7%
+-commutative71.7%
Simplified71.7%
if -4.3999999999999998e-59 < z < 9.59999999999999986e-23Initial program 91.3%
associate-*l/97.6%
Simplified97.6%
Taylor expanded in x around inf 54.6%
Final simplification62.9%
(FPCore (x y z t a) :precision binary64 x)
double code(double x, double y, double z, double t, double a) {
return x;
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x
end function
public static double code(double x, double y, double z, double t, double a) {
return x;
}
def code(x, y, z, t, a): return x
function code(x, y, z, t, a) return x end
function tmp = code(x, y, z, t, a) tmp = x; end
code[x_, y_, z_, t_, a_] := x
\begin{array}{l}
\\
x
\end{array}
Initial program 81.2%
associate-*l/96.6%
Simplified96.6%
Taylor expanded in x around inf 48.2%
Final simplification48.2%
(FPCore (x y z t a) :precision binary64 (+ x (/ y (/ (- z a) (- z t)))))
double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
real(8) function code(x, y, z, t, a)
real(8), intent (in) :: x
real(8), intent (in) :: y
real(8), intent (in) :: z
real(8), intent (in) :: t
real(8), intent (in) :: a
code = x + (y / ((z - a) / (z - t)))
end function
public static double code(double x, double y, double z, double t, double a) {
return x + (y / ((z - a) / (z - t)));
}
def code(x, y, z, t, a): return x + (y / ((z - a) / (z - t)))
function code(x, y, z, t, a) return Float64(x + Float64(y / Float64(Float64(z - a) / Float64(z - t)))) end
function tmp = code(x, y, z, t, a) tmp = x + (y / ((z - a) / (z - t))); end
code[x_, y_, z_, t_, a_] := N[(x + N[(y / N[(N[(z - a), $MachinePrecision] / N[(z - t), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]
\begin{array}{l}
\\
x + \frac{y}{\frac{z - a}{z - t}}
\end{array}
herbie shell --seed 2023290
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:herbie-target
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))