
(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 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(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
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -1e+295) (not (<= t_1 2e+264)))
(* y (+ (/ (- z t) (- z a)) (/ x y)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -1e+295) || !(t_1 <= 2e+264)) {
tmp = y * (((z - t) / (z - a)) + (x / y));
} else {
tmp = x + t_1;
}
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 = (y * (z - t)) / (z - a)
if ((t_1 <= (-1d+295)) .or. (.not. (t_1 <= 2d+264))) then
tmp = y * (((z - t) / (z - a)) + (x / y))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -1e+295) || !(t_1 <= 2e+264)) {
tmp = y * (((z - t) / (z - a)) + (x / y));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -1e+295) or not (t_1 <= 2e+264): tmp = y * (((z - t) / (z - a)) + (x / y)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -1e+295) || !(t_1 <= 2e+264)) tmp = Float64(y * Float64(Float64(Float64(z - t) / Float64(z - a)) + Float64(x / y))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -1e+295) || ~((t_1 <= 2e+264))) tmp = y * (((z - t) / (z - a)) + (x / y)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+295], N[Not[LessEqual[t$95$1, 2e+264]], $MachinePrecision]], N[(y * N[(N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + N[(x / y), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+295} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+264}\right):\\
\;\;\;\;y \cdot \left(\frac{z - t}{z - a} + \frac{x}{y}\right)\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -9.9999999999999998e294 or 2.00000000000000009e264 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 42.6%
+-commutative42.6%
*-commutative42.6%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in y around inf 99.9%
associate--l+99.9%
div-sub99.9%
Simplified99.9%
if -9.9999999999999998e294 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2.00000000000000009e264Initial program 99.4%
Final simplification99.5%
(FPCore (x y z t a) :precision binary64 (fma y (/ (- z t) (- z a)) x))
double code(double x, double y, double z, double t, double a) {
return fma(y, ((z - t) / (z - a)), x);
}
function code(x, y, z, t, a) return fma(y, Float64(Float64(z - t) / Float64(z - a)), x) end
code[x_, y_, z_, t_, a_] := N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision] + x), $MachinePrecision]
\begin{array}{l}
\\
\mathsf{fma}\left(y, \frac{z - t}{z - a}, x\right)
\end{array}
Initial program 84.5%
+-commutative84.5%
associate-/l*97.6%
fma-define97.6%
Simplified97.6%
(FPCore (x y z t a)
:precision binary64
(let* ((t_1 (/ (* y (- z t)) (- z a))))
(if (or (<= t_1 -1e+295) (not (<= t_1 2e+295)))
(* y (/ (- z t) (- z a)))
(+ x t_1))))
double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -1e+295) || !(t_1 <= 2e+295)) {
tmp = y * ((z - t) / (z - a));
} else {
tmp = x + t_1;
}
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 = (y * (z - t)) / (z - a)
if ((t_1 <= (-1d+295)) .or. (.not. (t_1 <= 2d+295))) then
tmp = y * ((z - t) / (z - a))
else
tmp = x + t_1
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double t_1 = (y * (z - t)) / (z - a);
double tmp;
if ((t_1 <= -1e+295) || !(t_1 <= 2e+295)) {
tmp = y * ((z - t) / (z - a));
} else {
tmp = x + t_1;
}
return tmp;
}
def code(x, y, z, t, a): t_1 = (y * (z - t)) / (z - a) tmp = 0 if (t_1 <= -1e+295) or not (t_1 <= 2e+295): tmp = y * ((z - t) / (z - a)) else: tmp = x + t_1 return tmp
function code(x, y, z, t, a) t_1 = Float64(Float64(y * Float64(z - t)) / Float64(z - a)) tmp = 0.0 if ((t_1 <= -1e+295) || !(t_1 <= 2e+295)) tmp = Float64(y * Float64(Float64(z - t) / Float64(z - a))); else tmp = Float64(x + t_1); end return tmp end
function tmp_2 = code(x, y, z, t, a) t_1 = (y * (z - t)) / (z - a); tmp = 0.0; if ((t_1 <= -1e+295) || ~((t_1 <= 2e+295))) tmp = y * ((z - t) / (z - a)); else tmp = x + t_1; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := Block[{t$95$1 = N[(N[(y * N[(z - t), $MachinePrecision]), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]}, If[Or[LessEqual[t$95$1, -1e+295], N[Not[LessEqual[t$95$1, 2e+295]], $MachinePrecision]], N[(y * N[(N[(z - t), $MachinePrecision] / N[(z - a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + t$95$1), $MachinePrecision]]]
\begin{array}{l}
\\
\begin{array}{l}
t_1 := \frac{y \cdot \left(z - t\right)}{z - a}\\
\mathbf{if}\;t\_1 \leq -1 \cdot 10^{+295} \lor \neg \left(t\_1 \leq 2 \cdot 10^{+295}\right):\\
\;\;\;\;y \cdot \frac{z - t}{z - a}\\
\mathbf{else}:\\
\;\;\;\;x + t\_1\\
\end{array}
\end{array}
if (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < -9.9999999999999998e294 or 2e295 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) Initial program 39.9%
+-commutative39.9%
*-commutative39.9%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in x around inf 38.7%
associate-/l*67.9%
*-commutative67.9%
Simplified67.9%
Taylor expanded in x around 0 39.9%
associate-/l*84.6%
Simplified84.6%
if -9.9999999999999998e294 < (/.f64 (*.f64 y (-.f64 z t)) (-.f64 z a)) < 2e295Initial program 99.4%
Final simplification95.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.2e-63) (not (<= z 3.9e+43))) (+ x (* (- z t) (/ y z))) (+ x (/ (* y t) (- a z)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.2e-63) || !(z <= 3.9e+43)) {
tmp = x + ((z - t) * (y / 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 <= (-2.2d-63)) .or. (.not. (z <= 3.9d+43))) then
tmp = x + ((z - t) * (y / 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 <= -2.2e-63) || !(z <= 3.9e+43)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + ((y * t) / (a - z));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.2e-63) or not (z <= 3.9e+43): tmp = x + ((z - t) * (y / z)) else: tmp = x + ((y * t) / (a - z)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.2e-63) || !(z <= 3.9e+43)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(Float64(y * t) / Float64(a - z))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.2e-63) || ~((z <= 3.9e+43))) tmp = x + ((z - t) * (y / z)); else tmp = x + ((y * t) / (a - z)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.2e-63], N[Not[LessEqual[z, 3.9e+43]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / N[(a - z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.2 \cdot 10^{-63} \lor \neg \left(z \leq 3.9 \cdot 10^{+43}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a - z}\\
\end{array}
\end{array}
if z < -2.2e-63 or 3.9000000000000001e43 < z Initial program 75.9%
Taylor expanded in a around 0 68.0%
*-commutative68.0%
associate-/l*88.2%
Simplified88.2%
if -2.2e-63 < z < 3.9000000000000001e43Initial program 95.7%
Taylor expanded in t around inf 90.0%
associate-*r/90.0%
mul-1-neg90.0%
distribute-lft-neg-out90.0%
*-commutative90.0%
Simplified90.0%
Final simplification89.0%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.5e-63) (not (<= z 7.4e+43))) (+ x (* (- z t) (/ y z))) (- x (* (- z t) (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.5e-63) || !(z <= 7.4e+43)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x - ((z - t) * (y / 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 <= (-2.5d-63)) .or. (.not. (z <= 7.4d+43))) then
tmp = x + ((z - t) * (y / z))
else
tmp = x - ((z - t) * (y / 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 <= -2.5e-63) || !(z <= 7.4e+43)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x - ((z - t) * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.5e-63) or not (z <= 7.4e+43): tmp = x + ((z - t) * (y / z)) else: tmp = x - ((z - t) * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.5e-63) || !(z <= 7.4e+43)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x - Float64(Float64(z - t) * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.5e-63) || ~((z <= 7.4e+43))) tmp = x + ((z - t) * (y / z)); else tmp = x - ((z - t) * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.5e-63], N[Not[LessEqual[z, 7.4e+43]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x - N[(N[(z - t), $MachinePrecision] * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.5 \cdot 10^{-63} \lor \neg \left(z \leq 7.4 \cdot 10^{+43}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x - \left(z - t\right) \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.5000000000000001e-63 or 7.4000000000000002e43 < z Initial program 75.9%
Taylor expanded in a around 0 68.0%
*-commutative68.0%
associate-/l*88.2%
Simplified88.2%
if -2.5000000000000001e-63 < z < 7.4000000000000002e43Initial program 95.7%
Taylor expanded in a around inf 85.6%
associate-*r/85.6%
associate-*r*85.6%
*-commutative85.6%
associate-/l*89.8%
associate-*r/89.8%
mul-1-neg89.8%
distribute-neg-frac289.8%
Simplified89.8%
Final simplification88.9%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.45e-64) (not (<= z 5.6e+45))) (+ x (* (- z t) (/ y z))) (+ x (* y (/ (- t z) a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.45e-64) || !(z <= 5.6e+45)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y * ((t - 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 ((z <= (-1.45d-64)) .or. (.not. (z <= 5.6d+45))) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (y * ((t - 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 ((z <= -1.45e-64) || !(z <= 5.6e+45)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (y * ((t - z) / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.45e-64) or not (z <= 5.6e+45): tmp = x + ((z - t) * (y / z)) else: tmp = x + (y * ((t - z) / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.45e-64) || !(z <= 5.6e+45)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(y * Float64(Float64(t - z) / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.45e-64) || ~((z <= 5.6e+45))) tmp = x + ((z - t) * (y / z)); else tmp = x + (y * ((t - z) / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.45e-64], N[Not[LessEqual[z, 5.6e+45]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(y * N[(N[(t - z), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.45 \cdot 10^{-64} \lor \neg \left(z \leq 5.6 \cdot 10^{+45}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + y \cdot \frac{t - z}{a}\\
\end{array}
\end{array}
if z < -1.4499999999999999e-64 or 5.5999999999999999e45 < z Initial program 75.9%
Taylor expanded in a around 0 68.0%
*-commutative68.0%
associate-/l*88.2%
Simplified88.2%
if -1.4499999999999999e-64 < z < 5.5999999999999999e45Initial program 95.7%
+-commutative95.7%
*-commutative95.7%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in a around inf 85.6%
mul-1-neg85.6%
unsub-neg85.6%
associate-/l*86.2%
Simplified86.2%
Final simplification87.3%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -2.1e-64) (not (<= z 3.9e+43))) (+ x (* (- z t) (/ y z))) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -2.1e-64) || !(z <= 3.9e+43)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (t * (y / 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 <= (-2.1d-64)) .or. (.not. (z <= 3.9d+43))) then
tmp = x + ((z - t) * (y / z))
else
tmp = x + (t * (y / 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 <= -2.1e-64) || !(z <= 3.9e+43)) {
tmp = x + ((z - t) * (y / z));
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -2.1e-64) or not (z <= 3.9e+43): tmp = x + ((z - t) * (y / z)) else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -2.1e-64) || !(z <= 3.9e+43)) tmp = Float64(x + Float64(Float64(z - t) * Float64(y / z))); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -2.1e-64) || ~((z <= 3.9e+43))) tmp = x + ((z - t) * (y / z)); else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -2.1e-64], N[Not[LessEqual[z, 3.9e+43]], $MachinePrecision]], N[(x + N[(N[(z - t), $MachinePrecision] * N[(y / z), $MachinePrecision]), $MachinePrecision]), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -2.1 \cdot 10^{-64} \lor \neg \left(z \leq 3.9 \cdot 10^{+43}\right):\\
\;\;\;\;x + \left(z - t\right) \cdot \frac{y}{z}\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -2.10000000000000011e-64 or 3.9000000000000001e43 < z Initial program 75.9%
Taylor expanded in a around 0 68.0%
*-commutative68.0%
associate-/l*88.2%
Simplified88.2%
if -2.10000000000000011e-64 < z < 3.9000000000000001e43Initial program 95.7%
+-commutative95.7%
*-commutative95.7%
associate-/l*98.3%
fma-define98.3%
Simplified98.3%
Taylor expanded in z around 0 81.8%
+-commutative81.8%
associate-/l*85.9%
Simplified85.9%
Final simplification87.2%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.85e+21) (not (<= z 3.9e+34))) (+ y x) (+ x (* t (/ y a)))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.85e+21) || !(z <= 3.9e+34)) {
tmp = y + x;
} else {
tmp = x + (t * (y / 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 <= (-1.85d+21)) .or. (.not. (z <= 3.9d+34))) then
tmp = y + x
else
tmp = x + (t * (y / 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 <= -1.85e+21) || !(z <= 3.9e+34)) {
tmp = y + x;
} else {
tmp = x + (t * (y / a));
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.85e+21) or not (z <= 3.9e+34): tmp = y + x else: tmp = x + (t * (y / a)) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.85e+21) || !(z <= 3.9e+34)) tmp = Float64(y + x); else tmp = Float64(x + Float64(t * Float64(y / a))); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.85e+21) || ~((z <= 3.9e+34))) tmp = y + x; else tmp = x + (t * (y / a)); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.85e+21], N[Not[LessEqual[z, 3.9e+34]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(t * N[(y / a), $MachinePrecision]), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.85 \cdot 10^{+21} \lor \neg \left(z \leq 3.9 \cdot 10^{+34}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + t \cdot \frac{y}{a}\\
\end{array}
\end{array}
if z < -1.85e21 or 3.90000000000000019e34 < z Initial program 74.1%
+-commutative74.1%
*-commutative74.1%
associate-/l*95.6%
fma-define95.6%
Simplified95.6%
Taylor expanded in z around inf 84.8%
+-commutative84.8%
Simplified84.8%
if -1.85e21 < z < 3.90000000000000019e34Initial program 96.0%
+-commutative96.0%
*-commutative96.0%
associate-/l*98.4%
fma-define98.4%
Simplified98.4%
Taylor expanded in z around 0 80.9%
+-commutative80.9%
associate-/l*84.6%
Simplified84.6%
Final simplification84.7%
(FPCore (x y z t a) :precision binary64 (if (or (<= z -1.9e+21) (not (<= z 3.9e+34))) (+ y x) (+ x (/ (* y t) a))))
double code(double x, double y, double z, double t, double a) {
double tmp;
if ((z <= -1.9e+21) || !(z <= 3.9e+34)) {
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 <= (-1.9d+21)) .or. (.not. (z <= 3.9d+34))) 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 <= -1.9e+21) || !(z <= 3.9e+34)) {
tmp = y + x;
} else {
tmp = x + ((y * t) / a);
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if (z <= -1.9e+21) or not (z <= 3.9e+34): tmp = y + x else: tmp = x + ((y * t) / a) return tmp
function code(x, y, z, t, a) tmp = 0.0 if ((z <= -1.9e+21) || !(z <= 3.9e+34)) tmp = Float64(y + x); else tmp = Float64(x + Float64(Float64(y * t) / a)); end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if ((z <= -1.9e+21) || ~((z <= 3.9e+34))) tmp = y + x; else tmp = x + ((y * t) / a); end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[Or[LessEqual[z, -1.9e+21], N[Not[LessEqual[z, 3.9e+34]], $MachinePrecision]], N[(y + x), $MachinePrecision], N[(x + N[(N[(y * t), $MachinePrecision] / a), $MachinePrecision]), $MachinePrecision]]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;z \leq -1.9 \cdot 10^{+21} \lor \neg \left(z \leq 3.9 \cdot 10^{+34}\right):\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x + \frac{y \cdot t}{a}\\
\end{array}
\end{array}
if z < -1.9e21 or 3.90000000000000019e34 < z Initial program 74.1%
+-commutative74.1%
*-commutative74.1%
associate-/l*95.6%
fma-define95.6%
Simplified95.6%
Taylor expanded in z around inf 84.8%
+-commutative84.8%
Simplified84.8%
if -1.9e21 < z < 3.90000000000000019e34Initial program 96.0%
Taylor expanded in z around 0 80.9%
Final simplification82.9%
(FPCore (x y z t a) :precision binary64 (if (<= a 1.85e+50) (+ y x) x))
double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.85e+50) {
tmp = y + x;
} else {
tmp = 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 (a <= 1.85d+50) then
tmp = y + x
else
tmp = x
end if
code = tmp
end function
public static double code(double x, double y, double z, double t, double a) {
double tmp;
if (a <= 1.85e+50) {
tmp = y + x;
} else {
tmp = x;
}
return tmp;
}
def code(x, y, z, t, a): tmp = 0 if a <= 1.85e+50: tmp = y + x else: tmp = x return tmp
function code(x, y, z, t, a) tmp = 0.0 if (a <= 1.85e+50) tmp = Float64(y + x); else tmp = x; end return tmp end
function tmp_2 = code(x, y, z, t, a) tmp = 0.0; if (a <= 1.85e+50) tmp = y + x; else tmp = x; end tmp_2 = tmp; end
code[x_, y_, z_, t_, a_] := If[LessEqual[a, 1.85e+50], N[(y + x), $MachinePrecision], x]
\begin{array}{l}
\\
\begin{array}{l}
\mathbf{if}\;a \leq 1.85 \cdot 10^{+50}:\\
\;\;\;\;y + x\\
\mathbf{else}:\\
\;\;\;\;x\\
\end{array}
\end{array}
if a < 1.85e50Initial program 84.7%
+-commutative84.7%
*-commutative84.7%
associate-/l*97.1%
fma-define97.1%
Simplified97.1%
Taylor expanded in z around inf 65.0%
+-commutative65.0%
Simplified65.0%
if 1.85e50 < a Initial program 83.7%
+-commutative83.7%
*-commutative83.7%
associate-/l*96.0%
fma-define96.0%
Simplified96.0%
Taylor expanded in y around 0 74.2%
(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 84.5%
+-commutative84.5%
*-commutative84.5%
associate-/l*96.9%
fma-define96.9%
Simplified96.9%
Taylor expanded in y around 0 51.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 2024111
(FPCore (x y z t a)
:name "Graphics.Rendering.Plot.Render.Plot.Axis:renderAxisTicks from plot-0.2.3.4, A"
:precision binary64
:alt
(+ x (/ y (/ (- z a) (- z t))))
(+ x (/ (* y (- z t)) (- z a))))