
(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}
Sampling outcomes in binary64 precision:
Herbie found 11 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(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}
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a)))) (if (<= t_1 1e+170) (fma y t_1 x) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e+170) {
tmp = fma(y, t_1, x);
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e+170) tmp = fma(y, t_1, x); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+170], N[(y * t$95$1 + x), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{+170}:\\
\;\;\;\;\mathsf{fma}\left(y, t\_1, x\right)\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000003e170Initial program 98.8%
+-commutative98.8%
fma-define98.8%
Simplified98.8%
if 1.00000000000000003e170 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 40.6%
associate-*r/88.0%
Simplified88.0%
Taylor expanded in z around 0 88.0%
neg-mul-188.0%
Simplified88.0%
div-inv87.6%
add-sqr-sqrt50.2%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod12.6%
add-sqr-sqrt12.7%
remove-double-neg12.7%
distribute-rgt-neg-out12.7%
cancel-sign-sub-inv12.7%
*-commutative12.7%
associate-*l*12.7%
div-inv12.7%
add-sqr-sqrt0.1%
sqrt-unprod13.1%
sqr-neg13.1%
sqrt-unprod37.3%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (let* ((t_1 (/ (- z t) (- z a)))) (if (<= t_1 1e+170) (+ x (* t_1 y)) (+ x (* t (/ y (- a z)))))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e+170) {
tmp = x + (t_1 * y);
} else {
tmp = x + (t * (y / (a - 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) :: t_1
real(8) :: tmp
t_1 = (z - t) / (z - a)
if (t_1 <= 1d+170) then
tmp = x + (t_1 * y)
else
tmp = x + (t * (y / (a - z)))
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (z - t) / (z - a);
double tmp;
if (t_1 <= 1e+170) {
tmp = x + (t_1 * y);
} else {
tmp = x + (t * (y / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (z - t) / (z - a) tmp = 0 if t_1 <= 1e+170: tmp = x + (t_1 * y) else: tmp = x + (t * (y / (a - z))) return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(z - t) / Float64(z - a)) tmp = 0.0 if (t_1 <= 1e+170) tmp = Float64(x + Float64(t_1 * y)); else tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (z - t) / (z - a); tmp = 0.0; if (t_1 <= 1e+170) tmp = x + (t_1 * y); else tmp = x + (t * (y / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[LessEqual[t$95$1, 1e+170], N[(x + N[(t$95$1 * y), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{z - t}{z - a}\\
\mathbf{if}\;t\_1 \leq 10^{+170}:\\
\;\;\;\;x + t\_1 \cdot y\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\end{array}
\end{array}
if (/.f64 (-.f64 z t) (-.f64 z a)) < 1.00000000000000003e170Initial program 98.8%
if 1.00000000000000003e170 < (/.f64 (-.f64 z t) (-.f64 z a)) Initial program 40.6%
associate-*r/88.0%
Simplified88.0%
Taylor expanded in z around 0 88.0%
neg-mul-188.0%
Simplified88.0%
div-inv87.6%
add-sqr-sqrt50.2%
sqrt-unprod28.4%
sqr-neg28.4%
sqrt-unprod12.6%
add-sqr-sqrt12.7%
remove-double-neg12.7%
distribute-rgt-neg-out12.7%
cancel-sign-sub-inv12.7%
*-commutative12.7%
associate-*l*12.7%
div-inv12.7%
add-sqr-sqrt0.1%
sqrt-unprod13.1%
sqr-neg13.1%
sqrt-unprod37.3%
add-sqr-sqrt99.6%
Applied egg-rr99.6%
Final simplification98.8%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.04e+89) (not (<= z 1.9e+67))) (- x (* y (/ (- t z) z))) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.04e+89) || !(z <= 1.9e+67)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y * (t / (a - 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.04d+89)) .or. (.not. (z <= 1.9d+67))) then
tmp = x - (y * ((t - z) / z))
else
tmp = x + (y * (t / (a - 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.04e+89) || !(z <= 1.9e+67)) {
tmp = x - (y * ((t - z) / z));
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.04e+89) or not (z <= 1.9e+67): tmp = x - (y * ((t - z) / z)) else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.04e+89) || !(z <= 1.9e+67)) tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.04e+89) || ~((z <= 1.9e+67))) tmp = x - (y * ((t - z) / z)); else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.04e+89], N[Not[LessEqual[z, 1.9e+67]], $MachinePrecision]], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.04 \cdot 10^{+89} \lor \neg \left(z \leq 1.9 \cdot 10^{+67}\right):\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.04e89 or 1.9000000000000001e67 < z Initial program 100.0%
Taylor expanded in a around 0 91.1%
if -1.04e89 < z < 1.9000000000000001e67Initial program 95.1%
Taylor expanded in t around inf 86.1%
associate-*r/86.1%
mul-1-neg86.1%
distribute-lft-neg-out86.1%
*-commutative86.1%
*-lft-identity86.1%
times-frac88.0%
/-rgt-identity88.0%
distribute-neg-frac88.0%
distribute-neg-frac288.0%
neg-sub088.0%
sub-neg88.0%
+-commutative88.0%
associate--r+88.0%
neg-sub088.0%
remove-double-neg88.0%
Simplified88.0%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.36e+135) (not (<= z 2.8e+82))) (+ y x) (+ x (* y (/ t (- a z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.36e+135) || !(z <= 2.8e+82)) {
tmp = y + x;
} else {
tmp = x + (y * (t / (a - 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.36d+135)) .or. (.not. (z <= 2.8d+82))) then
tmp = y + x
else
tmp = x + (y * (t / (a - 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.36e+135) || !(z <= 2.8e+82)) {
tmp = y + x;
} else {
tmp = x + (y * (t / (a - z)));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.36e+135) or not (z <= 2.8e+82): tmp = y + x else: tmp = x + (y * (t / (a - z))) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.36e+135) || !(z <= 2.8e+82)) tmp = Float64(y + x); else tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.36e+135) || ~((z <= 2.8e+82))) tmp = y + x; else tmp = x + (y * (t / (a - z))); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.36e+135], N[Not[LessEqual[z, 2.8e+82]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.36 \cdot 10^{+135} \lor \neg \left(z \leq 2.8 \cdot 10^{+82}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\end{array}
\end{array}
if z < -1.36000000000000007e135 or 2.8e82 < z Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in z around inf 86.4%
+-commutative86.4%
Simplified86.4%
if -1.36000000000000007e135 < z < 2.8e82Initial program 95.6%
Taylor expanded in t around inf 83.4%
associate-*r/83.4%
mul-1-neg83.4%
distribute-lft-neg-out83.4%
*-commutative83.4%
*-lft-identity83.4%
times-frac86.1%
/-rgt-identity86.1%
distribute-neg-frac86.1%
distribute-neg-frac286.1%
neg-sub086.1%
sub-neg86.1%
+-commutative86.1%
associate--r+86.1%
neg-sub086.1%
remove-double-neg86.1%
Simplified86.1%
Final simplification86.2%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.15e+60) (+ x (* y (/ z (- z a)))) (if (<= z 1.75e+65) (+ x (* t (/ y (- a z)))) (- x (* y (/ (- t z) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.15e+60) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.75e+65) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (y * ((t - z) / 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 <= (-3.15d+60)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 1.75d+65) then
tmp = x + (t * (y / (a - z)))
else
tmp = x - (y * ((t - z) / 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 <= -3.15e+60) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 1.75e+65) {
tmp = x + (t * (y / (a - z)));
} else {
tmp = x - (y * ((t - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.15e+60: tmp = x + (y * (z / (z - a))) elif z <= 1.75e+65: tmp = x + (t * (y / (a - z))) else: tmp = x - (y * ((t - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.15e+60) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 1.75e+65) tmp = Float64(x + Float64(t * Float64(y / Float64(a - z)))); else tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.15e+60) tmp = x + (y * (z / (z - a))); elseif (z <= 1.75e+65) tmp = x + (t * (y / (a - z))); else tmp = x - (y * ((t - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.15e+60], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 1.75e+65], N[(x + N[(t * N[(y / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.15 \cdot 10^{+60}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 1.75 \cdot 10^{+65}:\\
\;\;\;\;x + t \cdot \frac{y}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\end{array}
\end{array}
if z < -3.1500000000000002e60Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around 0 66.3%
+-commutative66.3%
associate-/l*86.2%
Simplified86.2%
if -3.1500000000000002e60 < z < 1.75e65Initial program 94.9%
associate-*r/92.6%
Simplified92.6%
Taylor expanded in z around 0 86.3%
neg-mul-186.3%
Simplified86.3%
div-inv86.3%
add-sqr-sqrt51.7%
sqrt-unprod62.1%
sqr-neg62.1%
sqrt-unprod20.6%
add-sqr-sqrt52.3%
remove-double-neg52.3%
distribute-rgt-neg-out52.3%
cancel-sign-sub-inv52.3%
*-commutative52.3%
associate-*l*52.4%
div-inv52.4%
add-sqr-sqrt31.7%
sqrt-unprod58.6%
sqr-neg58.6%
sqrt-unprod36.3%
add-sqr-sqrt89.7%
Applied egg-rr89.7%
if 1.75e65 < z Initial program 99.9%
Taylor expanded in a around 0 97.4%
Final simplification90.1%
(FPCore (x y z t a) :precision binary64 (if (<= z -3.1e+58) (+ x (* y (/ z (- z a)))) (if (<= z 2.2e+65) (+ x (* y (/ t (- a z)))) (- x (* y (/ (- t z) z))))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (z <= -3.1e+58) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 2.2e+65) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (y * ((t - z) / 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 <= (-3.1d+58)) then
tmp = x + (y * (z / (z - a)))
else if (z <= 2.2d+65) then
tmp = x + (y * (t / (a - z)))
else
tmp = x - (y * ((t - z) / 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 <= -3.1e+58) {
tmp = x + (y * (z / (z - a)));
} else if (z <= 2.2e+65) {
tmp = x + (y * (t / (a - z)));
} else {
tmp = x - (y * ((t - z) / z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if z <= -3.1e+58: tmp = x + (y * (z / (z - a))) elif z <= 2.2e+65: tmp = x + (y * (t / (a - z))) else: tmp = x - (y * ((t - z) / z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if (z <= -3.1e+58) tmp = Float64(x + Float64(y * Float64(z / Float64(z - a)))); elseif (z <= 2.2e+65) tmp = Float64(x + Float64(y * Float64(t / Float64(a - z)))); else tmp = Float64(x - Float64(y * Float64(Float64(t - z) / z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (z <= -3.1e+58) tmp = x + (y * (z / (z - a))); elseif (z <= 2.2e+65) tmp = x + (y * (t / (a - z))); else tmp = x - (y * ((t - z) / z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[z, -3.1e+58], N[(x + N[(y * N[(z / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], If[LessEqual[z, 2.2e+65], N[(x + N[(y * N[(t / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(y * N[(N[(t - z), $MachinePrecision] / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.1 \cdot 10^{+58}:\\
\;\;\;\;x + y \cdot \frac{z}{z - a}\\
\mathbf{elif}\;z \leq 2.2 \cdot 10^{+65}:\\
\;\;\;\;x + y \cdot \frac{t}{a - z}\\
\mathbf{else}:\\
\;\;\;\;x - y \cdot \frac{t - z}{z}\\
\end{array}
\end{array}
if z < -3.0999999999999999e58Initial program 100.0%
+-commutative100.0%
fma-define100.0%
Simplified100.0%
Taylor expanded in t around 0 66.3%
+-commutative66.3%
associate-/l*86.2%
Simplified86.2%
if -3.0999999999999999e58 < z < 2.1999999999999998e65Initial program 94.9%
Taylor expanded in t around inf 86.3%
associate-*r/86.3%
mul-1-neg86.3%
distribute-lft-neg-out86.3%
*-commutative86.3%
*-lft-identity86.3%
times-frac88.3%
/-rgt-identity88.3%
distribute-neg-frac88.3%
distribute-neg-frac288.3%
neg-sub088.3%
sub-neg88.3%
+-commutative88.3%
associate--r+88.3%
neg-sub088.3%
remove-double-neg88.3%
Simplified88.3%
if 2.1999999999999998e65 < z Initial program 99.9%
Taylor expanded in a around 0 97.4%
Final simplification89.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -5.4e-105) (not (<= z 1.7e+49))) (+ y x) (+ x (/ t (/ a y)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -5.4e-105) || !(z <= 1.7e+49)) {
tmp = y + x;
} else {
tmp = x + (t / (a / 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 <= (-5.4d-105)) .or. (.not. (z <= 1.7d+49))) then
tmp = y + x
else
tmp = x + (t / (a / 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 <= -5.4e-105) || !(z <= 1.7e+49)) {
tmp = y + x;
} else {
tmp = x + (t / (a / y));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -5.4e-105) or not (z <= 1.7e+49): tmp = y + x else: tmp = x + (t / (a / y)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -5.4e-105) || !(z <= 1.7e+49)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t / Float64(a / y))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -5.4e-105) || ~((z <= 1.7e+49))) tmp = y + x; else tmp = x + (t / (a / y)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -5.4e-105], N[Not[LessEqual[z, 1.7e+49]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t / N[(a / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -5.4 \cdot 10^{-105} \lor \neg \left(z \leq 1.7 \cdot 10^{+49}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{t}{\frac{a}{y}}\\
\end{array}
\end{array}
if z < -5.39999999999999985e-105 or 1.7e49 < z Initial program 99.9%
+-commutative99.9%
fma-define99.9%
Simplified99.9%
Taylor expanded in z around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -5.39999999999999985e-105 < z < 1.7e49Initial program 93.3%
+-commutative93.3%
fma-define93.4%
Simplified93.4%
Taylor expanded in z around 0 78.7%
+-commutative78.7%
associate-/l*81.2%
Simplified81.2%
clear-num81.2%
un-div-inv82.8%
Applied egg-rr82.8%
Final simplification79.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -3.9e-146) (not (<= z 9e+53))) (+ y x) (+ x (* y (/ t a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -3.9e-146) || !(z <= 9e+53)) {
tmp = y + x;
} 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.9d-146)) .or. (.not. (z <= 9d+53))) then
tmp = y + x
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.9e-146) || !(z <= 9e+53)) {
tmp = y + x;
} else {
tmp = x + (y * (t / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -3.9e-146) or not (z <= 9e+53): tmp = y + x else: tmp = x + (y * (t / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -3.9e-146) || !(z <= 9e+53)) tmp = Float64(y + x); 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.9e-146) || ~((z <= 9e+53))) tmp = y + x; else tmp = x + (y * (t / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -3.9e-146], N[Not[LessEqual[z, 9e+53]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(y * N[(t / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -3.9 \cdot 10^{-146} \lor \neg \left(z \leq 9 \cdot 10^{+53}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t}{a}\\
\end{array}
\end{array}
if z < -3.90000000000000002e-146 or 9.0000000000000004e53 < z Initial program 99.3%
+-commutative99.3%
fma-define99.3%
Simplified99.3%
Taylor expanded in z around inf 75.8%
+-commutative75.8%
Simplified75.8%
if -3.90000000000000002e-146 < z < 9.0000000000000004e53Initial program 93.8%
Taylor expanded in z around 0 81.8%
Final simplification78.4%
(FPCore (x y z t a) :precision binary64 (if (or (<= t -1.1e+188) (not (<= t 1.12e+262))) (* y (- 1.0 (/ t z))) (+ y x)))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.1e+188) || !(t <= 1.12e+262)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = y + x;
}
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 <= (-1.1d+188)) .or. (.not. (t <= 1.12d+262))) then
tmp = y * (1.0d0 - (t / z))
else
tmp = y + x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if ((t <= -1.1e+188) || !(t <= 1.12e+262)) {
tmp = y * (1.0 - (t / z));
} else {
tmp = y + x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (t <= -1.1e+188) or not (t <= 1.12e+262): tmp = y * (1.0 - (t / z)) else: tmp = y + x return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((t <= -1.1e+188) || !(t <= 1.12e+262)) tmp = Float64(y * Float64(1.0 - Float64(t / z))); else tmp = Float64(y + x); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((t <= -1.1e+188) || ~((t <= 1.12e+262))) tmp = y * (1.0 - (t / z)); else tmp = y + x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[t, -1.1e+188], N[Not[LessEqual[t, 1.12e+262]], $MachinePrecision]], N[(y * N[(1.0 - N[(t / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(y + x), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;t \leq -1.1 \cdot 10^{+188} \lor \neg \left(t \leq 1.12 \cdot 10^{+262}\right):\\
\;\;\;\;y \cdot \left(1 - \frac{t}{z}\right)\\
\mathbf{else}:\\
\;\;\;\;y + x\\
\end{array}
\end{array}
if t < -1.09999999999999999e188 or 1.1199999999999999e262 < t Initial program 88.6%
clear-num88.5%
un-div-inv88.6%
Applied egg-rr88.6%
Taylor expanded in a around 0 65.9%
Taylor expanded in y around inf 51.9%
if -1.09999999999999999e188 < t < 1.1199999999999999e262Initial program 98.2%
+-commutative98.2%
fma-define98.2%
Simplified98.2%
Taylor expanded in z around inf 68.5%
+-commutative68.5%
Simplified68.5%
Final simplification66.3%
(FPCore (x y z t a) :precision binary64 (+ y x))
double code(double x, double y, double z, double t, double a) {
return y + 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 = y + x
end function
public static double code(double x, double y, double z, double t, double a) {
return y + x;
}
def code(x, y, z, t, a): return y + x
function code(x, y, z, t, a) return Float64(y + x) end
function tmp = code(x, y, z, t, a) tmp = y + x; end
code[x_, y_, z_, t_, a_] := N[(y + x), $MachinePrecision]
\begin{array}{l}
\\
y + x
\end{array}
Initial program 96.9%
+-commutative96.9%
fma-define97.0%
Simplified97.0%
Taylor expanded in z around inf 62.8%
+-commutative62.8%
Simplified62.8%
(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 96.9%
+-commutative96.9%
fma-define97.0%
Simplified97.0%
Taylor expanded in y around 0 49.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 2024157
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisLine from plot-0.2.3.4, A"
:precision binary64
:alt
(! :herbie-platform default (+ x (/ y (/ (- z a) (- z t)))))
(+ x (* y (/ (- z t) (- z a)))))